Skip to content

Commit

Permalink
feat: OPTIC-1480: Adding env variable redirect on logout (#7086)
Browse files Browse the repository at this point in the history
Co-authored-by: Wesley Lima <[email protected]>
  • Loading branch information
wesleylima and Wesley Lima authored Feb 14, 2025
1 parent cbf53fd commit 73f214c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,3 +809,5 @@ def collect_versions_dummy(**kwargs):
'ignore_name': '0002_auto_20210304_1457',
'sql-analyser': 'postgresql',
}

LOGOUT_REDIRECT_URL = get_env('LOGOUT_REDIRECT_URL', None)
4 changes: 4 additions & 0 deletions label_studio/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
@login_required
def logout(request):
auth.logout(request)

if settings.LOGOUT_REDIRECT_URL:
return redirect(settings.LOGOUT_REDIRECT_URL)

if settings.HOSTNAME:
redirect_url = settings.HOSTNAME
if not redirect_url.endswith('/'):
Expand Down

0 comments on commit 73f214c

Please sign in to comment.