Refresh Token with Google Oauth2 Strategy
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
### Issue type
**I'm submitting a ...** (check one with "x")
* [x] bug report
* [ ] feature request
* [ ] question about the decisions made in the repository
### Issue description
**Current behavior:**
Returning `accessToken` and storing it in `localStorage`
**Expected behavior:**
Return both `accessToken` and `refreshToken` so that `token.getRefreshToken()` doesn't return null
**I 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:**
```
NbOAuth2AuthStrategy.setup({
name: "google",
clientId: environment.googleClientId,
clientSecret: environment.googleClientSecret,
authorize: {
endpoint: "https://accounts.google.com/o/oauth2/v2/auth",
responseType: NbOAuth2ResponseType.TOKEN,
scope: "profile email",
redirectUri: environment.googleRedirectUri,
},
redirect: {
success: "/",
},
token: {
endpoint: "token",
grantType: NbOAuth2GrantType.AUTHORIZATION_CODE,
class: NbAuthOAuth2Token,
requireValidToken: true,
},
refresh: {
endpoint: "token",
grantType: NbOAuth2GrantType.REFRESH_TOKEN,
},
}),
],
})
```
Contributor guide
Assessment
This issue has not been assessed yet.