Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add default event `oneauth.logged` to login the user

  • Loading branch information...
commit 076cfab28c99be97ee845202c83b09df2a3116aa 1 parent aa32783
@crynobone crynobone authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 start.php
View
9 start.php
@@ -8,7 +8,14 @@
Event::listen('oneauth.logged', function ($client, $user_data)
{
- // do something when client logged in.
+ // if user already logged in, don't do anything
+ if (\Auth::check()) return ;
+
+ // OneAuth should login the user if user exist and is not logged in
+ if (is_numeric($client->user_id) and $client->user_id > 0)
+ {
+ \Auth::login($client->user_id);
+ }
});
Event::listen('oneauth.sync', function ($user_id)
Please sign in to comment.
Something went wrong with that request. Please try again.