View jwt_token_handling.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials | |
from fastapi import Request, HTTPException, status, Depends | |
from passlib.context import CryptContext | |
from jose.exceptions import JWTError | |
from jose import jwt | |
from sqlalchemy import select | |
from db.base import database |
View gist:702077ffb29e29177693c9905c07bf9b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list_node_to_list(l): | |
result = [] | |
list_node = l | |
while list_node: | |
result.append(list_node.val) | |
list_node = list_node.next | |
return result | |
def list_to_list_node(l): | |
li = None |