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

feat(core): add loggedIn class #556

Closed
wants to merge 8 commits into from
Closed

feat(core): add loggedIn class #556

wants to merge 8 commits into from

Conversation

JoaoPedroAS51
Copy link
Collaborator

@JoaoPedroAS51 JoaoPedroAS51 commented Mar 16, 2020

The goal is to avoid the fetch user request when the user is not logged.

I improved the logged in state adding its own class with get, set and sync methods. This way loggedIn is no longer based on user object. Solving issues related to cookie based overflow.

LoggedIn class can be accessed using $auth.loggedIn:
$auth.loggedIn.get(), $auth.loggedIn.set() and $auth.loggedIn.sync()

I renamed the old method loggedIn to check to avoid conflict. So we can use $auth.check to check if user is logged in or not.

This closes #550 and closes #321

@JoaoPedroAS51 JoaoPedroAS51 requested a review from pi0 March 16, 2020 22:57
@codecov
Copy link

codecov bot commented Mar 16, 2020

Codecov Report

Merging #556 into dev will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               dev      #556   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b68de9f...54ac247. Read the comment docs.

# Conflicts:
#	lib/schemes/local.js
#	lib/schemes/refresh.js
@JoaoPedroAS51
Copy link
Collaborator Author

JoaoPedroAS51 commented Apr 18, 2020

Closing here in favor of #620

@JoaoPedroAS51 JoaoPedroAS51 deleted the feat/loggedIn branch April 18, 2020 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

401 error when using cookies and not token loggedIn is always true under all circumstances
2 participants