I'm submitting a ... (check one with "x")
I鈥檓 trying to make use of the out of the box Nebular Auth components specifically with Firebase REST-based Auth. Login and register work fine for the most part but I need to make a few changes to get the other functions working correctly. I鈥檓 looking for help/examples on how to do the following:
Any examples or direction would be appreciated.
Current behavior:
Expected behavior:
Steps to reproduce:
Related code:
insert short code snippets here
npm, node, OS, Browser
Node 10.x, Linux/Mac OSX, Chrome
Angular, Nebular
Angular 8
Nebular 4.0
Hi @henry74,
Also, if you are able to open a PR with the new firebase strategy, that would be a great addition to Nebular.
For #1 see here: The payload requires a requestType: "PASSWORD_RESET"; I think ideally all the built-in functions should allow some level of payload shaping to support different REST endpoints.
curl 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/getOobConfirmationCode?key=[API_KEY]' \
-H 'Content-Type: application/json' \
--data-binary '{"requestType":"PASSWORD_RESET","email":"[[email protected]]"}'
Here's the response error I get from using the Nebular default requestPassword implementation:
{
"error": {
"code": 400,
"message": "MISSING_REQ_TYPE",
"errors": [
{
"message": "MISSING_REQ_TYPE",
"domain": "global",
"reason": "invalid"
}
]
}
}
For #2, should I create my own token implementation by extending NbSimpleAuthToken?
Here's an example of the payload returned from login using the Firebase REST API:
{
"kind": "identitytoolkit#VerifyPasswordResponse",
"localId": "ZY1rJK0eYLg...",
"email": "[[email protected]]",
"displayName": "",
"idToken": "[ID_TOKEN]",
"registered": true,
"refreshToken": "[REFRESH_TOKEN]",
"expiresIn": "3600"
}
Perhaps a better design approach for all endpoint configuration is to allow injecting key/value pairs into the request payload and handling of any JSON object for responses.
I found this in an older commit. Looks like there was an NbFirebaseAuthProvider at some point - do you know what happened to it?