python_template_server.authentication_handler¶
Authentication handler for the server.
Functions
Generate a new token, hash it, and save the hash to the .env file. |
|
Generate a secure random token. |
|
|
Hash a token string using SHA-256. |
|
Hash a token and save it to the .env file. |
|
Verify a token against the stored hash. |
- python_template_server.authentication_handler.generate_token()[source]¶
Generate a secure random token.
- Return str:
A URL-safe token string
- Return type:
- python_template_server.authentication_handler.hash_token(token)[source]¶
Hash a token string using SHA-256.
- python_template_server.authentication_handler.save_hashed_token(token)[source]¶
Hash a token and save it to the .env file.
- python_template_server.authentication_handler.verify_token(token, hashed_token)[source]¶
Verify a token against the stored hash.
- python_template_server.authentication_handler.generate_new_token()[source]¶
Generate a new token, hash it, and save the hash to the .env file.
This function generates a new secure random token, hashes it using SHA-256, and saves the hashed token to the .env file for future verification.
- Return type: