Auth-module: I want to set user information login with.

Created on 3 Jul 2018  路  3Comments  路  Source: nuxt-community/auth-module

API

/api/auth/

{
 "token": "uniq token",
 "username": "name",
 "email": "email"
}

nuxt

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 question is available on Nuxt community (#c171)
question

Most helpful comment

i want use it like this "this.$auth.user.username'

All 3 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pi0 picture pi0  路  3Comments

ishitatsuyuki picture ishitatsuyuki  路  4Comments

sebmor picture sebmor  路  3Comments

amjadkhan896 picture amjadkhan896  路  3Comments

AhmedAtef07 picture AhmedAtef07  路  3Comments