Skip to content

Commit 2ca0662

Browse files
committed
Make sure user session still exists
1 parent 5d143ef commit 2ca0662

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/auth/lib/multiFactor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export class MultiFactorUser {
4444
async unenroll(enrollmentId) {
4545
await this._auth.native.unenrollMultiFactor(enrollmentId);
4646

47-
// We need to reload the user otherwise the changes are not visible
48-
return reload(this._auth.currentUser);
47+
if (this._auth.currentUser) {
48+
return reload(this._auth.currentUser);
49+
}
4950
}
5051
}

0 commit comments

Comments
 (0)