Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Authenticator names are being mangled by minification #92

@aaroncox

Description

@aaroncox

When using the ual-reactjs-renderer within an application that uses a minification build process, the names of the authenticators are getting mangled and corrupting the local storage value for UALLoggedInAuthType. The value saved in local storage ends up being the minified value (like n) and causes session persistence to break.

This is happening because it's currently using the constructor value which seems to be a valid target for mangling:

window.localStorage.setItem('UALLoggedInAuthType', authenticator.constructor.name)

I discovered this bug while debugging why session persistence wasn't functioning within eoscostarica/eos-rate. This is a react-scripts application, which has built-in minification and mangling. If you log in using any authenticator on eosrate.io, you'll see the local storage value of UALLoggedInAuthType being set improperly and the session won't persist.

Perhaps authenticators need to implement a string value of their name which can be used, as opposed to using the constructor's name? I don't know the appropriate solution, but figured I'd raise the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions