Skip to content

Commit 6e0643f

Browse files
authored
waas: return email in SignInResponse (#535)
1 parent 4d820d7 commit 6e0643f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/waas/src/auth.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ export type Identity = {
5757
idToken: string
5858
}
5959

60+
export type SignInResponse = {
61+
sessionId: string,
62+
wallet: string,
63+
email?: string,
64+
}
65+
6066
function encodeHex(data: string | Uint8Array) {
6167
return (
6268
'0x' +
@@ -215,7 +221,7 @@ export class SequenceWaaS {
215221
return this.waas.isSignedIn()
216222
}
217223

218-
async signIn(creds: Identity, name: string): Promise<{ sessionId: string; wallet: string }> {
224+
async signIn(creds: Identity, name: string): Promise<SignInResponse> {
219225
// TODO: Be smarter about this, for cognito (or some other cases) we may
220226
// want to send the email instead of the idToken
221227
const signInIntent = await this.waas.signIn({
@@ -244,7 +250,8 @@ export class SequenceWaaS {
244250

245251
return {
246252
sessionId: res.session.id,
247-
wallet: res.response.data.wallet
253+
wallet: res.response.data.wallet,
254+
email: res.session.identity.email,
248255
}
249256
} catch (e) {
250257
await this.waas.completeSignOut()

0 commit comments

Comments
 (0)