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

Verify email address operation should not log in the user #556

Open
SOHELAHMED7 opened this issue Aug 15, 2023 · 8 comments
Open

Verify email address operation should not log in the user #556

SOHELAHMED7 opened this issue Aug 15, 2023 · 8 comments
Assignees

Comments

@SOHELAHMED7
Copy link
Contributor

Verify email address operation should not log in the user.

Yii::$app->user->login($user) should be removed from

if (($user = $model->verifyEmail()) && Yii::$app->user->login($user)) {

Only email verification should be done. Once it is verified user should manually login at login page

Additional info

Q A
Yii version
PHP version
Operating system
@mtangoo
Copy link

mtangoo commented Aug 15, 2023

But it is a template that someone is supposed to adopt to his own need. One will want auto login and another not wanting it, can remove. Can you explain why is it a problem?

I think adding documentation should be enough as we cannot cater every possible use case

@SOHELAHMED7
Copy link
Contributor Author

There is no problem in existing way. I would say better way is to not automatically log in the user. User can login only if password is provided (login form). Most of the web apps does not automatically log in the user. It just verifies the email address.

@mtangoo
Copy link

mtangoo commented Aug 15, 2023

I will remove it and document it for those who want to login automatically. What do you think @yiisoft/core-developers

@mtangoo
Copy link

mtangoo commented Aug 15, 2023

@bizley @rhertogh

@mtangoo mtangoo self-assigned this Aug 15, 2023
@machour
Copy link
Member

machour commented Aug 15, 2023

I think this really boils down to a personal preference. I'd leave the template as it is and as it have been functioning for years.

@mtangoo
Copy link

mtangoo commented Aug 15, 2023

I think this really boils down to a personal preference. I'd leave the template as it is

In this case we should put a note to the documentation on the default behavior of the verify so that one cannot be surprised by the current behaviour (Especially new comers).

What do you think of that?

@bizley
Copy link
Member

bizley commented Aug 15, 2023

I would remove the login() step it. It will not affect existing apps and new projects will be safer after the change.

@mtangoo
Copy link

mtangoo commented Aug 15, 2023

Let us continue discussion if any on #557

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

4 participants