Skip to content
This repository was archived by the owner on Apr 2, 2018. It is now read-only.
This repository was archived by the owner on Apr 2, 2018. It is now read-only.

LocalStorage use for Auth system #30

Open

Description

@cfjedimaster

The default behavior for logging in via Auth is to store "email" and "password" in LocalStorage. Ionic should really go out of their way to avoid using keys that an end user may use in their own application. As it stands, this is really two issues:

a) You document that you persist logins, but you do not how - and that is bad.
b) WHen you do make use of LocalStorage, you should be consistent. I see a key called "ionic_insights_session". But my user details are in "email" and "password". Why not "ionic_email" and "ionic_password"?

Activity

  1. imhoffd commented on Nov 6, 2016

    @imhoffd
    Contributor

    We are definitely not storing passwords in LocalStorage. Passwords shouldn't be stored anywhere except in their owner's brains.

    We do store a JWT token in LocalStorage after authenticating the user, as seen here. We store the token in a namespaced key with the app ID.

    These are the keys I see in my app:

    image

    As for documenting how auth works, I totally agree! I've added a task in our issue tracker to document more how our auth system actually works.

  2. cfjedimaster commented on Nov 6, 2016

    @cfjedimaster
    Author

    You are absolutely right. I forgot I had stored it myself and then removed the code that did it. While I still think it needs documenting (and y'all will so that's good!) I apologize for the misfire here!

  3. imhoffd commented on Nov 10, 2016

    @imhoffd
    Contributor

    @cfjedimaster Speaking of LocalStorage for auth, do you see any issues with continuing to use LocalStorage (as opposed to https://github.com/driftyco/ionic-storage)? Just curious on your thoughts.

  4. cfjedimaster commented on Nov 10, 2016

    @cfjedimaster
    Author

    I think it depends. With iOS killing off LS randomly, Ionic Storage may be a bit safer.

    My #1 issue though is documenting and having a clear "line in the sand" for Ionic junk. That way a developer never accidentally intrudes on your stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions