Route cosmetic layout updates, and standardise on using /home to redirect back to the homescreen, and standardise usage of redirect()

This commit is contained in:
2025-05-16 13:58:20 +10:00
parent 256e4c6260
commit 8d72c1ceb5
10 changed files with 57 additions and 58 deletions

View File

@@ -27,7 +27,7 @@ class SocialLoginController extends Controller
$openiduser = Socialite::with($provider)->user();
if (! $openiduser)
return redirect('/home')
return redirect('home')
->with('error','No user details obtained.');
$oo = ProviderOauth::firstOrCreate(['name'=>$provider,'active'=>TRUE]);
@@ -43,7 +43,7 @@ class SocialLoginController extends Controller
$user = User::where('email',$openiduser->email)->first();
if ((! $user) || (! $user->active))
return redirect('/login')
return redirect('login')
->with('error','Invalid account, or account inactive, please contact an admin.');
return $this->link($provider,$aoo,$user);
@@ -54,7 +54,7 @@ class SocialLoginController extends Controller
// If there are too many users, then we have a problem
} elseif ($aoo->count() > 1) {
return redirect('/login')
return redirect('login')
->with('error','Seems you have multiple oauth IDs, please contact an admin.');
// User is using OAUTH for the first time.
@@ -73,11 +73,11 @@ class SocialLoginController extends Controller
// If there are too many users, then we have a problem
} elseif ($uo->count() > 1) {
return redirect('/login')
return redirect('login')
->with('error','Seems you have multiple accounts, please contact an admin.');
} else {
return redirect('/login')
return redirect('login')
->with('error','Seems you dont have an account with that email, please contact an admin.');
}
}
@@ -91,7 +91,7 @@ class SocialLoginController extends Controller
$openiduser = Socialite::with($provider)->user();
if (! $openiduser)
return redirect('/home')
return redirect('home')
->with('error','No user details obtained.');
$po = ProviderOauth::where('name',$provider)->singleOrFail();
@@ -137,12 +137,12 @@ class SocialLoginController extends Controller
// Check our email matches
if (Arr::get($aoo->oauth_data,'email','invalid') !== $request->post('email'))
return redirect('/login')
return redirect('login')
->with('error','Account details didnt match to make link.');
// Check our token matches
if ($aoo->link_token !== $request->post('token'))
return redirect('/login')
return redirect('login')
->with('error','Token details didnt match to make link.');
// Load our email.