add log for password resetting

This commit is contained in:
printempw 2016-11-07 22:34:34 +08:00
parent b42ad27f6f
commit 11c88f28cd

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use Log;
use Mail;
use View;
use Utils;
@ -191,6 +192,8 @@ class AuthController extends Controller
$m->from(config('mail.username'), $site_name);
$m->to($request->input('email'))->subject(trans('auth.mail.title', ['sitename' => $site_name]));
});
Log::info("[Password Reset] Mail has been sent to [{$request->input('email')}] with token [$token]");
} catch(\Exception $e) {
return json(trans('auth.mail.failed', ['msg' => $e->getMessage()]), 2);
}
@ -238,6 +241,8 @@ class AuthController extends Controller
$users->get($request->input('uid'))->changePasswd($request->input('password'));
Log::info("[Password Reset] Password of user [{$request->input('uid')}] has been changed");
return json(trans('auth.reset.success'), 0);
}