diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-07-27 07:17:41 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-07-27 07:17:41 +0200 |
commit | 508dac38bd764cd44d2a8a4c319386f2478f527b (patch) | |
tree | 42394f63650b05b66efca50a5f02c9a45d1b9e70 /lib | |
parent | f5091f1081551bb27c4dcf87cf9c514cc53c400f (diff) |
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 8dff817..cec4a92 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -3118,10 +3118,17 @@ sub startup { if ( $self->is_user_authenticated ) { return 1; } - $self->render( - 'login', - redirect_to => $self->req->url, - from => 'auth_required' + $self->respond_to( + json => { + json => { error => 'authentication required' }, + status => 401 + }, + any => { + template => 'login', + status => 401, + redirect_to => $self->req->url, + from => 'auth_required' + } ); return undef; } |