From 2e075799f26cd759065ccd95423f539b668b76a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Wed, 25 Jul 2018 23:07:11 +0200 Subject: [PATCH] implemented social identities management page + pw editing page. probably need to fix backend --- app/Http/Controllers/Auth/LoginController.php | 17 ++ ...erController.php => ProfileController.php} | 19 +- .../Middleware/RedirectIfAuthenticated.php | 2 +- app/Providers/AppServiceProvider.php | 3 +- app/View/WidgetFactory.php | 7 +- ...8_204449_create_oauth_identities_table.php | 4 + public/fonts/fa-dtbl-1-preview.html | 196 ++++++++++-------- public/fonts/fa-dtbl-1.css | 89 ++++---- public/fonts/fa-dtbl-1.eot | Bin 12064 -> 12448 bytes public/fonts/fa-dtbl-1.svg | 99 ++++----- public/fonts/fa-dtbl-1.ttf | Bin 11884 -> 12268 bytes public/fonts/fa-dtbl-1.woff2 | Bin 5864 -> 6032 bytes resources/assets/sass/_fa-utils.scss | 4 + resources/assets/sass/_helpers.scss | 8 + resources/views/auth/login.blade.php | 2 +- resources/views/form/checkbox.blade.php | 2 +- resources/views/layouts/main-nav.blade.php | 36 +--- resources/views/layouts/nav-buttons.blade.php | 27 +++ .../{user => profile}/_table-list.blade.php | 0 resources/views/profile/edit.blade.php | 33 +++ resources/views/profile/logins.blade.php | 140 +++++++++++++ .../views/{user => profile}/view.blade.php | 4 +- resources/views/user/edit.blade.php | 49 ----- resources/views/user/logins.blade.php | 15 -- routes/login.php | 27 ++- routes/web.php | 12 +- .../eloquent-oauth/src/Authenticator.php | 4 + .../eloquent-oauth/src/OAuthIdentity.php | 6 + .../facebook/src/FacebookProvider.php | 5 + .../socialnorm/github/src/GitHubProvider.php | 5 + .../socialnorm/google/src/GoogleProvider.php | 5 + .../socialnorm/src/ProviderUser.php | 3 + .../src/Providers/OAuth2Provider.php | 3 + .../src/StackOverflowProvider.php | 5 + vendor_patches/20_ci_login.patch | 11 + 35 files changed, 541 insertions(+), 301 deletions(-) rename app/Http/Controllers/{UserController.php => ProfileController.php} (79%) create mode 100644 resources/views/layouts/nav-buttons.blade.php rename resources/views/{user => profile}/_table-list.blade.php (100%) create mode 100644 resources/views/profile/edit.blade.php create mode 100644 resources/views/profile/logins.blade.php rename resources/views/{user => profile}/view.blade.php (95%) delete mode 100644 resources/views/user/edit.blade.php delete mode 100644 resources/views/user/logins.blade.php create mode 100644 vendor_patches/20_ci_login.patch diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 191b2b6..958045b 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -4,6 +4,8 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; +use Illuminate\Http\Request; +use Illuminate\Validation\ValidationException; class LoginController extends Controller { @@ -36,4 +38,19 @@ class LoginController extends Controller { $this->middleware('guest')->except('logout'); } + + public function username() + { + $login = request()->input('login'); + $field = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'name'; + request()->merge([$field => $login]); + return $field; + } + + protected function sendFailedLoginResponse(Request $request) + { + throw ValidationException::withMessages([ + 'login' => [trans('auth.failed')], + ]); + } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/ProfileController.php similarity index 79% rename from app/Http/Controllers/UserController.php rename to app/Http/Controllers/ProfileController.php index 8b937e8..fdbd6a1 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/ProfileController.php @@ -10,7 +10,7 @@ use Illuminate\Http\Request; use Illuminate\Validation\Rule; use MightyPork\Utils\Str; -class UserController extends Controller +class ProfileController extends Controller { /** * Show the application dashboard. @@ -23,7 +23,7 @@ class UserController extends Controller ->with('revision:id,row_count') ->paginate(10); - return view('user.view')->with(compact('tables', 'user')); + return view('profile.view')->with(compact('tables', 'user')); } /** @@ -34,7 +34,7 @@ class UserController extends Controller */ public function edit() { - return view('user.edit')->with('user', \user()); + return view('profile.edit')->with('user', \user()); } /** @@ -92,6 +92,17 @@ class UserController extends Controller public function manageOauth() { - return view('user.logins', ['user' => user()]); + return view('profile.logins', ['user' => user()]); + } + + public function forgetSocialLogin($id) + { + $identity = user()->socialIdentities()->where('id', $id)->first(); + if (null === $identity) { + abort(404, "No such identity"); + } + + $identity->delete(); + return redirect(route('profile.manage-oauth')); } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e4cec9c..e27860e 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -18,7 +18,7 @@ class RedirectIfAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { - return redirect('/home'); + return redirect('/'); } return $next($request); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 55bc903..2537cb7 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -20,7 +20,8 @@ class AppServiceProvider extends ServiceProvider } \Route::bind('user', function ($value) { - $u = User::where('name', $value)->first(); + // Hack to have the URL case insensitive (also needed a vendor patch for login) + $u = User::whereRaw('LOWER(name)=LOWER(?)', [$value])->first(); // it may also be the _id directly if (!$u && is_numeric($value)) $u = User::find((int)$value); if (!$u) abort(404); diff --git a/app/View/WidgetFactory.php b/app/View/WidgetFactory.php index c2e8c84..ffa104b 100644 --- a/app/View/WidgetFactory.php +++ b/app/View/WidgetFactory.php @@ -21,10 +21,11 @@ class WidgetFactory ""; } - public function par($text) + public function par($text, $extraClasses='') { - return "
". - "

fieldCols offset-md-$this->labelCols\">".e($text)."". + return + "

". + "

fieldCols offset-md-$this->labelCols mb-2 ".e($extraClasses)."\">".e($text)."". "

"; } diff --git a/database/migrations/2018_07_08_204449_create_oauth_identities_table.php b/database/migrations/2018_07_08_204449_create_oauth_identities_table.php index d84dd69..64f8ad9 100644 --- a/database/migrations/2018_07_08_204449_create_oauth_identities_table.php +++ b/database/migrations/2018_07_08_204449_create_oauth_identities_table.php @@ -20,6 +20,10 @@ class CreateOauthIdentitiesTable extends Migration $table->string('provider_user_id'); $table->string('provider'); $table->string('access_token'); + $table->string('nick_name'); + $table->string('full_name'); + $table->string('avatar', 500); + $table->string('email'); $table->foreign('user_id') ->references('id')->on('users') diff --git a/public/fonts/fa-dtbl-1-preview.html b/public/fonts/fa-dtbl-1-preview.html index 9faf934..93c87d3 100644 --- a/public/fonts/fa-dtbl-1-preview.html +++ b/public/fonts/fa-dtbl-1-preview.html @@ -161,7 +161,8 @@ [data-icon]:before { content: attr(data-icon); } [data-icon]:before, - .fa-at:before, + .fa-address-card-o:before, +.fa-at:before, .fa-bell:before, .fa-bell-o:before, .fa-calendar:before, @@ -219,50 +220,51 @@ font-smoothing: antialiased; } - .fa-at:before { content: "\f100"; } -.fa-bell:before { content: "\f101"; } -.fa-bell-o:before { content: "\f102"; } -.fa-calendar:before { content: "\f103"; } -.fa-check:before { content: "\f104"; } -.fa-clock-o:before { content: "\f105"; } -.fa-cloud-upload:before { content: "\f106"; } -.fa-code-fork:before { content: "\f107"; } -.fa-download:before { content: "\f108"; } -.fa-eye:before { content: "\f109"; } -.fa-eye-slash:before { content: "\f10a"; } -.fa-facebook-square:before { content: "\f10b"; } -.fa-filter:before { content: "\f10c"; } -.fa-flag:before { content: "\f10d"; } -.fa-floppy-o:before { content: "\f10e"; } -.fa-gavel:before { content: "\f10f"; } -.fa-github:before { content: "\f110"; } -.fa-globe:before { content: "\f111"; } -.fa-google:before { content: "\f112"; } -.fa-history:before { content: "\f113"; } -.fa-key-modern:before { content: "\f114"; } -.fa-link:before { content: "\f115"; } -.fa-pencil-square-o:before { content: "\f116"; } -.fa-question-circle:before { content: "\f117"; } -.fa-quote-left:before { content: "\f118"; } -.fa-reply:before { content: "\f119"; } -.fa-rss:before { content: "\f11a"; } -.fa-search:before { content: "\f11b"; } -.fa-share-alt:before { content: "\f11c"; } -.fa-sign-in:before { content: "\f11d"; } -.fa-sign-out:before { content: "\f11e"; } -.fa-sliders:before { content: "\f11f"; } -.fa-sort:before { content: "\f120"; } -.fa-sort-asc:before { content: "\f121"; } -.fa-sort-desc:before { content: "\f122"; } -.fa-star:before { content: "\f123"; } -.fa-star-o:before { content: "\f124"; } -.fa-table:before { content: "\f125"; } -.fa-times:before { content: "\f126"; } -.fa-trash:before { content: "\f127"; } -.fa-trash-o:before { content: "\f128"; } -.fa-user-circle-o:before { content: "\f129"; } -.fa-user-plus:before { content: "\f12a"; } -.fa-wrench:before { content: "\f12b"; } + .fa-address-card-o:before { content: "\f100"; } +.fa-at:before { content: "\f101"; } +.fa-bell:before { content: "\f102"; } +.fa-bell-o:before { content: "\f103"; } +.fa-calendar:before { content: "\f104"; } +.fa-check:before { content: "\f105"; } +.fa-clock-o:before { content: "\f106"; } +.fa-cloud-upload:before { content: "\f107"; } +.fa-code-fork:before { content: "\f108"; } +.fa-download:before { content: "\f109"; } +.fa-eye:before { content: "\f10a"; } +.fa-eye-slash:before { content: "\f10b"; } +.fa-facebook-square:before { content: "\f10c"; } +.fa-filter:before { content: "\f10d"; } +.fa-flag:before { content: "\f10e"; } +.fa-floppy-o:before { content: "\f10f"; } +.fa-gavel:before { content: "\f110"; } +.fa-github:before { content: "\f111"; } +.fa-globe:before { content: "\f112"; } +.fa-google:before { content: "\f113"; } +.fa-history:before { content: "\f114"; } +.fa-key-modern:before { content: "\f115"; } +.fa-link:before { content: "\f116"; } +.fa-pencil-square-o:before { content: "\f117"; } +.fa-question-circle:before { content: "\f118"; } +.fa-quote-left:before { content: "\f119"; } +.fa-reply:before { content: "\f11a"; } +.fa-rss:before { content: "\f11b"; } +.fa-search:before { content: "\f11c"; } +.fa-share-alt:before { content: "\f11d"; } +.fa-sign-in:before { content: "\f11e"; } +.fa-sign-out:before { content: "\f11f"; } +.fa-sliders:before { content: "\f120"; } +.fa-sort:before { content: "\f121"; } +.fa-sort-asc:before { content: "\f122"; } +.fa-sort-desc:before { content: "\f123"; } +.fa-star:before { content: "\f124"; } +.fa-star-o:before { content: "\f125"; } +.fa-table:before { content: "\f126"; } +.fa-times:before { content: "\f127"; } +.fa-trash:before { content: "\f128"; } +.fa-trash-o:before { content: "\f129"; } +.fa-user-circle-o:before { content: "\f12a"; } +.fa-user-plus:before { content: "\f12b"; } +.fa-wrench:before { content: "\f12c"; } @@ -278,11 +280,25 @@
-

fa-dtbl-1 contains 44 glyphs:

+

fa-dtbl-1 contains 45 glyphs:

Toggle Preview Characters
+
+
+ PpPpPpPpPpPpPpPpPpPp +
+
+ 12141618212436486072 +
+
+ + + +
+
+
PpPpPpPpPpPpPpPpPpPp @@ -292,7 +308,7 @@
- +
@@ -305,7 +321,7 @@
- +
@@ -318,7 +334,7 @@
- +
@@ -331,7 +347,7 @@
- +
@@ -344,7 +360,7 @@
- +
@@ -357,7 +373,7 @@
- +
@@ -370,7 +386,7 @@
- +
@@ -383,7 +399,7 @@
- +
@@ -396,7 +412,7 @@
- +
@@ -409,7 +425,7 @@
- +
@@ -422,7 +438,7 @@
- +
@@ -435,7 +451,7 @@
- +
@@ -448,7 +464,7 @@
- +
@@ -461,7 +477,7 @@
- +
@@ -475,7 +491,7 @@
- +
@@ -489,7 +505,7 @@
- +
@@ -502,7 +518,7 @@
- +
@@ -515,7 +531,7 @@
- +
@@ -528,7 +544,7 @@
- +
@@ -541,7 +557,7 @@
- +
@@ -554,7 +570,7 @@
- +
@@ -567,7 +583,7 @@
- +
@@ -581,7 +597,7 @@
- +
@@ -594,7 +610,7 @@
- +
@@ -607,7 +623,7 @@
- +
@@ -620,7 +636,7 @@
- +
@@ -633,7 +649,7 @@
- +
@@ -646,7 +662,7 @@
- +
@@ -659,7 +675,7 @@
- +
@@ -672,7 +688,7 @@
- +
@@ -685,7 +701,7 @@
- +
@@ -698,7 +714,7 @@
- +
@@ -711,7 +727,7 @@
- +
@@ -724,7 +740,7 @@
- +
@@ -737,7 +753,7 @@
- +
@@ -750,7 +766,7 @@
- +
@@ -763,7 +779,7 @@
- +
@@ -776,7 +792,7 @@
- +
@@ -790,7 +806,7 @@
- +
@@ -803,7 +819,7 @@
- +
@@ -816,7 +832,7 @@
- +
@@ -829,7 +845,7 @@
- +
@@ -842,7 +858,7 @@
- +
@@ -855,7 +871,7 @@
- +
diff --git a/public/fonts/fa-dtbl-1.css b/public/fonts/fa-dtbl-1.css index 25c5282..ec428cb 100644 --- a/public/fonts/fa-dtbl-1.css +++ b/public/fonts/fa-dtbl-1.css @@ -38,47 +38,48 @@ font-smoothing: antialiased; } -.fa-at::before { content: "\f100"; } -.fa-bell::before { content: "\f101"; } -.fa-bell-o::before { content: "\f102"; } -.fa-calendar::before { content: "\f103"; } -.fa-check::before { content: "\f104"; } -.fa-clock-o::before { content: "\f105"; } -.fa-cloud-upload::before { content: "\f106"; } -.fa-code-fork::before { content: "\f107"; } -.fa-download::before { content: "\f108"; } -.fa-eye::before { content: "\f109"; } -.fa-eye-slash::before { content: "\f10a"; } -.fa-facebook-square::before { content: "\f10b"; } -.fa-filter::before { content: "\f10c"; } -.fa-flag::before { content: "\f10d"; } -.fa-floppy-o::before, .fa-save::before { content: "\f10e"; } -.fa-gavel::before, .fa-legal::before { content: "\f10f"; } -.fa-github::before { content: "\f110"; } -.fa-globe::before { content: "\f111"; } -.fa-google::before { content: "\f112"; } -.fa-history::before { content: "\f113"; } -.fa-key-modern::before { content: "\f114"; } -.fa-link::before { content: "\f115"; } -.fa-pencil-square-o::before, .fa-edit::before { content: "\f116"; } -.fa-question-circle::before { content: "\f117"; } -.fa-quote-left::before { content: "\f118"; } -.fa-reply::before { content: "\f119"; } -.fa-rss::before { content: "\f11a"; } -.fa-search::before { content: "\f11b"; } -.fa-share-alt::before { content: "\f11c"; } -.fa-sign-in::before { content: "\f11d"; } -.fa-sign-out::before { content: "\f11e"; } -.fa-sliders::before { content: "\f11f"; } -.fa-sort::before { content: "\f120"; } -.fa-sort-asc::before { content: "\f121"; } -.fa-sort-desc::before { content: "\f122"; } -.fa-star::before { content: "\f123"; } -.fa-star-o::before { content: "\f124"; } -.fa-table::before { content: "\f125"; } -.fa-times::before, .fa-close::before { content: "\f126"; } -.fa-trash::before { content: "\f127"; } -.fa-trash-o::before { content: "\f128"; } -.fa-user-circle-o::before { content: "\f129"; } -.fa-user-plus::before { content: "\f12a"; } -.fa-wrench::before { content: "\f12b"; } +.fa-address-card-o::before, .fa-vcard-o::before { content: "\f100"; } +.fa-at::before { content: "\f101"; } +.fa-bell::before { content: "\f102"; } +.fa-bell-o::before { content: "\f103"; } +.fa-calendar::before { content: "\f104"; } +.fa-check::before { content: "\f105"; } +.fa-clock-o::before { content: "\f106"; } +.fa-cloud-upload::before { content: "\f107"; } +.fa-code-fork::before { content: "\f108"; } +.fa-download::before { content: "\f109"; } +.fa-eye::before { content: "\f10a"; } +.fa-eye-slash::before { content: "\f10b"; } +.fa-facebook-square::before { content: "\f10c"; } +.fa-filter::before { content: "\f10d"; } +.fa-flag::before { content: "\f10e"; } +.fa-floppy-o::before, .fa-save::before { content: "\f10f"; } +.fa-gavel::before, .fa-legal::before { content: "\f110"; } +.fa-github::before { content: "\f111"; } +.fa-globe::before { content: "\f112"; } +.fa-google::before { content: "\f113"; } +.fa-history::before { content: "\f114"; } +.fa-key-modern::before { content: "\f115"; } +.fa-link::before { content: "\f116"; } +.fa-pencil-square-o::before, .fa-edit::before { content: "\f117"; } +.fa-question-circle::before { content: "\f118"; } +.fa-quote-left::before { content: "\f119"; } +.fa-reply::before { content: "\f11a"; } +.fa-rss::before { content: "\f11b"; } +.fa-search::before { content: "\f11c"; } +.fa-share-alt::before { content: "\f11d"; } +.fa-sign-in::before { content: "\f11e"; } +.fa-sign-out::before { content: "\f11f"; } +.fa-sliders::before { content: "\f120"; } +.fa-sort::before { content: "\f121"; } +.fa-sort-asc::before { content: "\f122"; } +.fa-sort-desc::before { content: "\f123"; } +.fa-star::before { content: "\f124"; } +.fa-star-o::before { content: "\f125"; } +.fa-table::before { content: "\f126"; } +.fa-times::before, .fa-close::before { content: "\f127"; } +.fa-trash::before { content: "\f128"; } +.fa-trash-o::before { content: "\f129"; } +.fa-user-circle-o::before { content: "\f12a"; } +.fa-user-plus::before { content: "\f12b"; } +.fa-wrench::before { content: "\f12c"; } diff --git a/public/fonts/fa-dtbl-1.eot b/public/fonts/fa-dtbl-1.eot index c8b5a0916654809914478eb5f2a62a2c3497080c..3fc4d1fbf1f0a93e644f083e3f56b6597283f374 100644 GIT binary patch delta 896 zcmah{T}V@57=FKVz8yF9oZ~tB!P3NOTFR#GIG3W?8sWumGEK;+wc}kh;F}D6A6d$Fun(z) z#^_5!hhfUF$Wd-MCpTx^)M2_~+R1IpUCZmp%j6g4U&>$R8Q#m!^E*PnFfU|;HL+0a zFK8>6l5(ZA^i%GU7gL{UcN|ZkC5&K5z#*`M3r@p1xCTl5CJR??FROI7GW8`?X=P6+ zC4{kX$aoZD%@$7*x2N8&*c$$W&62wk%{Z%MvDMof+@5Bl*p3j~#SgZM$1G({8>Fl$ z1;1wxJbt;Vy@{(Ua#UAWJBsSKruM4a$xJetp=GkLyDZ4Ez<34OD(9*%u)16J1@2flw1I7A+=|MJ%RGA@W2| zO6~@+bH7jif&NxepEmz;I|^OaBepRps0)MH*-T$=@B35q59s%dH?Ji){cj7E1lxIm#EH3!}pMe>u-vh|!NYANE`>TE| z1}LS&z@YpiBQ-HajIj^MXSf5zW*I;MzKQIHK(j=Ee3gvcl8Snvg$y!4fgM1B13CH0 ziPtU80xf4g0pus;CRP+MG%~sX1Gg}lVv)R{T`{}>oFRDhOP7vvY0aQEEIVqnlo z0IGS$zz9?Y#EXva^^WJa`O3h}4isQuxL&nrJ&gYU_CEs$0~<&s2Llts<< z28_ZC{2*mOVURH(B@PUFAOQvz)_;=)nCuy~CkHU;Om1Mh%c#9Mj#-y6av!4{V+NBF zlONL@rVq?<%==hGSmv-?V)?`B$GU?pgk6ne4#y2nH_i!MDqM58*|?Lqm+^4%`0#Y` zyx?`?-NO5VkBv`-FNtpp{{;R^0wDsg1Z@P@2>xMUnEZq#a`Q?y6Lm(T$@g@1fh3RK jOkM+^TNr`vV`flhWSYE5FJ!a0eg@;@Is -Created by FontForge 20170805 at Sun Jul 22 23:07:59 2018 +Created by FontForge 20170805 at Wed Jul 25 20:38:52 2018 By ondra The Fork Awesome font is licensed under the SIL OFL 1.1 (http://scripts.sil.org/OFL). Fork Awesome is a fork based of off Font Awesome 4.7.0 by Dave Gandy. More info on licenses at https://forkawesome.github.io @@ -22,165 +22,170 @@ The Fork Awesome font is licensed under the SIL OFL 1.1 (http://scripts.sil.org/ bbox="-0.0376684 -256 2048 1536.01" underline-thickness="89.6" underline-position="-179.2" - unicode-range="U+0020-F12B" + unicode-range="U+0020-F12C" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/fonts/fa-dtbl-1.ttf b/public/fonts/fa-dtbl-1.ttf index 1e110b4e068b9134276339f1ded3060ffdee509d..d669212bf29564c112cf83fea1d9b8cf72921d5e 100644 GIT binary patch delta 852 zcmah|Ur19?82`@Q@orP^z3%Q0mP?$Lq1~ao>U6klO6)<1bSfm++-+M9|82M>7Lh|5 z2!&KPf*_2h{-|zQ*-|u{vbJhpe z2d9Am00&9XK$q9sd+O@r@0S4TJ|Js7-BTwA-jCb?AZHK&@7=&hm?41cNaTBT@LGpMlYV1Ex*sAR1a_@6bUOKi{3Gb+A4m|NF+S1@He$G zHZvh{I5L))I`{yrh@T>UH5v^ntJ!Za(cmrO(3mn6gBfxX^%lex>Ou~JOG;1CCOo!S=tPHDH z2gnH`srQJ)=s|d8 z)6eO%h2FxIB41IuxU_hnIKwfVhnwfJ{4hVyr}-73R2VMtmdqLo4fhQ{#dG3FMzMJJ?KzpDZW)`jR6-7qto|z1}2rTd6BZp68rW+X1Z1*NH!{zgftIjelHLrkR|@ z78(U|iGjUnr0=%!1{4kausB1TkCGm4nsN2*W-X@Ya$KPJF{hA>d2 s&PlxnV&|1mXd)bs+k?tP$R1r>lOn`M@Om@(WDLtsNbd3MyG;rAABRW8*#H0l delta 482 zcmaD8|0brMfsuiMftR6yftew|%`L>YWuaRF1A|@wP*lc0Sl=k&Ty_@&17ie`pOBoJ zSnx<*^gjawQw31WE4i#hfx((3pMin-2vD9SJ+Zjp|9_xK40;|wK1X^^W!hi$V=+J} z9R>#F9~r5MDPoL$Kt97AAU4a$NUcxgo5*emG)x32ppubWQX#aEK?ca*0puUZ$xlwa zZgCc9Ir9l1KPfk{qJW{1(FG`P0pu&>CFZ8i%<2Efz@VW5w8Xj~zqo|E=VlfIgH8fa z%`>p)fF4|Qe6M#rzs*+$Zg!wH28QcZi`GMErbX)~F`Ba*fK?hywqulGV*NKchS8o; zd-5Dcoylhy?=os{Ud5!#7`cy8jxmEtiOG*?4$}wbIOcsUA}n)QF0uS!^<&+^7Q(K^ zF^A&@ryJ)4E)}jh+-%%Q+{<{lczk%ecwX?j@owRL!Nxvr6cp~d74x(bu)b&GfnfNo`EU;+lLG9%OE hf4U)?ll3wfl^7U-fz1S#0}@x)FoL2I$#09+0{{;edJ6ym diff --git a/public/fonts/fa-dtbl-1.woff2 b/public/fonts/fa-dtbl-1.woff2 index 30263db0f8735e0af35881cd383b2bd61e0da520..cd4d79bdaf46ea478428e3725490c413f53f9c39 100644 GIT binary patch literal 6032 zcmV;B7jNiyPew8T0RR9102hz|4FCWD059wS02es`0RR9100000000000000000000 z0000#Mn+Uk90p(jf=UPk5eN#(WV&|?WB>s+0we>0L?01$n9Qsa%f7jagrKF z0FqTWN>e!eVytiaOX<7!yF+=5qq|yNa^~iJw?nB4+mu6s3TTYR=hK{p>be9<*;ph~a^51a6Ib^;Qz5F`rko=>WJKN528iIQe4BeM`p1 zSvWvV_7A?mtIJmK5a$ul65l7#i@xj5j>r9o^Z6;@A7~-^wY;zAkwpCpvPIo5}i{zPb;8kGcxE7^6X^54ZJi@R19^50qkBl6`oX)fq2z29>$ zTPNobm?dG-)peUP}A_|CBB#Dr)5?4#TyHlX#T4`8v^;VJ_K(H8Z=R{mhe@8RF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+Is!)fL=nZVr<}6O3ITHssdv?!gFL3vU3x%s3hE@yFm4Xzo!1@ zz~V>0J$f`rBCe`i8D3j)p9cBYsErvSzf}p1P;*R`v?4s&r zPO@HvspNNQv-vY{6*bX>MKn9J8#!2YQ}TXV%!(>R8S>lNPE8+?M?+~yJWrp2u%-si z?Rvva%-NzQD%-0W$e>JBi z_-T>OAfu$ItJ$l7i*rtbO1y$26Oag!DN*%CWke7np(G?*0VWE_d1#cXj#^nlWzUN% zx8axv=TkKhjpivN%+$g*NEUG-SaRXjJtEy2hT~JW=-_5IHEn>_ z`N9Voj937y%jMXbclmi<#r$aE@?%)i9;f$K;#y)aSGWA(+&!tK7ZpkNZHm*|I3+kGt z$gQIvieO}6m@~G832+FOBq0s$z2FEdfo#S_<-epaZ<|MFX{)Zo2C%hFn?B{bW#2%;Hs8BDgA2|Rbi8e+gAjvf?5UEFYXKvdq2$Yx< z40$>ea3-?>Ac-0wWwd;8UKBIP>wr`~X{-;(ppJy2(0H_ncf2HIOOUMx`P!6VZgJ+91qYT{|CP)wr5NH9StV yT42_Z-R>go}FHvsQ3VuS^P>P!xSOOZNgmpElxKc4P7zW_AEjZW*}% diff --git a/resources/assets/sass/_fa-utils.scss b/resources/assets/sass/_fa-utils.scss index 91cd75c..fe09203 100644 --- a/resources/assets/sass/_fa-utils.scss +++ b/resources/assets/sass/_fa-utils.scss @@ -11,3 +11,7 @@ .fa-large { font-size: 1.6em; } + +.fa-huge { + font-size: 2em; +} diff --git a/resources/assets/sass/_helpers.scss b/resources/assets/sass/_helpers.scss index 8ddad0c..fee6245 100644 --- a/resources/assets/sass/_helpers.scss +++ b/resources/assets/sass/_helpers.scss @@ -18,3 +18,11 @@ display: none; } } + +.border-dashed { + border-style: dashed !important; +} + +.border-dotted { + border-style: dotted !important; +} diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index e101dd4..bbd021f 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -13,7 +13,7 @@ @php(Widget::setLayout(4, 6)) - {!! Widget::email('email', 'E-Mail Address')->required()->autofocus() !!} + {!! Widget::text('login', 'Username or E-Mail')->required()->autofocus() !!} {!! Widget::password('password', 'Password')->required() !!} {!! Widget::checkbox('remember', 'Remember Me')->checked(false) !!} diff --git a/resources/views/form/checkbox.blade.php b/resources/views/form/checkbox.blade.php index d59a72d..b5489b8 100644 --- a/resources/views/form/checkbox.blade.php +++ b/resources/views/form/checkbox.blade.php @@ -7,7 +7,7 @@
value?'checked':''}} + {{\MightyPork\Utils\Utils::parseBool($w->value)?'checked':''}} name="{{ $w->name }}">
@@ -84,7 +84,7 @@ @endif - @include('user._table-list') + @include('profile._table-list') diff --git a/resources/views/user/edit.blade.php b/resources/views/user/edit.blade.php deleted file mode 100644 index 2d2cdc4..0000000 --- a/resources/views/user/edit.blade.php +++ /dev/null @@ -1,49 +0,0 @@ -{{-- Profile edit form --}} - -@extends('layouts.app') - -@section('content') -
- @csrf - -
- @php(Widget::setLayout(3, 7)) - - {!! Widget::header(1, 'Settings') !!} - - {!! Widget::text('title', 'Display Name')->value($user->title)->required()->autofocus() - ->help('Shown on your profile page, tables, comments, etc.') !!} - - {!! Widget::text('name', 'Username')->value($user->name)->required() - ->prepend('@') - ->help('Part of your vanity URL. Caution: changing this will alter URLs of your tables.') !!} - - {!! Widget::textarea('bio', 'About Me')->value($user->bio)->height('8em') - ->help('This is shown in your profile box') !!} - - {!! Widget::text('website', 'Website')->value($user->website)->prepend('') - ->help('Custom clickable link shown on your profile page.') !!} - - {!! Widget::email('email', 'E-Mail Address')->value($user->email)->required() - ->help('Used to login and for password resets. - This field is protected; a change will be applied only after you confirm - the new e-mail address via a confirmation link we\'ll send you to it.') !!} - - {!! Widget::header(3, 'Password Change') !!} - {!! Widget::par('Leave empty to keep your current password (if any).') !!} - - {!! Widget::password('new_password', 'New Password') !!} - - {!! Widget::password('new_password_confirmation', 'Confirm New Password') !!} - -
-
- -
-
-
-
-@endsection diff --git a/resources/views/user/logins.blade.php b/resources/views/user/logins.blade.php deleted file mode 100644 index c6a0cb9..0000000 --- a/resources/views/user/logins.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -{{-- Profile edit form --}} - -@extends('layouts.app') - -@section('content') -
-
- @php(Widget::setLayout(3, 7)) - - {!! Widget::header(1, 'Logins') !!} - -

TODO social logins, add email & change pw form here

-
-
-@endsection diff --git a/routes/login.php b/routes/login.php index 67934e7..8df2c12 100644 --- a/routes/login.php +++ b/routes/login.php @@ -11,8 +11,24 @@ Auth::routes(); // ----------------- SOCIAL LOGIN -------------------- function _loginVia($method) { + $wasLoggedIn = !guest(); + try { - SocialAuth::login($method, function (User $user, ProviderUser $details) { + SocialAuth::login($method, function (User $user, ProviderUser $details) use($wasLoggedIn) { + if ($user->exists && !$wasLoggedIn) { + // check if this identity already existed + if (! $user->socialIdentities() + ->where('provider', $details->provider) + ->where('provider_user_id', $details->id) + ->exists()) { + Auth::logout(); + abort(403, + "Account with this e-mail already exists. Add the identity + to the account manually after logging in through an existing + authentication method."); + } + } + // update user name first time user logs in if (!$user->exists) { $basename = $details->nickname ?: ($details->full_name ?: $details->email); @@ -28,7 +44,6 @@ function _loginVia($method) { if ("$user->email" === "") { $user->email = $details->email; } - $user->confirmed = true; // mark as confirmed, we trust the provider }); } catch (ApplicationRejectedException $e) { @@ -36,7 +51,11 @@ function _loginVia($method) { } catch (InvalidAuthorizationCodeException $e) { abort(401, $e->getMessage()); } - return Redirect::intended(); + + if ($wasLoggedIn) + return redirect(route('profile.manage-oauth')); + else + return Redirect::intended(); }; @@ -66,6 +85,8 @@ Route::get('/auth/facebook/callback', function() { return _loginVia('facebook'); })->name('oauth-facebook-callback'); +Route::get('/auth/forget/{id}', 'ProfileController@forgetSocialLogin')->name('forget-identity'); + /* Route::get('/auth/stack/authorize', function() { return SocialAuth::authorize('stack'); diff --git a/routes/web.php b/routes/web.php index 05d6a73..6eba96a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,7 +13,7 @@ Route::get('/about/privacy', function () { Route::get('/', function () { if (!Auth::guest()) { - return redirect(route('user.view', Auth::user()->name)); + return redirect(route('profile.view', Auth::user()->name)); } return view('welcome'); }); @@ -28,15 +28,15 @@ Route::group(['middleware' => 'auth'], function () { }); Route::group([ - 'prefix' => 'user', + 'prefix' => 'profile', ], function () { - Route::get('edit', 'UserController@edit')->name('user.edit'); - Route::post('edit', 'UserController@store')->name('user.store'); + Route::get('edit', 'ProfileController@edit')->name('profile.edit'); + Route::post('edit', 'ProfileController@store')->name('profile.store'); Route::post('create', 'TableController@storeNew')->name('table.storeNew'); - Route::get('logins', 'UserController@manageOauth')->name('user.manage-oauth'); + Route::get('logins', 'ProfileController@manageOauth')->name('profile.manage-oauth'); }); }); // Table resource - located at the end to work as a fallback -Route::get('@{user}', 'UserController@view')->name('user.view'); +Route::get('@{user}', 'ProfileController@view')->name('profile.view'); Route::get('@{user}/{table}', 'TableController@view')->name('table.view'); diff --git a/sideload/adamwathan/eloquent-oauth/src/Authenticator.php b/sideload/adamwathan/eloquent-oauth/src/Authenticator.php index 3b04afd..8e5cfe6 100644 --- a/sideload/adamwathan/eloquent-oauth/src/Authenticator.php +++ b/sideload/adamwathan/eloquent-oauth/src/Authenticator.php @@ -93,6 +93,10 @@ class Authenticator $identity->provider = $providerAlias; $identity->provider_user_id = $details->id; $identity->access_token = $details->access_token; + $identity->nick_name = $details->nickname; + $identity->full_name = $details->full_name; + $identity->avatar = $details->avatar; + $identity->email = $details->email; $this->identities->store($identity); } } diff --git a/sideload/adamwathan/eloquent-oauth/src/OAuthIdentity.php b/sideload/adamwathan/eloquent-oauth/src/OAuthIdentity.php index f221e87..5b64562 100644 --- a/sideload/adamwathan/eloquent-oauth/src/OAuthIdentity.php +++ b/sideload/adamwathan/eloquent-oauth/src/OAuthIdentity.php @@ -8,9 +8,15 @@ use Illuminate\Database\Eloquent\Model; * @property $provider * @property $provider_user_id * @property $access_token + * @property $nick_name + * @property $full_name + * @property $avatar + * @property $email */ class OAuthIdentity extends Model { + protected $guarded = []; + protected static $configuredTable = 'oauth_identities'; public static function configureTable($table) diff --git a/sideload/socialnorm/facebook/src/FacebookProvider.php b/sideload/socialnorm/facebook/src/FacebookProvider.php index cab093e..9a5ccdb 100644 --- a/sideload/socialnorm/facebook/src/FacebookProvider.php +++ b/sideload/socialnorm/facebook/src/FacebookProvider.php @@ -21,6 +21,11 @@ class FacebookProvider extends OAuth2Provider 'timezone', ]; + protected function providerName() + { + return 'facebook'; + } + protected function getAuthorizeUrl() { return $this->authorizeUrl; diff --git a/sideload/socialnorm/github/src/GitHubProvider.php b/sideload/socialnorm/github/src/GitHubProvider.php index 4c1702c..5856ac7 100644 --- a/sideload/socialnorm/github/src/GitHubProvider.php +++ b/sideload/socialnorm/github/src/GitHubProvider.php @@ -24,6 +24,11 @@ class GitHubProvider extends OAuth2Provider ], ]; + protected function providerName() + { + return 'github'; + } + protected function getAuthorizeUrl() { return $this->authorizeUrl; diff --git a/sideload/socialnorm/google/src/GoogleProvider.php b/sideload/socialnorm/google/src/GoogleProvider.php index bad25c2..157ff51 100644 --- a/sideload/socialnorm/google/src/GoogleProvider.php +++ b/sideload/socialnorm/google/src/GoogleProvider.php @@ -21,6 +21,11 @@ class GoogleProvider extends OAuth2Provider 'user_details' => [], ]; + protected function providerName() + { + return 'google'; + } + protected function compileScopes() { return implode(' ', $this->scope); diff --git a/sideload/socialnorm/socialnorm/src/ProviderUser.php b/sideload/socialnorm/socialnorm/src/ProviderUser.php index 109a99f..302a29f 100644 --- a/sideload/socialnorm/socialnorm/src/ProviderUser.php +++ b/sideload/socialnorm/socialnorm/src/ProviderUser.php @@ -1,6 +1,7 @@ full_name = $this->fetch($attributes, 'full_name'); $this->avatar = $this->fetch($attributes, 'avatar'); $this->email = $this->fetch($attributes, 'email'); + $this->provider = $this->fetch($attributes, 'provider'); $this->raw = $raw; } diff --git a/sideload/socialnorm/socialnorm/src/Providers/OAuth2Provider.php b/sideload/socialnorm/socialnorm/src/Providers/OAuth2Provider.php index 306a42e..0944dd6 100644 --- a/sideload/socialnorm/socialnorm/src/Providers/OAuth2Provider.php +++ b/sideload/socialnorm/socialnorm/src/Providers/OAuth2Provider.php @@ -44,6 +44,8 @@ abstract class OAuth2Provider implements Provider return $this->redirectUri; } + protected abstract function providerName(); + public function authorizeUrl(string $state) : string { $url = $this->getAuthorizeUrl(); @@ -71,6 +73,7 @@ abstract class OAuth2Provider implements Provider $this->accessToken = $this->requestAccessToken(); $this->providerUserData = $this->requestUserData(); return new ProviderUser([ + 'provider' => $this->providerName(), 'access_token' => $this->accessToken, 'id' => $this->userId(), 'nickname' => $this->nickname(), diff --git a/sideload/socialnorm/stackoverflow/src/StackOverflowProvider.php b/sideload/socialnorm/stackoverflow/src/StackOverflowProvider.php index 823ad6e..823a7a9 100644 --- a/sideload/socialnorm/stackoverflow/src/StackOverflowProvider.php +++ b/sideload/socialnorm/stackoverflow/src/StackOverflowProvider.php @@ -29,6 +29,11 @@ class StackOverflowProvider extends OAuth2Provider 'user_details' => [], ]; + protected function providerName() + { + return 'stack'; + } + public function __construct(array $config, HttpClient $httpClient, Request $request) { parent::__construct($config, $httpClient, $request); diff --git a/vendor_patches/20_ci_login.patch b/vendor_patches/20_ci_login.patch new file mode 100644 index 0000000..f3130d8 --- /dev/null +++ b/vendor_patches/20_ci_login.patch @@ -0,0 +1,11 @@ +--- vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.orig.php 2018-07-25 22:46:46.980782012 +0200 ++++ vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php 2018-07-25 22:48:47.490981175 +0200 +@@ -121,7 +121,7 @@ + if (is_array($value) || $value instanceof Arrayable) { + $query->whereIn($key, $value); + } else { +- $query->where($key, $value); ++ $query->whereRaw('LOWER(' . $key . ')=LOWER(?)', [$value]); + } + } +