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

Authorized user #113

Open
Eke opened this issue Apr 28, 2016 · 1 comment
Open

Authorized user #113

Eke opened this issue Apr 28, 2016 · 1 comment

Comments

@Eke
Copy link

Eke commented Apr 28, 2016

Hello.

What is best practice to have information about logged-in user in each ViewController ?

Do i have to call findCurrentUserWithSuccess each time or is there something like shared instance of logged-in user? Or must i implement my own disk cache logic?

@hideya can you help me?

@skylinezy
Copy link

From my knowledge (please correct me if I'm wrong), there is a exposed property on LBUserRepository called cachedCurrentUser, which is an instance of LBUser, and another exposed property called currentUserId, which is just a string. I used currentUserId in my app so I assume the cachedCurrentUser is doing what its name is implying. For me I only need to know the logged-in user ID in my view controllers so I have a singleton class which holds a LBUserRepository instance and all of my view controllers have knowledge of this singleton class.

I do not think you need a disk cache logic since I assume user is supposed to log-in in every session?

Hope this helps

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

3 participants