Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

AngularFire2 Authentification #43

Open
JaneDawson opened this issue Jun 12, 2017 · 4 comments
Open

AngularFire2 Authentification #43

JaneDawson opened this issue Jun 12, 2017 · 4 comments

Comments

@JaneDawson
Copy link

Thank you for this fantastic module!

How would you deal with the authentification to get the current user Id? Would you somehow have to add offline support for it, as well? Up to now I used AngularFireAuth ( import { AngularFireAuth } from 'angularfire2/auth'; ).

Thanks and best regards

@adriancarriger
Copy link
Owner

I'm not sure how you would access the current user id without it being stored on the device. I'll have to look into this more, but I can see how it would be useful. Anyone with ideas for this feature is welcome to leave feedback. Thanks!

@larssn
Copy link

larssn commented Jul 3, 2017

In my humble opinion and before this grows into a monster of a module, I suggest that storing authentication info is up to the consumer. The scope of this module should simply be offline data.

The more features you add, the more features there is to maintain.

edit
Re-reading this, it sounds like I was telling. Sorry! Mean to only suggest it. 😄

@mparpaillon
Copy link

That would be great, yes.

I guess we should have some kind of AfoAuth service.
We would use it like

import { AngularFireOfflineAuth } from 'angularfire2-offline/auth';

@Injectable()
export class someService {
  constructor(private afoAuth: AngularFireOfflineAuth) {
    afoAuth.authState.subscribe(user => {
      console.log(user);
    });
  }
}

And I'm not too sure about how it would work behind the scene, but I guess in the same way as database, by storing locally the latest fetched datas and then use those datas as default before trying to fetch remote datas ?

@ric-cardo
Copy link

firebase already stores the auth user in localstorage

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

No branches or pull requests

5 participants