Skip to content

Commit

Permalink
fix: Missing identity causes double sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Szuchet committed Sep 18, 2023
1 parent faf918d commit 2cffdb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/identity/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ function* handleConnectWalletSuccess(action: ConnectWalletSuccessAction) {
const identity: AuthIdentity | null = yield call(getIdentity, address)

// If an identity is found, store it and proceed with the login so the state acknowledges that the user is connected.
// If not, proceed with the login in order to retrieve user signature.
if (identity) {
yield put(generateIdentitySuccess(address, identity))
yield put(loginRequest(providerType, true))
} else {
yield put(loginRequest(providerType))
}
}

Expand All @@ -193,9 +196,12 @@ function* handleChangeAccount(action: ChangeAccountAction) {
const identity: AuthIdentity | null = yield call(getIdentity, address)

// If an identity is found, store it and proceed with the login so the state acknowledges that the user is connected.
// If not, proceed with the login in order to retrieve user signature.
if (identity) {
yield put(generateIdentitySuccess(address, identity))
yield put(loginRequest(providerType, true))
} else {
yield put(loginRequest(providerType))
}

yield put(clearAssetPacks())
Expand Down

0 comments on commit 2cffdb5

Please sign in to comment.