1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Working on password reset

This commit is contained in:
Hillel Coren 2017-11-15 09:51:49 +02:00
parent 38d322389b
commit 6dde9de191
6 changed files with 47 additions and 10 deletions

View File

@ -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]
);
}
} }

View File

@ -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]
); );
} }

View File

@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Eloquent;
/**
* Class Client.
*/
class PasswordReset extends Eloquent
{
}

View File

@ -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>

View File

@ -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>