1
Fork 0
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:
Steffo 2020-07-23 01:27:46 +02:00
parent c41ae6b116
commit 4f5199c88f

View file

@ -91,9 +91,12 @@ class ApiAuthLoginOsuStar(rca.ApiStar):
raise rcae.ForbiddenError("Unknown osu! account") raise rcae.ForbiddenError("Unknown osu! account")
user = osu.user 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) return token.json()
await data.session_commit() else:
raise rcae.ForbiddenError("Account linked successfully; cannot use this account to generate a Royalnet"
return token.json() " login token, as osu! login is currently disabled on this Royalnet instance.")