reset admin keys cli command

This commit is contained in:
rimu 2024-02-28 19:54:05 +13:00
parent abed85a1e3
commit ee806ba06c

View file

@ -59,6 +59,15 @@ def register(app):
print(private_key)
print(public_key)
@app.cli.command("admin-keys")
def keys():
private_key, public_key = RsaKeys.generate_keypair()
u: User = User.query.get(1)
u.private_key = private_key
u.public_key = public_key
db.session.commit()
print('Admin keys have been reset')
@app.cli.command("init-db")
def init_db():
with app.app_context():