Commit db592df8 authored by echel0n's avatar echel0n

When updating sub_id, mark config database dirty before saving

parent b162bac4
......@@ -583,6 +583,8 @@ class Core(object):
self.scheduler.add_job(launch_browser, args=[('http', 'https')[sickrage.app.config.general.enable_https],
sickrage.app.config.general.web_host, sickrage.app.config.general.web_port])
self.config.save()
self.log.info("SiCKRAGE :: STARTED")
self.log.info("SiCKRAGE :: APP VERSION:[{}]".format(sickrage.version()))
self.log.info("SiCKRAGE :: CONFIG VERSION:[v{}]".format(self.config.db.version))
......
......@@ -104,17 +104,12 @@ class AccountLinkHandler(BaseHandler, ABC):
class AccountUnlinkHandler(BaseHandler, ABC):
@authenticated
def get(self, *args, **kwargs):
# if not sickrage.app.config.user.sub_id == self.get_current_user().get('sub'):
# return self.redirect("/{}/".format(sickrage.app.config.general.default_page.value))
if not sickrage.app.config.general.server_id or sickrage.app.api.account.unregister_server(sickrage.app.config.general.server_id):
if not sickrage.app.config.general.sso_auth_enabled:
sickrage.app.config.reset_encryption()
sickrage.app.config.general.server_id = ""
sickrage.app.config.user.sub_id = ""
# sickrage.app.api.logout()
del sickrage.app.api.token
sickrage.app.config.general.enable_sickrage_api = False
......
......@@ -55,7 +55,7 @@ class APIBaseHandler(BaseHandler, ABC):
if not sickrage.app.config.user.sub_id:
sickrage.app.config.user.sub_id = decoded_token.get('sub')
sickrage.app.config.save()
sickrage.app.config.save(mark_dirty=True)
if sickrage.app.config.user.sub_id == decoded_token.get('sub'):
if not sickrage.app.config.user.username:
......
......@@ -64,7 +64,7 @@ class LoginHandler(BaseHandler, ABC):
if not sickrage.app.config.user.sub_id:
sickrage.app.config.user.sub_id = decoded_token.get('sub')
sickrage.app.config.save()
sickrage.app.config.save(mark_dirty=True)
if sickrage.app.config.user.sub_id == decoded_token.get('sub'):
if not sickrage.app.config.user.username:
......@@ -137,7 +137,7 @@ class LoginHandler(BaseHandler, ABC):
if not sickrage.app.config.user.sub_id:
sickrage.app.config.user.sub_id = decoded_token.get('sub')
sickrage.app.config.save()
sickrage.app.config.save(mark_dirty=True)
if sickrage.app.config.user.sub_id == decoded_token.get('sub'):
if not sickrage.app.config.user.username:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment