/api/auth/
{
"token": "uniq token",
"username": "name",
"email": "email"
}
nuxt.config.js
strategies: {
local: {
endpoints: {
login: { url: 'approval/auth', method: 'post'},
logout: false,
user: false,
},
login.vue
await this.$auth.loginWith('local', { data: this.form })
.then(response => {
this.$nuxt.$router.push('/')
this.$axios.setToken(this.$auth.getToken(this.$auth.strategy.name))
this.$auth.fetchUser();
console.log(this.$auth.strategy)
i Viewed.
https://github.com/nuxt-community/auth-module/issues/144#issuecomment-390166011
This issue as been imported as question since it does not respect auth-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/auth-module/issues/c171.
i want use it like this "this.$auth.user.username'
Hello no answer yet?
Most helpful comment
i want use it like this "this.$auth.user.username'