Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge queue: embarking main (602972b) and #171 together #173

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions cognito/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ npm i @winglibs/cognito
## Usage

```js
bring cloud;
bring cognito;

let api = new cloud.Api();
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cognito/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/cognito",
"version": "0.0.4",
"version": "0.0.5",
"description": "A wing library to work with AWS Cognito",
"author": {
"name": "Elad Cohen",
Expand Down
Loading