vue.js - Nuxt.js/auth-next,如何接收google用户信息和用户ID?
问题描述
我正在尝试将 Nuxt.js 集成Nuxt/auth-next
到我的应用程序中,我试图仅从 Google 接收用户 ID 并将此用户 ID 发送到我的后端服务器,在重定向期间,我无法在回调中接收用户信息,我做错了吗?
auth: {
redirect: {
login: '/',
logout: '/',
home: '/'
},
strategies: {
local: {
token: {
property: 'user.token',
},
user: {
property: false
},
endpoints: {
login: { url: 'api/login', method: 'post'},
logout: { url: 'logout', method: 'post' },
user: { url: 'api/user', method: 'get' }
},
},
google: {
clientId: 'googleClientId',
redirectUri: `http://localhost:3000/`,
codeChallengeMethod: "",
responseType:"code",
scope: ['profile', 'email'],
},
},
cookie: {
prefix: 'auth.',
}
},
testLoginWith(){
this.$auth.loginWith('google', { params: { prompt: "select_account"} }).then( result => console.log(result) )}
解决方案
推荐阅读
- html - 在默认视频海报上使用播放按钮(“点击我”)不起作用
- c# - 我的 c# 代码无法导入 p12 证书并进行身份验证并显示错误无效凭据
- android - Oppo Firebase 在后台通知
- java - 如何使用 Java 8 流过滤列表并从值数组开始
- node.js - MongoDB 中的某种连接聚合查询
- hyperledger-fabric - 拜占庭容错 (BFT) 和崩溃容错 (CFT)
- botframework - 英雄卡中长文本的工具提示
- ios - ios中的UIUserInterfaceIdiomPad
- read-the-docs - 构建失败 Sphinx 错误 contents.rst 未找到
- javascript - 如何删除 RecordRTC 中的空白帧