Last active
December 22, 2022 21:37
-
-
Save ancyrweb/18ca1719847b05a6e6f5e53b31f3d60b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async generateIDToken(uid: string) { | |
const customToken = await this.admin.auth().createCustomToken(uid); | |
const res = await rp({ | |
url: `https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=${this.apikey}`, | |
method: 'POST', | |
body: { | |
token: customToken, | |
returnSecureToken: true, | |
}, | |
json: true, | |
}); | |
return { | |
token: res.idToken, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment