Beispiel #1
0
def auth(callback: Callable, request: request, admin: bool = True, id_user: bool = False) -> tuple:
	authentication = Authentication(admin)
	if (authentication.is_authenticated(request)):
		return callback(authentication.get_id_user()) if id_user else callback()
	else:
		return Response(ResponseType.INVALID_CREDENTIALS).message()