Created
May 9, 2022 02:28
-
-
Save antonkrasov/65681e6bb904368b79f74a250aebfc0f to your computer and use it in GitHub Desktop.
This file contains 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
const firebaseApiKey = pm.environment.get("firebaseApiKey") | |
const firebaseTestUserEmail = pm.environment.get("firebaseTestUserEmail") | |
const firebaseTestUserPassword = pm.environment.get("firebaseTestUserPassword") | |
const options = { | |
url: `https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=${firebaseApiKey}`, | |
method: 'POST', | |
header: { | |
'Accept': '*/*', | |
'Content-Type': 'application/json', | |
}, | |
body: { | |
mode: 'raw', | |
raw: JSON.stringify({ | |
"email": firebaseTestUserEmail, | |
"password": firebaseTestUserPassword, | |
"returnSecureToken": true | |
}) | |
} | |
}; | |
pm.sendRequest(options, function (err, res) { | |
const respData = res.json(); | |
pm.environment.set("firebaseIdToken", respData.idToken); | |
pm.environment.set("firebaseUID", respData.localId); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment