login: only try to login when not yet logged in; always set camefrom in request
This commit is contained in:
parent
0a2cd32d9c
commit
2598e375bf
2 changed files with 3 additions and 2 deletions
|
|
@ -6,6 +6,7 @@
|
|||
tal:define="principal request/principal/id;
|
||||
baseUrl python:request.URL[-1];
|
||||
camefrom python:request.get('camefrom') or baseUrl;
|
||||
dummy python:request.form.setdefault('camefrom', baseUrl);
|
||||
dummy item/checkAuth">
|
||||
<p style="color: Red"
|
||||
tal:condition="request/error_message|nothing"
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ def validateToken(token, secret=None):
|
|||
class LoginBase:
|
||||
|
||||
def __call__(self):
|
||||
if self.authMethod == 'oidc':
|
||||
if self.isAnonymous and self.authMethod == 'oidc':
|
||||
return self.authOidc()
|
||||
return super(LoginBase, self).__call__()
|
||||
|
||||
def checkAuth(self):
|
||||
if self.authMethod == 'oidc':
|
||||
if self.isAnonymous and self.authMethod == 'oidc':
|
||||
return self.authOidc()
|
||||
|
||||
@Lazy
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue