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

Redirect to specified page after login #55

Closed
dvdkrgr opened this issue Jun 2, 2015 · 1 comment
Closed

Redirect to specified page after login #55

dvdkrgr opened this issue Jun 2, 2015 · 1 comment

Comments

@dvdkrgr
Copy link
Contributor

dvdkrgr commented Jun 2, 2015

Hey, how can I use the on afterLogin method to redirect to a page of my choose?

Like that:

  'on afterLogin' => function($event) {
    \webvimark\modules\UserManagement\models\UserVisitLog::newVisitor($event->identity->id);

    CODE HERE TO REDIRECT TO admin/index FOR EXAMPLE

  }

Can't figure it out.

Thanks for any help!

@webvimark
Copy link
Owner

Sorry for the late reply, I doubt that you still need this, but here it is :)

'on afterLogin' => function($event) {
                \webvimark\modules\UserManagement\models\UserVisitLog::newVisitor($event->identity->id);

                header('Location: '.Url::to(['/admin/index', true]));
                die();
            }

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