Merge branch 'main' into #4-users-crud
# Conflicts: # .env.example # app/Http/Controllers/GoogleController.php # app/Http/Middleware/Authenticate.php # app/Http/Resources/UserResource.php # app/Models/User.php # composer.lock # database/factories/UserFactory.php # database/migrations/2014_10_12_000000_create_users_table.php # package-lock.json # package.json # resources/js/Pages/Login.vue # resources/js/Shared/Layout/GuestLayout.vue # resources/js/Shared/MainMenu.vue # resources/js/app.js # resources/lang/pl.json # routes/web.php
This commit is contained in:
commit
d7d84a1b30
@ -26,10 +26,6 @@ class GoogleController extends Controller
|
||||
$user = User::query()
|
||||
->where("email", $socialUser->getEmail())
|
||||
->firstOrFail();
|
||||
|
||||
$auth->guard()->login($user, true);
|
||||
|
||||
return redirect()->route("dashboard");
|
||||
} catch (ModelNotFoundException) {
|
||||
return redirect()
|
||||
->route("login")
|
||||
@ -37,5 +33,9 @@ class GoogleController extends Controller
|
||||
"oauth" => __("User does not exist."),
|
||||
]);
|
||||
}
|
||||
|
||||
$auth->guard()->login($user, true);
|
||||
|
||||
return redirect()->route("dashboard");
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
protected function redirectTo($request): ?string
|
||||
protected function redirectTo($request): string
|
||||
{
|
||||
return route("login");
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<InertiaHead title="Zaloguj się" />
|
||||
<transition
|
||||
enter-active-class="transform ease-out duration-300 transition"
|
||||
enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
|
||||
@ -21,7 +22,7 @@
|
||||
</div>
|
||||
<div class="ml-4 flex-shrink-0 flex">
|
||||
<button
|
||||
class="bg-red-500 rounded-md inline-flex text-red-100 hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||
class="bg-red-500 rounded-md inline-flex text-red-100 hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-600"
|
||||
@click="delete errors.oauth"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
|
@ -9,4 +9,4 @@
|
||||
export default {
|
||||
name: 'GuestLayout',
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user