File tree Expand file tree Collapse file tree 5 files changed +101
-0
lines changed
config/packages/artdarek/oauth-4-laravel Expand file tree Collapse file tree 5 files changed +101
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ return array (
4
+ 'consumers ' => array (
5
+ 'GitHub ' => array (
6
+ 'client_id ' => 'c531b64426ca6f3990a5 ' ,
7
+ 'client_secret ' => 'af86f65d5dee67b6c32f0e17ceed7c4f148eb83e ' ,
8
+ 'scope ' => array ('user:email ' ),
9
+ ),
10
+ ),
11
+ );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate \Database \Migrations \Migration ;
4
+
5
+ class OauthLogin extends Migration {
6
+
7
+ /**
8
+ * Run the migrations.
9
+ *
10
+ * @return void
11
+ */
12
+ public function up ()
13
+ {
14
+ Schema::create ('users_social_github ' , function ($ table ) {
15
+ $ table ->increments ('id ' );
16
+ $ table ->integer ('user_id ' )->unsigned ();
17
+ $ table ->string ('access_token ' , 255 );
18
+ $ table ->string ('refresh_token ' , 255 )->nullable ();
19
+ $ table ->timestamp ('end_of_life ' )->nullable ();
20
+
21
+ $ table ->timestamps ();
22
+
23
+ $ table ->foreign ('user_id ' )->references ('id ' )->on ('users ' );
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Reverse the migrations.
29
+ *
30
+ * @return void
31
+ */
32
+ public function down ()
33
+ {
34
+ Schema::dropIfExists ('users_social_github ' );
35
+ }
36
+
37
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ class UserGitHub extends Eloquent
4
+ {
5
+ /**
6
+ * The database table used by the model.
7
+ *
8
+ * @var string
9
+ */
10
+ protected $ table = 'users_social_github ' ;
11
+
12
+ protected $ fillable = array (
13
+ 'user_id ' ,
14
+ 'access_token ' ,
15
+ 'refresh_token ' ,
16
+ 'end_of_life ' ,
17
+ );
18
+ }
Original file line number Diff line number Diff line change
1
+ @extends (' layouts.master' )
2
+
3
+ @section (' title' )
4
+ {{ trans (' user.social.title' ) } }
5
+ @stop
6
+
7
+ @section (' content' )
8
+ <h2 >{{ trans (' user.social.headline' ) } } </h2 >
9
+
10
+ <p >
11
+ {{ trans (' user.social.description' ) } }
12
+ </p >
13
+
14
+ {{ Form:: open () } }
15
+ {{ Form:: hidden (' access_token' , $token -> getAccessToken ()) } }
16
+ {{ Form:: hidden (' refresh_token' , $token -> getRefreshToken ()) } }
17
+ {{ Form:: hidden (' end_of_life_token' , $token -> getEndOfLife ()) } }
18
+
19
+ <div class =" form-group" >
20
+ <?php $i = 0 ; ? >
21
+ @foreach ($emails as $email )
22
+ <div class =" radio" >
23
+ <label >
24
+ <input type =" radio" name =" email" id =" email-{{ $i } }" value =" {{{ $email } }}" <?php if ($i == 0 ): ? > checked =" checked" <?php endif ; ? > > {{{ $email } }}
25
+ </label >
26
+ </div >
27
+ <?php $i ++ ; ? >
28
+ @endforeach
29
+ </div >
30
+
31
+ <div class =" form-group" >
32
+ <button type =" submit" class =" btn btn-primary" name =" register" >{{ trans (' user.social.submit' ) } } </button >
33
+ </div >
34
+ {{ Form:: close () } }
35
+ @stop
You can’t perform that action at this time.
0 commit comments