1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +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);
}
}
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 Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Http\Request;
use App\Models\PasswordReset;
class ResetPasswordController extends Controller
{
@ -54,8 +55,11 @@ class ResetPasswordController extends Controller
public function showResetForm(Request $request, $token = null)
{
$passwordReset = PasswordReset::whereToken($token)->first();
$email = $passwordReset ? $passwordReset->email : '';
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')
<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_confirmation' => 'required',
)) !!}
@include('partials.autocomplete_fix')
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
<hr class="green">
@ -35,9 +40,9 @@
<input type="hidden" name="token" value="{{{ $token }}}">
<div>
{!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!}
{!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
{!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!}
{!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!}
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
</div>
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>

View File

@ -3,11 +3,16 @@
@section('form')
<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_confirmation' => 'required',
)) !!}
@include('partials.autocomplete_fix')
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
<hr class="green">
@ -35,9 +40,9 @@
<input type="hidden" name="token" value="{{{ $token }}}">
<div>
{!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!}
{!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
{!! Former::text('email')->placeholder(trans('texts.password'))->value($email)->raw() !!}
{!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!}
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
</div>
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green'])->block() !!}</p>

View File

@ -1,4 +1,4 @@
<!-- http://stackoverflow.com/a/30873633/497368 -->
<div style="display: none;">
<input type="text" id="PreventChromeAutocomplete" name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>
</div>