Esempio n. 1
0
async def password_reset(request: Request):
    error = request.cookies.get("error", None)
    message = request.cookies.get("message", None)
    if error:
        return template('pages/account/change-password.html', {'request': request, "error":json.loads(error)})
    elif message:
        return template('pages/account/change-password.html', {'request': request, "message":json.loads(message)})
    return template('pages/account/change-password.html', {'request': request})
Esempio n. 2
0
async def register(request: Request, user: dict = Depends(ViewMixin.get_user)):
    if user:
        return RedirectResponse("/", status_code=302)
    error = request.cookies.get("error")
    if error:
        return template('pages/account/register.html', {
            "request": request,
            "error": json.loads(error)
        })
    return template('pages/account/register.html', {"request": request})
Esempio n. 3
0
async def index(request: Request,
                user: dict = Depends(ViewMixin.get_user_details)):
    if user:
        return template("pages/base/base.html", {
            "request": request,
            "user": user
        })
    return template("pages/account/login.html", {
        "request": request,
        "user": user
    },
                    status_code=302)
Esempio n. 4
0
async def service(request: Request, user: dict = Depends(ViewMixin.get_user)):
    async with AsyncClient() as client:
        data = await client.get(f"{API_WEBSITE_URL}/service")
    if data.status_code == 200:
        return template('pages/service/service.html', {
            'request': request,
            "user": user,
            "service": data.json()
        })
    return template('pages/service/service.html', {
        'request': request,
        "user": user
    })
Esempio n. 5
0
async def login(request: Request):
    error = request.cookies.get("error")
    message = request.cookies.get("message")
    if error:
        return template('pages/account/login.html', {
            "request": request,
            "error": json.loads(error)
        })
    elif message:
        return template('pages/account/login.html', {
            "request": request,
            "message": json.loads(message)
        })
    return template('pages/account/login.html', {"request": request})
Esempio n. 6
0
async def plan(request: Request, user: dict = Depends(ViewMixin.get_user)):
    if user:
        return template('pages/plan/plan.html', {
            'request': request,
            "user": user
        })
    return RedirectResponse("/", status_code=302)
Esempio n. 7
0
async def error_page(request: Request,
                     user: dict = Depends(ViewMixin.get_user)):
    return template("pages/generalView/404.html", {
        "request": request,
        "user": user
    })
Esempio n. 8
0
async def service(request: Request,
                  user: dict = Depends(ViewMixin.get_user_details)):
    return template('pages/generalView/contact.html', {
        'request': request,
        "user": user
    })
Esempio n. 9
0
async def settings(request: Request, user: dict = Depends(ViewMixin.get_user)):
    return template('pages/account/settings.html', {
        'request': request,
        "user": user
    })
Esempio n. 10
0
async def changePassword(request: Request, userId:str):
    error = request.cookies.get("error")
    if error:
       return template('pages/account/password-reset.html', {'request': request, "userId":userId, "error":json.loads(error)})
    return template('pages/account/password-reset.html', {'request': request, "userId": userId})