Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Dec 3, 2023
1 parent 5cf0394 commit 8de8a73
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
61 changes: 61 additions & 0 deletions resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@extends('root::auth.layout')

{{-- Title --}}
@section('title', __('Reset Password'))

{{-- Content --}}
@section('content')
<form method="POST" method="POST" action="{{ URL::route('root.auth.password.update') }}">
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group-stack">
<div class="form-group">
<label class="form-label" for="email">{{ __('Email') }}</label>
<input
@class(['form-control', 'form-control--lg', 'form-control--invalid' => $errors->has('email')])
id="email"
type="email"
name="email"
required
value="{{ Request::old('email') }}"
>
@error('email')
<span class="field-feedback field-feedback--invalid">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label class="form-label" for="password">{{ __('Password') }}</label>
<input
@class(['form-control', 'form-control--lg', 'form-control--invalid' => $errors->has('password')])
id="password"
type="password"
name="password"
required
value="{{ Request::old('password') }}"
>
@error('password')
<span class="field-feedback field-feedback--invalid">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<label class="form-label" for="password_confirmation">{{ __('Password Confirmation') }}</label>
<input
@class(['form-control', 'form-control--lg', 'form-control--invalid' => $errors->has('password_confirmation')])
id="password_confirmation"
type="password"
name="password_confirmation"
required
value="{{ Request::old('password_confirmation') }}"
>
@error('password_confirmation')
<span class="field-feedback field-feedback--invalid">{{ $message }}</span>
@enderror
</div>
<div class="form-group">
<button class="btn btn--primary btn--lg btn--block btn--primary-shadow">
{{ __('Reset Password') }}
</button>
</div>
</div>
</form>
@endsection
6 changes: 6 additions & 0 deletions src/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
namespace Cone\Root\Http\Controllers\Auth;

use Cone\Root\Http\Controllers\Controller;
use Illuminate\Auth\Events\Login;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Response as ResponseFactory;
use Illuminate\Support\Facades\URL;
Expand Down Expand Up @@ -56,6 +58,10 @@ public function login(Request $request): RedirectResponse

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

Event::dispatch(
new Login(Auth::getDefaultDriver(), $request->user(), $request->filled('remember'))
);

return Redirect::intended(URL::route('root.dashboard'));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function (User $user, string $password): void {
);

return $response == Password::PASSWORD_RESET
? Redirect::route('root.dashboard')->with('message', __($response))
? Redirect::route('root.dashboard')->with('status', __($response))
: Redirect::back()->withInput($request->only(['email']))->withErrors(['email' => __($response)]);
}

Expand Down

0 comments on commit 8de8a73

Please sign in to comment.