PW-reset
This commit is contained in:
@@ -363,4 +363,35 @@ Route::post('news', array('before' => 'auth', function() {
|
||||
$n->save();
|
||||
return Redirect::to('/')->with('message', 'News erstellt!');
|
||||
}
|
||||
}));
|
||||
}));
|
||||
|
||||
Route::get('passwort-vergessen', function() {
|
||||
return View::make('pwform');
|
||||
});
|
||||
|
||||
Route::post('passwort-vergessen', function() {
|
||||
$credentials = array('email' => Input::get('email'));
|
||||
return Password::remind($credentials, function($message, $user) {
|
||||
$message->subject('Passwort für Dumbo zurücksetzen.');
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('passwort-reset/{token}', function($token) {
|
||||
return View::make('pwreset')->with('token', $token);
|
||||
});
|
||||
|
||||
Route::post('passwort-reset', function() {
|
||||
$credentials = array(
|
||||
'email' => Input::get('email'),
|
||||
'password' => Input::get('password'),
|
||||
'password_confirmation' => Input::get('password_confirmation')
|
||||
);
|
||||
|
||||
return Password::reset($credentials, function($user, $password) {
|
||||
$user->password = Hash::make($password);
|
||||
|
||||
$user->save();
|
||||
|
||||
return Redirect::to('/');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user