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

AutoLogin not working with ng build --prod #85

Open
raosaddam opened this issue Apr 1, 2021 · 1 comment
Open

AutoLogin not working with ng build --prod #85

raosaddam opened this issue Apr 1, 2021 · 1 comment

Comments

@raosaddam
Copy link

raosaddam commented Apr 1, 2021

I'm trying to implement Anchor and Wax login with UAL in an angular app. Everything works fine except when I refresh my page UAL is unable to find the logged in user from session. This is happening because 'ual-session-authenticator' is not saved. The value for 'ual-session-authenticator' in localStorage is always null because it is saved by localStorage.setItem(UALJs.SESSION_AUTHENTICATOR_KEY, authenticator.constructor.name);
in UALJs . And on page refresh when it tries to find the session authenticator it couldnt because it also uses
const sessionAuthenticator = authenticators.find((authenticator) => authenticator.constructor.name === authenticatorName);

This only happens with ng serve --prod --sourceMap and ng build --prod. Dev build ng serve works fine. Angular uglify class names for prod builds.
A better way is to use instanceof instead of constructor.name

Angular CLI: 11.0.5
Node: 14.15.0
OS: win32 x64

Angular: 11.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.1100.5
@angular-devkit/build-angular 0.1100.5
@angular-devkit/core 11.0.5
@angular-devkit/schematics 11.0.5
@schematics/angular 11.0.5
@schematics/update 0.1100.5
rxjs 6.6.3
typescript 4.0.3

@abdulmanan7
Copy link

same issue with me i am using ual-plainjs-renderer in vuejs Dapp. if you got any solution please let me know
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