Closed demonmind closed 8 years ago
Here's an example :
Cas::logout(['service' => url('/')]);
I get this error
phpCAS error: phpCAS::logoutWithRedirectService(): type mismatched for parameter $service (should be `string')
This worked Cas::logout(url('/'));
Thanks
:+1:
@XavRsl is there a way i can create user if the user is not found in the local app, but it is found in the cas-server?
I am referring to something like this:
https://github.com/Fnatte/laravel-cas/blob/master/src/Teuz/LaravelCas/Cas.php#L159
I put this in a Middleware like that :
public function handle($request, Closure $next)
{
Cas::authenticate();
if (!Auth::check()) {
Auth::login(
CasUser::register(Cas::user())
);
}
return $next($request);
}
And my CasUser class looks like :
class CasUser
{
public static function register($login)
{
if ($user = User::where('login', $login)->first())
{
return $user;
}
return User::create([
'login' => $login,
'name' => Ldap::people($login)->displayname,
'email' => Ldap::people($login)->mail
]);
}
}
I call Cas::logout() and the users logs out but the url of the SSO server does not have the service parameter with it. How do i add the service url to logout so the url becomes the same as when i login?