Skip to content

Commit

Permalink
Pass config:autologin=1 to target url
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jul 11, 2024
1 parent fdb9efd commit 291b9ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,24 @@ def login():
identity = {
'username': userid,
'user_infos': {
'displayname': displayname,
'mysoch': True
'mysoch': True,
'displayname': displayname
},
'autologin': True
}
access_token = create_access_token(identity=identity)
target_query.update({'config:tenant': config.get("tenant_header_name", "") + "=" + config.get("tenant_header_value", "")})
target_query.update({'config:autologin': 1})
parts = parts._replace(query=urlencode(target_query))
target_url = urlunparse(parts)
resp = make_response(redirect(target_url))
tenant_header_name = config.get("tenant_header_name", "")
tenant_header_value = config.get("tenant_header_value", "")
if tenant_header_name:
app.logger.debug("Setting header %s=%s" % (tenant_header_name, tenant_header_value))
resp.headers[tenant_header_name] = tenant_header_value
set_access_cookies(resp, access_token)
target_query.update({'config:tenant': config.get("tenant_header_name", "") + "=" + config.get("tenant_header_value", "")})
return resp
else:
target_query.update({'mysoch:unknownidentity': 1})

Expand Down

0 comments on commit 291b9ee

Please sign in to comment.