Skip to content

Commit

Permalink
Merge pull request #27 from jartaud/master
Browse files Browse the repository at this point in the history
Translation support ready
  • Loading branch information
freekmurze authored Jan 11, 2021
2 parents 94b6202 + e31161d commit 0aa96b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/WelcomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function savePassword(Request $request, User $user)

protected function sendPasswordSavedResponse(): Response
{
return redirect()->to($this->redirectPath())->with('status', 'Welcome! You are now logged in!');
return redirect()->to($this->redirectPath())->with('status', __('Welcome! You are now logged in!'));
}

protected function rules()
Expand Down
8 changes: 4 additions & 4 deletions src/WelcomesNewUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ class WelcomesNewUsers
public function handle($request, Closure $next)
{
if (! $request->hasValidSignature()) {
abort(Response::HTTP_FORBIDDEN, 'The welcome link does not have a valid signature or is expired.');
abort(Response::HTTP_FORBIDDEN, __('The welcome link does not have a valid signature or is expired.'));
}

if (! $request->user) {
abort(Response::HTTP_FORBIDDEN, 'Could not find a user to be welcomed.');
abort(Response::HTTP_FORBIDDEN, __('Could not find a user to be welcomed.'));
}

if (is_null($request->user->welcome_valid_until)) {
return abort(Response::HTTP_FORBIDDEN, 'The welcome link has already been used.');
return abort(Response::HTTP_FORBIDDEN, __('The welcome link has already been used.'));
}

if (Carbon::create($request->user->welcome_valid_until)->isPast()) {
return abort(Response::HTTP_FORBIDDEN, 'The welcome link has expired.');
return abort(Response::HTTP_FORBIDDEN, __('The welcome link has expired.'));
}

return $next($request);
Expand Down

0 comments on commit 0aa96b3

Please sign in to comment.