Dan Brown

Added password reset functionaility. Fixes #27.

...@@ -20,10 +20,10 @@ class PasswordController extends Controller ...@@ -20,10 +20,10 @@ class PasswordController extends Controller
20 20
21 use ResetsPasswords; 21 use ResetsPasswords;
22 22
23 + protected $redirectTo = '/';
24 +
23 /** 25 /**
24 * Create a new password controller instance. 26 * Create a new password controller instance.
25 - *
26 - * @return void
27 */ 27 */
28 public function __construct() 28 public function __construct()
29 { 29 {
......
...@@ -86,6 +86,13 @@ Route::group(['middleware' => 'auth'], function() { ...@@ -86,6 +86,13 @@ Route::group(['middleware' => 'auth'], function() {
86 86
87 }); 87 });
88 88
89 +// Login/Logout routes
89 Route::get('/login', 'Auth\AuthController@getLogin'); 90 Route::get('/login', 'Auth\AuthController@getLogin');
90 Route::post('/login', 'Auth\AuthController@postLogin'); 91 Route::post('/login', 'Auth\AuthController@postLogin');
91 Route::get('/logout', 'Auth\AuthController@getLogout'); 92 Route::get('/logout', 'Auth\AuthController@getLogout');
93 +// Password reset link request routes...
94 +Route::get('/password/email', 'Auth\PasswordController@getEmail');
95 +Route::post('/password/email', 'Auth\PasswordController@postEmail');
96 +// Password reset routes...
97 +Route::get('/password/reset/{token}', 'Auth\PasswordController@getReset');
98 +Route::post('/password/reset', 'Auth\PasswordController@postReset');
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -54,7 +54,7 @@ return [ ...@@ -54,7 +54,7 @@ return [
54 | 54 |
55 */ 55 */
56 56
57 - 'from' => ['address' => null, 'name' => null], 57 + 'from' => ['address' => env('MAIL_FROM', 'mail@bookstackapp.com'), 'name' => 'BookStack'],
58 58
59 /* 59 /*
60 |-------------------------------------------------------------------------- 60 |--------------------------------------------------------------------------
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
29 <div class="form-group"> 29 <div class="form-group">
30 <label for="password">Password</label> 30 <label for="password">Password</label>
31 @include('form/password', ['name' => 'password']) 31 @include('form/password', ['name' => 'password'])
32 + <span class="block small"><a href="/password/email">Forgot Password?</a></span>
32 </div> 33 </div>
33 34
34 <div class="from-group"> 35 <div class="from-group">
......
1 +@extends('public')
2 +
3 +@section('body-class', 'image-cover login')
4 +
5 +@section('sidebar')
6 +
7 +
8 + <div class="text-center">
9 + <div class="center-box text-left">
10 + <h1>Reset Password</h1>
11 +
12 + <p class="muted small">Enter your email below and you will be sent an email with a password reset link.</p>
13 +
14 + <form action="/password/email" method="POST">
15 + {!! csrf_field() !!}
16 +
17 + <div class="form-group">
18 + <label for="email">Email</label>
19 + @include('form/text', ['name' => 'email'])
20 + </div>
21 +
22 + <div class="from-group">
23 + <button class="button block pos">Send Reset Link</button>
24 + </div>
25 + </form>
26 + </div>
27 + </div>
28 +
29 +@stop
...\ No newline at end of file ...\ No newline at end of file
1 +@extends('public')
2 +
3 +@section('body-class', 'image-cover login')
4 +
5 +@section('sidebar')
6 +
7 +
8 + <div class="text-center">
9 + <div class="center-box text-left">
10 + <h1>Reset Password</h1>
11 +
12 + <form action="/password/reset" method="POST">
13 + {!! csrf_field() !!}
14 + <input type="hidden" name="token" value="{{ $token }}">
15 +
16 + <div class="form-group">
17 + <label for="email">Email</label>
18 + @include('form/text', ['name' => 'email'])
19 + </div>
20 +
21 + <div class="form-group">
22 + <label for="password">Password</label>
23 + @include('form/password', ['name' => 'password'])
24 + </div>
25 +
26 + <div class="form-group">
27 + <label for="password_confirmation">Confirm Password</label>
28 + @include('form/password', ['name' => 'password_confirmation'])
29 + </div>
30 +
31 + <div class="from-group">
32 + <button class="button block pos">Reset Password</button>
33 + </div>
34 + </form>
35 + </div>
36 + </div>
37 +
38 +@stop
...\ No newline at end of file ...\ No newline at end of file