How to get the token returned by a login? #376
-
I'm considering using cypress to test our API layer, which requires the auth token from firebase auth to be on a header. After using
Which I can use in my subsequent Is there an equivalent in cypress-firebase? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
cy.task('createCustomToken', 'SomeUid')
.then((token) => {
// call whatever is needed here
}) Let me know if I'm misunderstanding |
Beta Was this translation helpful? Give feedback.
cy.login
uses a custom task which is added by cypress-firebase calledcreateCustomToken
which returns the token after calling firebase-admin internally - you can call like so:Let me know if I'm misunderstanding