Update API

This commit is contained in:
RemiZOffAlex
2020-07-03 11:35:08 +03:00
parent 53e2b7aba8
commit 7bb80e690d
7 changed files with 77 additions and 92 deletions

View File

@@ -11,8 +11,8 @@ from . import jsonrpc
from .. import app, lib, models
@jsonrpc.method('login(username=str, password=str)')
def login(username, password):
@jsonrpc.method('login')
def login(username: str, password: str)->bool:
user = models.db_session.query(
models.User
).filter(
@@ -27,4 +27,4 @@ def login(username, password):
raise ValueError
session['logged_in'] = True
session['user_id'] = user.id
return 'ok'
return True