mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Permetti di disabilitare il login con osu
This commit is contained in:
parent
c41ae6b116
commit
4f5199c88f
1 changed files with 8 additions and 5 deletions
|
@ -91,9 +91,12 @@ class ApiAuthLoginOsuStar(rca.ApiStar):
|
|||
raise rcae.ForbiddenError("Unknown osu! account")
|
||||
user = osu.user
|
||||
|
||||
token: rbt.Token = TokenT.generate(alchemy=self.alchemy, user=user, expiration_delta=datetime.timedelta(days=7))
|
||||
if self.config["osu"]["login"]["enabled"]:
|
||||
token: rbt.Token = TokenT.generate(alchemy=self.alchemy, user=user, expiration_delta=datetime.timedelta(days=7))
|
||||
data.session.add(token)
|
||||
await data.session_commit()
|
||||
|
||||
data.session.add(token)
|
||||
await data.session_commit()
|
||||
|
||||
return token.json()
|
||||
return token.json()
|
||||
else:
|
||||
raise rcae.ForbiddenError("Account linked successfully; cannot use this account to generate a Royalnet"
|
||||
" login token, as osu! login is currently disabled on this Royalnet instance.")
|
Loading…
Reference in a new issue