-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cognito): docs compile and improved (#171)
Improved the readme examples and now they compile and run successfully.
- Loading branch information
1 parent
602972b
commit 466bacc
Showing
2 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ npm i @winglibs/cognito | |
## Usage | ||
|
||
```js | ||
bring cloud; | ||
bring cognito; | ||
|
||
let api = new cloud.Api(); | ||
|
@@ -33,13 +34,17 @@ auth.get("/hello"); | |
### Wing Code | ||
|
||
```js | ||
auth.signUp("[email protected]", "This-is-my-test-99!"); | ||
auth.adminConfirmUser("[email protected]"); | ||
let token = auth.initiateAuth("[email protected]", "This-is-my-test-99!"); | ||
let res = http.get("{api.url}/hello", headers: { | ||
"Authorization": "Bearer {token}" | ||
}); | ||
expect.equal(res.status, 200); | ||
bring expect; | ||
bring http; | ||
test "auth happy path" { | ||
auth.signUp("[email protected]", "This-is-my-test-99!"); | ||
auth.adminConfirmUser("[email protected]"); | ||
let token = auth.initiateAuth("[email protected]", "This-is-my-test-99!"); | ||
let res = http.get("{api.url}/hello", headers: { | ||
"Authorization": "Bearer {token}" | ||
}); | ||
expect.equal(res.status, 200); | ||
} | ||
``` | ||
|
||
### AWS CLI | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters