Skip to content

Commit

Permalink
Translate sentence. Different response for logout
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea.decastri committed Nov 19, 2018
1 parent 2b7292e commit 420ab97
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion app/Http/Controllers/JwtAuth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,11 @@ public function logout(Request $request){

auth()->logout(true, true);

return response([], 200);
if($request->ajax() || $request->wantsJson()){
response([], 200);
} else {
return redirect('loginForm');
}
}

private function getUserSession(Request $request){
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/en/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'label-login' => 'Login',
'label-registration-success' => 'Successful registration! Check your mail box to verify your e-mail address',
'label-account-actived' => 'Account successfully activated',
'label-logout' => 'Logout'
'label-logout' => 'Logout',
'label-logged' => 'is logged'

];
3 changes: 2 additions & 1 deletion resources/lang/it/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
'label-login' => 'Accedi',
'label-registration-success' => 'Registrazione avvenuta con successo! Accedi alla tua casella di posta per verificare la tua e-mail',
'label-account-actived' => 'Account attivato correttamente',
'label-logout' => 'Esci'
'label-logout' => 'Esci',
'label-logged' => 'sei autenticato'
];
2 changes: 1 addition & 1 deletion resources/views/auth/logged.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@extends('base')

@section('content')
<h4 class="text-center mt-5">{{ session()->get('user')->name }} sei già loggato</h4>
<h4 class="text-center mt-5">{{ session()->get('user')->name }} @lang('auth.label-logged')</h4>
@endsection

0 comments on commit 420ab97

Please sign in to comment.