add simple Unauthorized view

This commit is contained in:
Helmut Merz 2026-05-01 07:41:31 +02:00
parent ee2ed32767
commit 3a5b33f529

View file

@ -54,6 +54,14 @@ class LoginPageSelect(LoginPage):
return 'document.cookie=`loops_auth_method=${this.value}; path=/; expires=Sun, 31 Jan 2027 12:00:00 UTC%s`' % (domain and f'; domain={domain}' or '') return 'document.cookie=`loops_auth_method=${this.value}; path=/; expires=Sun, 31 Jan 2027 12:00:00 UTC%s`' % (domain and f'; domain={domain}' or '')
class Unauthorized(LoginPage):
def __call__(self):
print(f'*** unauthorized: user = {self.request.principal.id}, authMethod = {self.authMethod}')
return "Unauthorized"
#return super(Unauthorized, self).__call__()
def getConfigAuthMethod(): def getConfigAuthMethod():
return getattr(config, 'authentication_method', 'legacy') return getattr(config, 'authentication_method', 'legacy')