add logout route
This commit is contained in:
@@ -57,6 +57,15 @@ def create_session(user_id, temporary=False):
|
||||
'expires_at': int(time.time()) + (expires_days * 24 * 60 * 60),
|
||||
})
|
||||
|
||||
def revoke_session(user_id):
|
||||
if not is_logged_in():
|
||||
return
|
||||
sess = Sessions.find({'key': session['pyrom_session_key']})
|
||||
if not sess:
|
||||
return
|
||||
sess.delete()
|
||||
session.clear()
|
||||
|
||||
def parse_username(username: str) -> Tuple[str, str]:
|
||||
"""first is the unmodified name/display name, second is username"""
|
||||
if len(username) < 3:
|
||||
|
||||
Reference in New Issue
Block a user