-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loginWith promise result is undefined #144
loginWith promise result is undefined #144
Comments
The login function does not return any data because it directly sets the data to |
+1
How about adding a setting that specifies a user data property like the |
+1 I would also like to get the result from the login call to check if there has been an error (graphql always returns 200 and an error field, so for now is not possible to know what has happened) |
I also encountered this issue. To solve this, I just write a workaround in the plugins/api.js as below: const apiFactory = axios => ({
async getTestData () {
...
}
})
export default ({ $axios, store }, inject) => {
$axios.interceptors.response.use(
response => {
if (response.status === 200 && response.request.responseURL.indexOf('/Login') !== -1) {
store.dispatch('setUser', response.data.user)
}
return response
}
)
const api = apiFactory($axios)
inject('api', api)
} |
I get undefined response too. what do I do to retrieve my response token |
Is there any update on this feature? |
The feature works perfectly. . Set your propertyName from the auth setting in nuxt config. Make sure index.js created in store. But do not expect any response from the promise in component |
@rikoz Please provide an example curios as to how you got it to work. Thanks |
Would really like a update on this feature.. I don't want to make another API call as my
|
Hi there, I'm facing a similar issue too. |
My /login response was similar to this
Still my
But the token is set correctly in cookies/local storage. Can also be accessed using |
Seems like it's quite a common thing that the |
After user logged in successfully, can try this: "this.$auth.state" to get the login details |
Has anybody got a workaround or example on how to fix this issue? |
How can I update my auth-module to reflect the fix for this? |
@Timibadass Add autoFetchUser: false to your strategy object in nuxt.config.js, e.g:
Then after getting a successful login response, set the user manually:
|
Version
v4.1.0
Reproduction link
https://nuxt-auth.herokuapp.com/
Steps to reproduce
The following code logs undefined:
What is expected?
Getting the full response
What is actually happening?
Response is undefined
The text was updated successfully, but these errors were encountered: