Skip to content

Commit

Permalink
Port generic oauth support
Browse files Browse the repository at this point in the history
brought over the pr [2211](janeczku/calibre-web#2211) from the parent project to add generic oauth implementation
  • Loading branch information
MattyIceee committed Nov 16, 2024
1 parent fc18887 commit ef58986
Show file tree
Hide file tree
Showing 6 changed files with 3,505 additions and 0 deletions.
10 changes: 10 additions & 0 deletions root/app/calibre-web/cps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,16 @@ def _configuration_oauth_helper(to_save):
{"oauth_client_id": to_save["config_" + str(element['id']) + "_oauth_client_id"],
"oauth_client_secret": to_save["config_" + str(element['id']) + "_oauth_client_secret"],
"active": element["active"]})
if element['id'] == 3:
ub.session.query(ub.OAuthProvider).filter(ub.OAuthProvider.id == element['id']).update({
"oauth_base_url": to_save["config_" + str(element['id']) + "_oauth_base_url"],
"oauth_auth_url": to_save["config_" + str(element['id']) + "_oauth_auth_url"],
"oauth_token_url": to_save["config_" + str(element['id']) + "_oauth_token_url"],
"username_mapper": to_save["config_" + str(element['id']) + "_username_mapper"],
"email_mapper": to_save["config_" + str(element['id']) + "_email_mapper"],
"login_button": to_save["config_" + str(element['id']) + "_login_button"],
"scope": to_save["config_" + str(element['id']) + "_scope"],
})
return reboot_required


Expand Down
Loading

0 comments on commit ef58986

Please sign in to comment.