Esempio n. 1
0
async def get_account(
        login_bearer: HTTPAuthorizationCredentials = Security(login_bearer)):
    try:
        return CitybikeAccount(login_bearer.credentials)
    except LoginError:
        raise HTTPException(status_code=401, detail="Login invalid")
Esempio n. 2
0
def get_token(login: Login) -> str:
    try:
        acc = CitybikeAccount(login)
        return acc.get_token()
    except LoginError:
        raise HTTPException(status_code=401, detail="Login invalid")