Skip to content

Commit cef7e4a

Browse files
authored
Fixed authentication.md
Changed 'self.request' to 'self.context.request'
1 parent 5cff880 commit cef7e4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/tutorial/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AuthBearer(HttpBearer):
2323
class MyController:
2424
@route.get("/bearer", auth=AuthBearer())
2525
def bearer(self):
26-
return {"token": self.request.auth}
26+
return {"token": self.context.request.auth}
2727

2828
```
2929

@@ -73,7 +73,7 @@ class AuthBearer(AsyncHttpBearer):
7373
class MyController:
7474
@route.get("/bearer", auth=AuthBearer())
7575
async def bearer(self):
76-
return {"token": self.request.auth}
76+
return {"token": self.context.request.auth}
7777

7878
```
7979
In example above, we changed `HttpBearer` to `AsyncHttpBearer` and changed bearer to `async` endpoint.

0 commit comments

Comments
 (0)