【发布时间】:2021-08-02 02:57:27
【问题描述】:
我有以下认证策略:
auth: {
strategies: {
local: {
...,
},
google: {
clientId:
"<MY CLIENT ID>",
responseType: "code",
endpoints: {
token: "http://localhost:8000/social-login/google/",
userInfo: "http://localhost:8000/auth/user/",
},
},
},
redirect: {
...
},
},
奇怪的是,这个策略自己完成了所有的身份验证,而不需要访问我的后端! responseTypecode不应该去endpoints.token获取token吗?
我的登录功能如下:
loginWithGoogle() {
this.$auth.loginWith("google", {
params: {
client_id:
"<MY CLIENT ID>",
},
});
},
有趣的是,如果我没有在这里传递参数,Google 会给我一个错误 client_id 丢失。
【问题讨论】: