Skip to content

Commit

Permalink
fix(oauth): oauth header commit 丢失 (#646)
Browse files Browse the repository at this point in the history
Co-authored-by: nor <[email protected]>
  • Loading branch information
PterX and nor authored Apr 17, 2024
1 parent 0c072c6 commit b679c5d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions web/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,28 @@ def redirect_to_login(errmsg=''):
img_link=img_link,
err_msg=errmsg)

user_name = request.headers.get("Remote-User")
log.info("from: %s" % request.access_route)
oidc = Config().get_config('app').get('oidc_enable')
if oidc and user_name:
GoPage = request.form.get('next') or ""
if GoPage.startswith('/'):
GoPage = GoPage[1:]
user_info = ProUser().get_user(user_name)
if user_info:
if current_user.is_authenticated:
username = current_user.username
if user_info.username != username:
login_user(user_info)
log.info("redirect : echostr= %s" % "here")
# 登录成功
return redirect_to_navigation()
else:
login_user(user_info)
log.info("redirect : echostr= %s" % "here")
# 登录成功
return redirect_to_navigation()

# 登录认证
if request.method == 'GET':
GoPage = request.args.get("next") or ""
Expand Down

0 comments on commit b679c5d

Please sign in to comment.