romuro-pauliv / IPT-Token

The module will generate a token with a simple @generate_token() decorator set in your route depending on the status code you enter. Then request of this token can be done by @required_token() defined in routes that require authentication.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPT Token

The IPT Token module is intended to be an extension to your Flask applications. The module will generate a token with a simple @generate_token() decorator set in your route depending on the status code you enter. Then request of this token can be done by @required_token() defined in routes that require authentication.

@bp.route("/login", methods=["POST"])
@generate_token(200)
def sign_in() -> tuple[..., int]:
    return login_funcion(...)


@bp.route("/my-feed", methods=["POST"])
@required_token()
def my_feed() -> tuple[..., int]:
    return return_my_feed()

Summary


About

The module will generate a token with a simple @generate_token() decorator set in your route depending on the status code you enter. Then request of this token can be done by @required_token() defined in routes that require authentication.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%