@@ -200,11 +200,11 @@ def user_claims_loader(self, callback):
200
200
access token when :func:`~flask_jwt_extended.create_access_token` is
201
201
called. By default, no extra user claims will be added to the JWT.
202
202
203
- The callback function must be a function that takes only one argument,
203
+ *HINT*: The callback function must be a function that takes only ** one** argument,
204
204
which is the object passed into
205
205
:func:`~flask_jwt_extended.create_access_token`, and returns the custom
206
206
claims you want included in the access tokens. This returned claims
207
- must be JSON serializable.
207
+ must be * JSON serializable* .
208
208
"""
209
209
self ._user_claims_callback = callback
210
210
return callback
@@ -218,11 +218,11 @@ def user_identity_loader(self, callback):
218
218
return the unmodified object that is passed in as the `identity` kwarg
219
219
to the above functions.
220
220
221
- The callback function must be a function that takes only one argument,
221
+ *HINT*: The callback function must be a function that takes only ** one** argument,
222
222
which is the object passed into
223
223
:func:`~flask_jwt_extended.create_access_token` or
224
224
:func:`~flask_jwt_extended.create_refresh_token`, and returns the
225
- JSON serializable identity of this token.
225
+ * JSON serializable* identity of this token.
226
226
"""
227
227
self ._user_identity_callback = callback
228
228
return callback
@@ -235,8 +235,8 @@ def expired_token_loader(self, callback):
235
235
236
236
{"msg": "Token has expired"}
237
237
238
- The callback must be a function that takes zero arguments, and returns
239
- a Flask response.
238
+ *HINT*: The callback must be a function that takes ** zero** arguments, and returns
239
+ a * Flask response* .
240
240
"""
241
241
self ._expired_token_callback = callback
242
242
return callback
@@ -249,9 +249,9 @@ def invalid_token_loader(self, callback):
249
249
250
250
{"msg": "<error description>"}
251
251
252
- The callback must be a function that takes only one argument, which is
252
+ *HINT*: The callback must be a function that takes only ** one** argument, which is
253
253
a string which contains the reason why a token is invalid, and returns
254
- a Flask response.
254
+ a * Flask response* .
255
255
"""
256
256
self ._invalid_token_callback = callback
257
257
return callback
@@ -264,9 +264,9 @@ def unauthorized_loader(self, callback):
264
264
265
265
{"msg": "<error description>"}
266
266
267
- The callback must be a function that takes only one argument, which is
267
+ *HINT*: The callback must be a function that takes only ** one** argument, which is
268
268
a string which contains the reason why a JWT could not be found, and
269
- returns a Flask response.
269
+ returns a * Flask response* .
270
270
"""
271
271
self ._unauthorized_callback = callback
272
272
return callback
@@ -280,8 +280,8 @@ def needs_fresh_token_loader(self, callback):
280
280
281
281
{"msg": "Fresh token required"}
282
282
283
- The callback must be a function that takes no arguments, and returns
284
- a Flask response.
283
+ *HINT*: The callback must be a function that takes **no** arguments, and returns
284
+ a * Flask response* .
285
285
"""
286
286
self ._needs_fresh_token_callback = callback
287
287
return callback
@@ -294,8 +294,8 @@ def revoked_token_loader(self, callback):
294
294
295
295
{"msg": "Token has been revoked"}
296
296
297
- The callback must be a function that takes no arguments, and returns
298
- a Flask response.
297
+ *HINT*: The callback must be a function that takes **no** arguments, and returns
298
+ a * Flask response* .
299
299
"""
300
300
self ._revoked_token_callback = callback
301
301
return callback
@@ -306,9 +306,9 @@ def user_loader_callback_loader(self, callback):
306
306
automatically load an object when a protected endpoint is accessed.
307
307
By default this is not used.
308
308
309
- The callback must take one argument which is the identity JWT accessing
310
- the protected endpoint, and it must return any object (which can then
311
- be accessed via the :attr:`~flask_jwt_extended.current_user` LocalProxy
309
+ *HINT*: The callback must take ** one** argument which is the identity JWT
310
+ accessing the protected endpoint, and it must return any object (which can
311
+ then be accessed via the :attr:`~flask_jwt_extended.current_user` LocalProxy
312
312
in the protected endpoint), or `None` in the case of a user not being
313
313
able to be loaded for any reason. If this callback function returns
314
314
`None`, the :meth:`~flask_jwt_extended.JWTManager.user_loader_error_loader`
@@ -327,8 +327,8 @@ def user_loader_error_loader(self, callback):
327
327
328
328
{"msg": "Error loading the user <identity>"}
329
329
330
- The callback must be a function that takes one argument, which is the
331
- identity of the user who failed to load, and must return a Flask response.
330
+ *HINT*: The callback must be a function that takes ** one** argument, which is the
331
+ identity of the user who failed to load, and must return a * Flask response* .
332
332
"""
333
333
self ._user_loader_error_callback = callback
334
334
return callback
@@ -339,9 +339,9 @@ def token_in_blacklist_loader(self, callback):
339
339
a protected endpoint is accessed and will check if the JWT has been
340
340
been revoked. By default, this callback is not used.
341
341
342
- The callback must be a function that takes one argument, which is the
343
- decoded JWT (python dictionary), and returns `True` if the token
344
- has been blacklisted (or is otherwise considered revoked), or `False`
342
+ *HINT*: The callback must be a function that takes ** one** argument, which is the
343
+ decoded JWT (python dictionary), and returns * `True`* if the token
344
+ has been blacklisted (or is otherwise considered revoked), or * `False`*
345
345
otherwise.
346
346
"""
347
347
self ._token_in_blacklist_callback = callback
@@ -356,9 +356,9 @@ def claims_verification_loader(self, callback):
356
356
:meth:`~flask_jwt_extended.JWTManager.claims_verification_failed_loader`
357
357
decorator.
358
358
359
- This callback must be a function that takes one argument, which is the
360
- custom claims (python dict) present in the JWT, and returns `True` if the
361
- claims are valid, or `False` otherwise.
359
+ *HINT*: This callback must be a function that takes ** one** argument, which is the
360
+ custom claims (python dict) present in the JWT, and returns * `True`* if the
361
+ claims are valid, or * `False`* otherwise.
362
362
"""
363
363
self ._claims_verification_callback = callback
364
364
return callback
@@ -372,8 +372,8 @@ def claims_verification_failed_loader(self, callback):
372
372
373
373
{"msg": "User claims verification failed"}
374
374
375
- This callback must be a function that takes no arguments, and returns
376
- a Flask response.
375
+ *HINT*: This callback must be a function that takes **no** arguments, and returns
376
+ a * Flask response* .
377
377
"""
378
378
self ._verify_claims_failed_callback = callback
379
379
return callback
0 commit comments