Skip to content

Commit 018b928

Browse files
committed
Update _jwt_routes.py
1 parent 17ad0e1 commit 018b928

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

flask_jwt_router/_jwt_routes.py

+16-2
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,22 @@ def set_exp(self, **kwargs) -> None:
309309

310310
def create_token(self, **kwargs) -> str:
311311
"""
312-
:param kwargs:
313-
:return: str
312+
Generates a token using the provided configuration.
313+
314+
Keyword Args:
315+
entity_type (str, optional): Deprecated. The old name for 'table_name'.
316+
If provided, it will trigger a warning and will be used as 'table_name'.
317+
table_name (str): The name of the table/entity for which the token is being generated.
318+
This argument is required.
319+
320+
Returns:
321+
str: The generated token.
322+
323+
Raises:
324+
KeyError: If the 'table_name' keyword argument is missing.
325+
326+
Warnings:
327+
DeprecationWarning: If 'entity_type' is used instead of 'table_name'.
314328
"""
315329
if 'entity_type' in kwargs:
316330
warn(("'entity_type' argument name has been deprecated and will be replaced"

0 commit comments

Comments
 (0)