-
Notifications
You must be signed in to change notification settings - Fork 142
Add User State in Authenticators\Session #132
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
Add User State in Authenticators\Session #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. I had a couple of notes, and it also needs information about the pending state added to the docs.
return $this->user instanceof User; | ||
$identities = $this->userIdentityModel->getIdentitiesByTypes( | ||
$this->user->getAuthId(), | ||
['email_2fa', 'email_activate'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to get the list of actions assigned in the config file here, otherwise if some wants to do, says, 2FA with SMS messages, this logic would be skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the hard coded action types.
c2a6bb9
to
9c81dba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too big for me to review on mobile. It looks like Lonnie has been here so just let me know if I need to do anything on desktop later.
I believe this PR can now be merged. One more refactoring would make the code more readable. |
…e() in Authenticators\Session
The user id stored in session is not only of logged-in, but also of pending login.
…dential check passes
The pending login state is determined by whether or not the identitiy is stored in the DB. It is not sufficient to save the auth_action in the session after registration. If the redirect to the action page is aborted, Email Activation can be avoided.
91ecb64
to
44f1deb
Compare
$userState
inSession
Session::loggedIn()
does not returntrue
for pending login user.Session::getUser()
does not return pending login user, soauth()->user()
also does not return.Session::getPendingUser()
Session::isPending()
that returnstrue
when a user is in pending login state.Session::isAnonymous()
ActionInterface::getType()