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

currentUserData is not updated after registerAccount() #494

Open
3 of 17 tasks
hossameldeen opened this issue Feb 26, 2019 · 2 comments
Open
3 of 17 tasks

currentUserData is not updated after registerAccount() #494

hossameldeen opened this issue Feb 26, 2019 · 2 comments

Comments

@hossameldeen
Copy link

I'm submitting a...

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Performance issue
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

Current behavior

After a successful registerAccount() happens, currentUserData remains undefined.

Expected behavior

For currentUserData to have the same values it'd have after calling signIn().

I quickly checked the network & it seems like user data is indeed returned from the server on registerAccount() request.

What is the motivation / use case for changing the behavior?

Components other than the registration don't have access to user data. So, it'd be useful for them to have access for it without the registration component making an extra signIn() request.

Environment

Angular-Token version: 7.0.1
Angular version: 7.2.5

Bundler

  • Angular CLI (Webpack)
  • Webpack
  • SystemJS

Browser:

  • Chrome (desktop) version 69
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX
@neroniaky
Copy link
Owner

Could you give 7.1.0-rc.0 a try? There we've completely rewritten the way currentUserData is updated. Thanks!

@hossameldeen
Copy link
Author

hossameldeen commented Mar 4, 2019

Great to hear! Thank you for your work!

Tried it out but still the same problem. The smallest reproduction would probably be something like that:

    this.tokenService.registerAccount({
      login: "[email protected]",
      password: "123456",
      passwordConfirmation: "123456"
    }).subscribe(() => console.log(this.tokenService.currentAuthData, this.tokenService.currentUserData));

You'll find that currentAuthData is logged properly but currentUserData is null.

If you have time to try it out, does the issue reproduce at your side? Thanks!

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

2 participants