From 466bacc0b127f9aeb0aee3496861c20e54a88d12 Mon Sep 17 00:00:00 2001 From: Uri Bar <106860404+staycoolcall911@users.noreply.github.com> Date: Mon, 1 Apr 2024 15:36:28 +0300 Subject: [PATCH] fix(cognito): docs compile and improved (#171) Improved the readme examples and now they compile and run successfully. --- cognito/README.md | 19 ++++++++++++------- cognito/package.json | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cognito/README.md b/cognito/README.md index 6cf168cd..68a3cac1 100644 --- a/cognito/README.md +++ b/cognito/README.md @@ -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("fakeId@monada.co", "This-is-my-test-99!"); -auth.adminConfirmUser("fakeId@monada.co"); -let token = auth.initiateAuth("fakeId@monada.co", "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("fakeId@wing.cloud", "This-is-my-test-99!"); + auth.adminConfirmUser("fakeId@wing.cloud"); + let token = auth.initiateAuth("fakeId@wing.cloud", "This-is-my-test-99!"); + let res = http.get("{api.url}/hello", headers: { + "Authorization": "Bearer {token}" + }); + expect.equal(res.status, 200); +} ``` ### AWS CLI diff --git a/cognito/package.json b/cognito/package.json index dc79501d..95b8bc69 100644 --- a/cognito/package.json +++ b/cognito/package.json @@ -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",