Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth-provider): firebase auth provider #90

Closed

Conversation

MolochkoVitaly
Copy link

No description provided.

@lolsborn
Copy link

I'm trying to use this code as I would like to use Firebase with nebular, but I keep getting firebase.auth() is not a function any ideas?

@tanwarsatya
Copy link

@lolsborn were you able to resolve this.

@lolsborn
Copy link

lolsborn commented Jan 29, 2018 via email

@Kshitij-Banerjee
Copy link

Kshitij-Banerjee commented Mar 4, 2018

The code does works. I just copied parts of it into my project and it worked with minor mods (y) thanks!

*/
register(data?: any): Observable<NbAuthResult> {
return Observable.fromPromise(firebase.auth().createUserWithEmailAndPassword(data.email, data.password))
.map((res) => {
Copy link

@Kshitij-Banerjee Kshitij-Banerjee Mar 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be flatMap?
otherwise the result is

Observable<NbAuthResult| Obsevable>

}

private processSuccess(response?: any, redirect?: any, messages?: any): NbAuthResult {
return new NbAuthResult(true, response, redirect, [], messages);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add the last parameter rawToken, otherwise tokenService ignores this payload and does not store it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infact, since this doesn't return a JWT. we need to store JSON.stringify(response) as the rawToken

@nnixaa
Copy link
Collaborator

nnixaa commented Mar 29, 2018

Hey @Kshitij-Banerjee, thanks for the review, we will be reviewing the changes soon.

@Kshitij-Banerjee
Copy link

@nnixaa Thanks !
Also, please do check the token storage mechanisms (coz I was getting issues with it). After some fixes it works, but i still have to manually call tokenService.clear() on logout() for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants