我正在构建一个基于NuxtJS的前端应用程序,使用Strapi作为后端。我已经在Strapi上配置了google provider。然而,一旦连接到前台,我就遇到了一个问题。基本上,登录后,它会将我重定向到带有令牌的前端URL,而不是直接指向主页。
下面是我的nuxt-config代码:
auth: {
strategies:{
google: {
clientId: 'google_client_id',
codeChallengeMethod:'',
endpoints: {
authorization: 'https://strapi.backend.com/connect/google',
token: 'https://strapi.backend.com/token',
userInfo: 'https://strapi.backend.com/users/me'
},
token: {
property: 'id_token',
type: 'jwt',
maxAge: 1800
},
responseType: 'token',
grantType: 'authorization_code',
}
}
}Login.vue代码
export default {
methods: {
async google(){
await this.$auth.loginWith('google')
}
}如果我遗漏了什么请告诉我。
发布于 2021-07-20 08:01:31
你有没有试过使用redirect密钥?
auth: {
redirect: {
home: '/',
},
...
}https://stackoverflow.com/questions/68445904
复制相似问题