#4 - users CRUD #24

Merged
Baakoma merged 24 commits from #4-users-crud into main 2022-01-19 10:55:10 +01:00
4 changed files with 8 additions and 7 deletions
Showing only changes of commit d7d84a1b30 - Show all commits

View File

@@ -26,10 +26,6 @@ class GoogleController extends Controller
$user = User::query() $user = User::query()
->where("email", $socialUser->getEmail()) ->where("email", $socialUser->getEmail())
->firstOrFail(); ->firstOrFail();
$auth->guard()->login($user, true);
return redirect()->route("dashboard");
} catch (ModelNotFoundException) { } catch (ModelNotFoundException) {
return redirect() return redirect()
->route("login") ->route("login")
@@ -37,5 +33,9 @@ class GoogleController extends Controller
"oauth" => __("User does not exist."), "oauth" => __("User does not exist."),
]); ]);
} }
$auth->guard()->login($user, true);
return redirect()->route("dashboard");
} }
} }

View File

@@ -8,7 +8,7 @@ use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware class Authenticate extends Middleware
{ {
protected function redirectTo($request): ?string protected function redirectTo($request): string
{ {
return route("login"); return route("login");
} }

View File

@@ -1,4 +1,5 @@
<template> <template>
<InertiaHead title="Zaloguj się" />
<transition <transition
enter-active-class="transform ease-out duration-300 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" enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
@@ -21,7 +22,7 @@
</div> </div>
<div class="ml-4 flex-shrink-0 flex"> <div class="ml-4 flex-shrink-0 flex">
<button <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" @click="delete errors.oauth"
> >
<span class="sr-only">Close</span> <span class="sr-only">Close</span>

View File

@@ -9,4 +9,4 @@
export default { export default {
name: 'GuestLayout', name: 'GuestLayout',
}; };
</script> </script>