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
|
from os import environ as envar
|
||||||
|
|
||||||
VAR_USERNAME = "TD_USERNAME"
|
VAR_USERNAME = "TD_USERNAME"
|
||||||
|
VAR_USERPASS = "TD_USERPASS"
|
||||||
|
|
||||||
|
|
||||||
class User:
|
class User:
|
||||||
"""user informations"""
|
"""user informations"""
|
||||||
|
|
||||||
|
# user name
|
||||||
name = envar[VAR_USERNAME] if VAR_USERNAME in envar else None
|
name = envar[VAR_USERNAME] if VAR_USERNAME in envar else None
|
||||||
|
|
||||||
|
# user password
|
||||||
|
password = envar[VAR_USERPASS]
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""app configuration"""
|
"""app configuration"""
|
||||||
|
|
||||||
# App name
|
# app name
|
||||||
name = "txtdiary"
|
name = "txtdiary"
|
||||||
|
|
||||||
# App description
|
# app description
|
||||||
description = "Personal diary page"
|
description = "Personal diary page"
|
||||||
|
|
||||||
# User
|
# user
|
||||||
user = User
|
user = User
|
||||||
|
|
|
@ -19,4 +19,6 @@ def login() -> str:
|
||||||
@router.route(f"/{name}", methods=["POST"])
|
@router.route(f"/{name}", methods=["POST"])
|
||||||
def check() -> Response:
|
def check() -> Response:
|
||||||
"""Login logic"""
|
"""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