Skip to content
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

The user name does't appear after first login #31

Closed
geniux300 opened this issue Jan 18, 2019 · 4 comments
Closed

The user name does't appear after first login #31

geniux300 opened this issue Jan 18, 2019 · 4 comments

Comments

@geniux300
Copy link

Hi everyone,
First thing first, I want to say that this is a fantastic project which has been really helpful.
I have found a problem related to the login. As you are able to see in the followings picture 1, (I am using the published web for exposing the problem), after login with a new account by first time, the website does not show the name of the user in the top right corner.

image
Figure 1

That problem is fixed pressing F5 button (Figure 2), but is pretty cumbersome. So I want to know if there is some way to solve that problem. Everything works well, but this bug spoil the user’s experience.

image
Figure 2
Thanks a lot
Regards

@geniux300
Copy link
Author

Does anyone know how to solve that problem in the code?
I'd appreciate it any help

@jacekk
Copy link
Contributor

jacekk commented Jan 24, 2019

@geniux300 This little change should do the trick :)

diff --git a/resources/assets/js/modules/auth/service.js b/resources/assets/js/modules/auth/service.js
index 110ecc3..de4110b 100644
--- a/resources/assets/js/modules/auth/service.js
+++ b/resources/assets/js/modules/auth/service.js
@@ -33,6 +33,7 @@ export function login(credentials) {
         .then(res => {
           const data = Transformer.fetch(res.data)
           dispatch(authActions.authLogin(data.accessToken))
+          dispatch(fetchUser())
           return resolve()
         })
         .catch((err) => {

@moeen-basra
Copy link
Owner

@geniux300 follow the guide provided by @jacekk. I'm currently busy with a new release.

@geniux300
Copy link
Author

Thanks a lot. It works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants