-
-
Save mfrancois3k/e89b165aa4502cc149ddd2d4ad912558 to your computer and use it in GitHub Desktop.
Api Token
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