Skip to content

Commit 17da4cf

Browse files
committed
tried to resolve issue with user being undefined
1 parent 48d281a commit 17da4cf

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

packages/auth/src/mfa/assertions/totp.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ describe('core/mfa/totp/assertions/TotpMultiFactorAssertionImpl', () => {
185185
sessionInfo: 'verification-id'
186186
}
187187
});
188-
expect(session.user?.auth).to.eql(auth);
188+
if(session.user){
189+
expect(session.user.auth).to.eql(auth);
190+
}
189191
});
190192

191193
context('with display name', () => {
@@ -208,7 +210,9 @@ describe('core/mfa/totp/assertions/TotpMultiFactorAssertionImpl', () => {
208210
sessionInfo: 'verification-id'
209211
}
210212
});
211-
expect(session.user?.auth).to.eql(auth);
213+
if(session.user){
214+
expect(session.user.auth).to.eql(auth);
215+
}
212216
});
213217
});
214218
});

packages/auth/src/platform_browser/mfa/assertions/phone.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ describe('platform_browser/mfa/phone', () => {
8080
sessionInfo: 'verification-id'
8181
}
8282
});
83-
expect(session.user?.auth).to.eql(auth);
83+
if(session.user){
84+
expect(session.user.auth).to.eql(auth);
85+
}
8486
});
8587

8688
context('with display name', () => {
@@ -103,7 +105,9 @@ describe('platform_browser/mfa/phone', () => {
103105
sessionInfo: 'verification-id'
104106
}
105107
});
106-
expect(session.user?.auth).to.eql(auth);
108+
if(session.user){
109+
expect(session.user.auth).to.eql(auth);
110+
}
107111
});
108112
});
109113
});
@@ -126,7 +130,9 @@ describe('platform_browser/mfa/phone', () => {
126130
sessionInfo: 'verification-id'
127131
}
128132
});
129-
expect(session.user?.auth).to.eql(undefined);
133+
if(session.user){
134+
expect(session.user.auth).to.eql(undefined);
135+
}
130136
});
131137
});
132138
});

0 commit comments

Comments
 (0)