MCPcopy Create free account
hub / github.com/clockworknowledge/menome_processor / create_access_token

Function create_access_token

app/routers/processing.py:39–47  ·  view source on GitHub ↗
(data: dict, expires_delta: timedelta = None)

Source from the content-addressed store, hash-verified

37
38# Create an access token
39def create_access_token(data: dict, expires_delta: timedelta = None):
40 to_encode = data.copy()
41 if expires_delta:
42 expire = datetime.utcnow() + expires_delta
43 else:
44 expire = datetime.utcnow() + timedelta(minutes=15)
45 to_encode.update({"exp": expire})
46 encoded_jwt = jwt.encode(to_encode, AppConfig.SECRET_KEY, algorithm=AppConfig.ALGORITHM)
47 return encoded_jwt
48
49# Authenticate a user (This function might need the get_user_from_db function, which should be imported from user_management.py)
50def authenticate_user(username: str, password: str):

Callers 1

login_for_access_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected