mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 14:12:44 +01:00
Working on password reset
This commit is contained in:
parent
38d322389b
commit
6dde9de191
@ -54,4 +54,14 @@ class ResetPasswordController extends Controller
|
|||||||
return $this->traitSendResetResponse($response);
|
return $this->traitSendResetResponse($response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showResetForm(Request $request, $token = null)
|
||||||
|
{
|
||||||
|
$passwordReset = PasswordReset::whereToken($token)->first();
|
||||||
|
$email = $passwordReset ? $passwordReset->email : '';
|
||||||
|
|
||||||
|
return view('auth.passwords.reset')->with(
|
||||||
|
['token' => $token, 'email' => $email]
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ use Config;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\PasswordReset;
|
||||||
|
|
||||||
class ResetPasswordController extends Controller
|
class ResetPasswordController extends Controller
|
||||||
{
|
{
|
||||||
@ -54,8 +55,11 @@ class ResetPasswordController extends Controller
|
|||||||
|
|
||||||
public function showResetForm(Request $request, $token = null)
|
public function showResetForm(Request $request, $token = null)
|
||||||
{
|
{
|
||||||
|
$passwordReset = PasswordReset::whereToken($token)->first();
|
||||||
|
$email = $passwordReset ? $passwordReset->email : '';
|
||||||
|
|
||||||
return view('clientauth.passwords.reset')->with(
|
return view('clientauth.passwords.reset')->with(
|
||||||
['token' => $token]
|
['token' => $token, 'email' => $email]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
app/Models/PasswordReset.php
Normal file
13
app/Models/PasswordReset.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Eloquent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Client.
|
||||||
|
*/
|
||||||
|
class PasswordReset extends Eloquent
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -3,11 +3,16 @@
|
|||||||
@section('form')
|
@section('form')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
{!! Former::open('/password/reset')->addClass('form-signin')->rules(array(
|
{!! Former::open('/password/reset')
|
||||||
|
->addClass('form-signin')
|
||||||
|
->autocomplete('off')
|
||||||
|
->rules(array(
|
||||||
'password' => 'required',
|
'password' => 'required',
|
||||||
'password_confirmation' => 'required',
|
'password_confirmation' => 'required',
|
||||||
)) !!}
|
)) !!}
|
||||||
|
|
||||||
|
@include('partials.autocomplete_fix')
|
||||||
|
|
||||||
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
|
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
|
||||||
<hr class="green">
|
<hr class="green">
|
||||||
|
|
||||||
@ -35,9 +40,9 @@
|
|||||||
<input type="hidden" name="token" value="{{{ $token }}}">
|
<input type="hidden" name="token" value="{{{ $token }}}">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!}
|
{!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!}
|
||||||
{!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
|
{!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!}
|
||||||
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
|
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>
|
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>
|
||||||
|
@ -3,11 +3,16 @@
|
|||||||
@section('form')
|
@section('form')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
{!! Former::open('/client/password/reset')->addClass('form-signin')->rules(array(
|
{!! Former::open('/client/password/reset')
|
||||||
|
->addClass('form-signin')
|
||||||
|
->autocomplete('false')
|
||||||
|
->rules(array(
|
||||||
'password' => 'required',
|
'password' => 'required',
|
||||||
'password_confirmation' => 'required',
|
'password_confirmation' => 'required',
|
||||||
)) !!}
|
)) !!}
|
||||||
|
|
||||||
|
@include('partials.autocomplete_fix')
|
||||||
|
|
||||||
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
|
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
|
||||||
<hr class="green">
|
<hr class="green">
|
||||||
|
|
||||||
@ -35,9 +40,9 @@
|
|||||||
<input type="hidden" name="token" value="{{{ $token }}}">
|
<input type="hidden" name="token" value="{{{ $token }}}">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!}
|
{!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!}
|
||||||
{!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
|
{!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!}
|
||||||
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
|
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>
|
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user