feat: add limited visitor tokens
This commit is contained in:
@@ -24,7 +24,8 @@ async def build_request_context(
|
||||
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Unauthorized")
|
||||
try:
|
||||
context = _authenticator().authenticate(credentials.credentials)
|
||||
context = await IdentityService().resolve(context)
|
||||
if "visitor" not in context.roles:
|
||||
context = await IdentityService().resolve(context)
|
||||
except Exception as exc:
|
||||
from app.core.errors import UnauthorizedAgentError
|
||||
|
||||
|
||||
Reference in New Issue
Block a user