akveo / akveo/ngx-admin

Refresh Token with Google Oauth2 Strategy

未关闭
#5,944 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
25.7k
派生
7.9k
PR 合并指标
30 天内没有已合并 PR

描述

### 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,
},
}),
],
})
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。