wip: add password in configuration
This commit is contained in:
parent
236fd36219
commit
3930abc6f2
2 changed files with 11 additions and 4 deletions
|
@ -1,22 +1,27 @@
|
|||
from os import environ as envar
|
||||
|
||||
VAR_USERNAME = "TD_USERNAME"
|
||||
VAR_USERPASS = "TD_USERPASS"
|
||||
|
||||
|
||||
class User:
|
||||
"""user informations"""
|
||||
|
||||
# user name
|
||||
name = envar[VAR_USERNAME] if VAR_USERNAME in envar else None
|
||||
|
||||
# user password
|
||||
password = envar[VAR_USERPASS]
|
||||
|
||||
|
||||
class Config:
|
||||
"""app configuration"""
|
||||
|
||||
# App name
|
||||
# app name
|
||||
name = "txtdiary"
|
||||
|
||||
# App description
|
||||
# app description
|
||||
description = "Personal diary page"
|
||||
|
||||
# User
|
||||
# user
|
||||
user = User
|
||||
|
|
|
@ -19,4 +19,6 @@ def login() -> str:
|
|||
@router.route(f"/{name}", methods=["POST"])
|
||||
def check() -> Response:
|
||||
"""Login logic"""
|
||||
return jsonify("{}")
|
||||
# TODO: Check password with the configuration
|
||||
# TODO: Store a cookie
|
||||
return jsonify({"pass": Config.user.password})
|
||||
|
|
Loading…
Reference in a new issue