Skip to content

Commit

Permalink
Merge pull request github#1 from jrvieirapr/ajuste-site
Browse files Browse the repository at this point in the history
Ajuste login e logout
  • Loading branch information
jrvieirapr authored Oct 22, 2024
2 parents 704f85a + eeec3ff commit 1606ce1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
12 changes: 7 additions & 5 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@ public function store(LoginRequest $request): RedirectResponse

$request->session()->regenerate();

return redirect()->intended(route('dashboard', absolute: false));
return redirect()->away('/dashboard');
}

/**
* Destroy an authenticated session.
*/
public function destroy(Request $request): RedirectResponse
{
Auth::guard('web')->logout();

Auth::guard('web')->logout();

$request->session()->invalidate();

$request->session()->regenerateToken();

return redirect('/');


return redirect()->away('/');
}
}
2 changes: 1 addition & 1 deletion resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ __('Esta é uma área segura da aplicação. Por favor, confirme sua senha antes de continuar.') }}
</div>

<form method="POST" action="{{ route('password.confirm') }}">
<form method="POST" action="/confirm-password">
@csrf

<!-- Senha -->
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@endif

<!-- Formulário de E-mail para Redefinição de Senha -->
<form method="POST" action="{{ route('password.email') }}">
<form method="POST" action="/forgot-password">
@csrf

<!-- Endereço de E-mail -->
Expand Down
4 changes: 2 additions & 2 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@endif

<!-- Formulário de Login -->
<form method="POST" action="{{ route('login') }}">
<form method="POST" action="/login">
@csrf

<!-- Endereço de E-mail -->
Expand Down Expand Up @@ -48,7 +48,7 @@
<!-- Ações -->
<div class="d-flex justify-content-between align-items-center mt-4">
@if (Route::has('password.request'))
<a class="text-sm text-muted" href="{{ route('password.request') }}">
<a class="text-sm text-muted" href="/forgot-password">
{{ __('Esqueceu sua senha?') }}
</a>
@endif
Expand Down
4 changes: 2 additions & 2 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-md-6">
<form method="POST" action="{{ route('register') }}">
<form method="POST" action="/register">
@csrf

<!-- Nome -->
Expand Down Expand Up @@ -54,7 +54,7 @@
</div>

<div class="d-flex justify-content-between align-items-center mt-4">
<a class="text-sm text-muted" href="{{ route('login') }}">
<a class="text-sm text-muted" href="/login">
{{ __('Já registrado?') }}
</a>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-md-6">
<form method="POST" action="{{ route('password.store') }}">
<form method="POST" action="/reset-password">
@csrf

<!-- Token de Redefinição de Senha -->
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/verify-email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div class="d-flex justify-content-between align-items-center mt-4">
<!-- Reenviar e-mail de verificação -->
<form method="POST" action="{{ route('verification.send') }}">
<form method="POST" action="/email/verification-notification">
@csrf
<button type="submit" class="btn btn-primary">
{{ __('Reenviar E-mail de Verificação') }}
Expand Down
3 changes: 3 additions & 0 deletions resources/views/partials/navbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
<li class="nav-item">
<a href="/login" class="nav-link text-white">Login</a>
</li>
<li class="nav-item">
<a href="/register" class="nav-link text-white">Registro</a>
</li>
@endauth
</ul>ndauth
</ul>
Expand Down

0 comments on commit 1606ce1

Please sign in to comment.