diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 2856bb5e48..210b67c991 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -148,7 +148,7 @@ class ReportHelper implements ReportHelperInterface $sharedAccounts[] = $account->id; } - $accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get()->filter( + $accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])->filter( function (Account $account) use ($sharedAccounts) { if (!in_array($account->id, $sharedAccounts)) { return $account; diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 0d6f68e290..2d9ebced35 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -26,6 +26,9 @@ class PasswordController extends Controller use ResetsPasswords; + + protected $redirectPath = '/'; + /** * Create a new password controller instance. * @@ -38,6 +41,7 @@ class PasswordController extends Controller $this->auth = $auth; $this->passwords = $passwords; + $this->middleware('guest'); } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index 082fcf987a..5033c35130 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -41,7 +41,7 @@ class RedirectIfAuthenticated public function handle($request, Closure $next) { if ($this->auth->check()) { - return new RedirectResponse(url('/home')); + return new RedirectResponse(url('/')); } return $next($request); diff --git a/app/Http/routes.php b/app/Http/routes.php index b5e0d830cd..84ee9dd19c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -127,12 +127,27 @@ Route::bind( } ); + +/** + * Auth\AuthController + */ +Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'register']); + +Route::controllers( + [ + 'auth' => 'Auth\AuthController', + 'password' => 'Auth\PasswordController', + ] +); + + /** * Home Controller */ Route::group( ['middleware' => ['auth', 'range']], function () { Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']); + Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']); Route::get('/prev', ['uses' => 'HomeController@sessionPrev', 'as' => 'sessionPrev']); Route::get('/next', ['uses' => 'HomeController@sessionNext', 'as' => 'sessionNext']); Route::get('/jump/{range}', ['uses' => 'HomeController@rangeJump', 'as' => 'rangeJump']); @@ -327,14 +342,3 @@ Route::group( } ); -/** - * Auth\AuthController - */ -Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'register']); - -Route::controllers( - [ - 'auth' => 'Auth\AuthController', - 'password' => 'Auth\PasswordController', - ] -); diff --git a/app/Services/Registrar.php b/app/Services/Registrar.php index 5183c21308..123d11e8f8 100644 --- a/app/Services/Registrar.php +++ b/app/Services/Registrar.php @@ -24,7 +24,7 @@ class Registrar implements RegistrarContract return User::create( [ 'email' => $data['email'], - 'password' => bcrypt($data['password']), + 'password' => $data['password'], ] ); } diff --git a/config/mail.php b/config/mail.php index 6f9c954271..76d5eff892 100644 --- a/config/mail.php +++ b/config/mail.php @@ -2,123 +2,123 @@ return [ - /* - |-------------------------------------------------------------------------- - | Mail Driver - |-------------------------------------------------------------------------- - | - | Laravel supports both SMTP and PHP's "mail" function as drivers for the - | sending of e-mail. You may specify which one you're using throughout - | your application here. By default, Laravel is setup for SMTP mail. - | - | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log" - | - */ + /* + |-------------------------------------------------------------------------- + | Mail Driver + |-------------------------------------------------------------------------- + | + | Laravel supports both SMTP and PHP's "mail" function as drivers for the + | sending of e-mail. You may specify which one you're using throughout + | your application here. By default, Laravel is setup for SMTP mail. + | + | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log" + | + */ - 'driver' => 'smtp', + 'driver' => 'smtp', - /* - |-------------------------------------------------------------------------- - | SMTP Host Address - |-------------------------------------------------------------------------- - | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Mailgun mail service which will provide reliable deliveries. + | + */ - 'host' => 'smtp.mailgun.org', + 'host' => env('EMAIL_SMTP', 'smtp.mailgun.org'), - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- - | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to deliver e-mails to + | users of the application. Like the host we have set this value to + | stay compatible with the Mailgun e-mail application by default. + | + */ - 'port' => 587, + 'port' => 587, - /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | - */ + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ - 'from' => ['address' => null, 'name' => null], + 'from' => ['address' => env('EMAIL_USERNAME', null), 'name' => 'Firefly III Mailer'], - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ - 'encryption' => 'tls', + 'encryption' => 'tls', - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ - 'username' => null, + 'username' => env('EMAIL_USERNAME', null), - /* - |-------------------------------------------------------------------------- - | SMTP Server Password - |-------------------------------------------------------------------------- - | - | Here you may set the password required by your SMTP server to send out - | messages from your application. This will be given to the server on - | connection so that the application will be able to send messages. - | - */ + /* + |-------------------------------------------------------------------------- + | SMTP Server Password + |-------------------------------------------------------------------------- + | + | Here you may set the password required by your SMTP server to send out + | messages from your application. This will be given to the server on + | connection so that the application will be able to send messages. + | + */ - 'password' => null, + 'password' => env('EMAIL_PASSWORD', null), - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ - 'sendmail' => '/usr/sbin/sendmail -bs', + 'sendmail' => '/usr/sbin/sendmail -bs', - /* - |-------------------------------------------------------------------------- - | Mail "Pretend" - |-------------------------------------------------------------------------- - | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. - | - */ + /* + |-------------------------------------------------------------------------- + | Mail "Pretend" + |-------------------------------------------------------------------------- + | + | When this option is enabled, e-mail will not actually be sent over the + | web and will instead be written to your application's logs files so + | you may inspect the message. This is great for local development. + | + */ - 'pretend' => false, + 'pretend' => false, ]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 4587758c7e..96b65406ff 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -20,15 +20,19 @@