php - Laravel oauth user redirection after registration -
all. i'm trying implement single sign-on server using laravel , passport app.
what i'm trying achieve: single sign-on server listen request client , provide authentication based on requested parameter.
what i've achieved far: sso server listen client request , provide authentication , redirect client site if user registered on sso server.
the problem coming picture when user not registered on sso server , try register account in case laravel register user , redirect homepage instead client callback url. please let me know if achievable in laravel or special it.
it pretty achievable, depends on how effort want put towards it.
when user registering, can save callback url in session.
session(['callback' => $callback]);
upon registration, redirect user callback url
return redirect()->away(session('callback'));
if still using default auth/registercontroller provided laravel, can change redirect behavior defining custom redirect function
protected function redirectto() { return redirect()->away(session('callback')); }
laravel automatically pick up.
don't forget delete property
protected $redirectto = '/home';
Comments
Post a Comment