Open KarlGNassar opened 2 years ago
Please check here https://akveo.github.io/nebular/docs/auth/nbauthservice#nbauthservice
refreshToken() | parameters: strategyName: string, data: anyreturns:Observable<NbAuthResult>Sends a refresh token request Stores received token in the token storageExample: refreshToken('email', {token: token})
I am struggling with implementing basic authentication so can't help.
Please check here https://akveo.github.io/nebular/docs/auth/nbauthservice#nbauthservice
refreshToken() | parameters: strategyName: string, data: anyreturns:Observable<NbAuthResult>Sends a refresh token request Stores received token in the token storageExample: refreshToken('email', {token: token})
I am struggling with implementing basic authentication so can't help.
this.authService.authenticate("google")
.pipe(takeUntil(this.destroy$))
.subscribe((authResult: NbAuthResult) => {
this.authService.refreshToken('google', {token: authResult.getToken() as NbAuthOAuth2Token}).subscribe(
...
This returns TypeError: token.getRefreshToken is not a function
Am I doing something wrong!?
@KarlGNassar If you can upload your code somewhere I can try to see how I can help
@KarlGNassar If you can upload your code somewhere I can try to see how I can help
The code in the issue above is all the code needed to make the auth work, but the refresh token is the only thing that is not working. Do you have any sample code that uses Google OAuth2 and refresh tokens? Would really appreciate it
I don't have it that's why I want to debug.. You don't need to upload whole code just working code so I can debug. Don't have time to implement everything from scratch.
It seems like refresh token IS implemented in Nebular.
https://github.com/akveo/nebular/blob/master/src/framework/auth/strategies/oauth2/oauth2-strategy.ts
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior: Returning
accessToken
and storing it inlocalStorage
Expected behavior: Return both
accessToken
andrefreshToken
so thattoken.getRefreshToken()
doesn't return nullI did not see a single piece of code in the repo that includes refresh token with google-oauth2 login. Is that not a feature yet?
Related code: