Reset Password In Gmail
This commit is contained in:
parent
39d74750a4
commit
4064acc1c5
|
@ -49,9 +49,9 @@ public function login(Request $request)
|
|||
$user = Auth::user();
|
||||
$request->session()->put('user_id', $user->id);
|
||||
|
||||
// // Membuat dan menyimpan token "remember me"
|
||||
// $token = $user->createToken("auth-token")->plainTextToken;
|
||||
// $user->update(['remember_token' => $token]);
|
||||
// Membuat dan menyimpan token "remember me"
|
||||
$token = $user->createToken("auth-token")->plainTextToken;
|
||||
$user->update(['remember_token' => $token]);
|
||||
|
||||
return redirect('/dashboard')->with('success', 'Login berhasil!');
|
||||
} else {
|
||||
|
@ -122,9 +122,12 @@ public function sendResetLinkEmail(Request $request)
|
|||
$request->only('email')
|
||||
);
|
||||
|
||||
return $status === Password::RESET_LINK_SENT
|
||||
? back()->with(['status' => __($status)])
|
||||
: back()->withErrors(['email' => __($status)]);
|
||||
if ($status === Password::RESET_LINK_SENT) {
|
||||
session()->flash('success', 'Email Berhasil Dikirim!');
|
||||
} else {
|
||||
session()->flash('error', __($status));
|
||||
}
|
||||
return back();
|
||||
}
|
||||
|
||||
public function resetPassword(Request $request)
|
||||
|
@ -132,7 +135,7 @@ public function resetPassword(Request $request)
|
|||
$request->validate([
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
'password' => 'required|confirmed|min:5',
|
||||
]);
|
||||
|
||||
$status = Password::reset(
|
||||
|
@ -146,9 +149,11 @@ function ($user, $password) {
|
|||
}
|
||||
);
|
||||
|
||||
return $status == Password::PASSWORD_RESET
|
||||
? redirect('/login')->with(['status' => __($status)])
|
||||
: back()->withErrors(['email' => [__($status)]]);
|
||||
if ($status == Password::PASSWORD_RESET) {
|
||||
return redirect('/login')->with('success', 'Password Berhasil Diperbarui! Silakan Login Kembali.');
|
||||
} else {
|
||||
return back()->withErrors(['email' => [__($status)]]);
|
||||
}
|
||||
}
|
||||
|
||||
public function logout(Request $request)
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<div class="row align-items-center">
|
||||
<div class="col-md-6 col-lg-7">
|
||||
<img src="{{ asset('vendors/images/forgot-password.png') }}" alt="">
|
||||
{{-- <img src="vendors/images/login-page-img.png" alt="" /> --}}
|
||||
</div>
|
||||
@if(session('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
|
@ -18,6 +17,7 @@
|
|||
</div>
|
||||
<form method="POST" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
@if($errors->has('email'))
|
||||
<div class="alert alert-danger">{{ $errors->first('email') }}</div>
|
||||
@endif
|
||||
|
@ -40,7 +40,7 @@
|
|||
<div class="alert alert-danger">{{ $errors->first('password_confirmation') }}</div>
|
||||
@endif
|
||||
<div class="input-group custom mb-2">
|
||||
<input type="password_confirmation" class="form-control" name="password_confirmation" id="password_confirmation" value="" placeholder="confirm password" required>
|
||||
<input type="password" class="form-control" name="password_confirmation" id="password_confirmation" value="" placeholder="confirm password" required>
|
||||
<div class="input-group-append custom">
|
||||
<span class="input-group-text"><i class="dw dw-padlock1"></i></span>
|
||||
</div>
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<header class="header_section">
|
||||
<div class="container-fluid">
|
||||
<nav class="navbar navbar-expand-lg custom_nav-container ">
|
||||
<a class="navbar-brand" href="/home"></a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
|
||||
|
@ -51,16 +52,14 @@
|
|||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ $title === 'Home' ? 'active' : '' }}"
|
||||
href="/home">Home</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ $title === 'Ekstrakurikuler' ? 'active' : '' }}"
|
||||
href="/data-ekstrakurikuler">Ekstrakurikuler</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ $title === 'Home' ? 'active' : '' }}"
|
||||
href="/home">Home</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ $title === 'Ekstrakurikuler' ? 'active' : '' }}"
|
||||
href="/data-ekstrakurikuler">Ekstrakurikuler</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="quote_btn-container">
|
||||
<a href="{{ route('login') }}" class="quote_btn">
|
||||
|
|
|
@ -46,8 +46,7 @@
|
|||
<header class="header_section">
|
||||
<div class="container-fluid">
|
||||
<nav class="navbar navbar-expand-lg custom_nav-container ">
|
||||
<a class="navbar-brand" href="/home">
|
||||
</a>
|
||||
<a class="navbar-brand" href="/home"></a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<title>SIPEX</title>
|
||||
|
||||
<!-- Site favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('vendors/images/apple-touch-icon.png') }}" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('img/logo-no-background.png') }}" />
|
||||
<link rel="icon" type="image/png" href="{{ asset('img/logo-no-background.png') }}" />
|
||||
<link rel="icon" type="image/png" href="{{ asset('img/logo-no-background.png') }}" />
|
||||
|
||||
|
|
Loading…
Reference in New Issue