我有一个使用 laravel 护照作为身份验证手段的移动应用程序(这里没问题)。在移动应用程序中,我添加了一个按钮,理论上将我重定向到我的网络应用程序(与移动设备相同的身份验证端点)并自动登录。如何使用 nuxtjs(已使用 nuxt 身份验证)实现这一点?找不到仅使用 nuxt auth 中的令牌登录或破解它的方法。
如果您有任何建议或建议,请随时添加。
我想象这样的事情,但没有运气。
this.$auth.loginWith('local', {
data: {
token: token <--------------------------- token from url (originated in mobile app)
}
})
.then(response => {
// successful login
})
.catch(error => {
// failed login
});
这是我想在 nuxtjs 中自动登录的示例 url
http://example.com/redirect?token=tokenvaluehere