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

[question] improve usability/ux - redirect requestPasswordReset_action/setNewPassword #840

Open
elbenjaz opened this issue Jan 6, 2017 · 1 comment

Comments

@elbenjaz
Copy link

elbenjaz commented Jan 6, 2017

Hello guys,

About improve the usability/UX.
If a user fails in LoginController (::requestPasswordReset(), ::setNewPassword()),
He will be redirected to login and will have to "go back" using the browser to try again.

What do you think of changing the redirection depending on the method return?

Current source code (application/controller/LoginController.php):

    public function requestPasswordReset_action()
    {
        PasswordResetModel::requestPasswordReset(Request::post('user_name_or_email'), Request::post('captcha'));
        Redirect::to('login/index');
    }

    public function setNewPassword()
    {
        PasswordResetModel::setNewPassword(
            Request::post('user_name'), Request::post('user_password_reset_hash'),
            Request::post('user_password_new'), Request::post('user_password_repeat')
        );
        Redirect::to('login/index');
    }


Change:

    public function requestPasswordReset_action()
    {
        if (PasswordResetModel::requestPasswordReset(Request::post('user_name_or_email'), Request::post('captcha'))) {
            Redirect::to('login/index');
        } else {
            Redirect::to('login/requestPasswordReset');
        } 
    }

    public function setNewPassword()
    {
        if (PasswordResetModel::setNewPassword(
            Request::post('user_name'), Request::post('user_password_reset_hash'),
            Request::post('user_password_new'), Request::post('user_password_repeat')
        )) {
            Redirect::to('login/index');
        } else {
            Redirect::toPreviousPage();
        }
    }}
@sr-verde
Copy link
Contributor

I'll go with #820 and so I would not agree with your changes on requestPasswordReset_action(). However I would agree with the changes on setNewPassword().

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

2 participants