Skip to content

Commit f4fecc2

Browse files
committed
chore: update readme and remove .only from tests
1 parent 582f818 commit f4fecc2

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

lib/main.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as types from "./types";
44
import * as utils from "./utils";
55
import * as sessionManager from "./sessionManager";
66

7-
describe.only("index exports", () => {
7+
describe("index exports", () => {
88
it("should export everything from types", () => {
99
Object.keys(types).forEach((key) => {
1010
expect(index).toHaveProperty(key);

lib/utils/extractAuthResults.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, it, expect } from "vitest";
22
import { extractAuthResults } from "./extractAuthResults";
33

44
describe("extractAuthResults", () => {
5-
it.only("should encode a string to base64 URL safe format", () => {
5+
it("should encode a string to base64 URL safe format", () => {
66
const result = extractAuthResults(
77
"https://gijchalnbihhgelejnhpopfimempmlel.chromiumapp.org/?access_token=someaccesstokenvalue&expires_in=86400&id_token=someidtoken&scope=email%20profile%20openid%20offline&state=ABCDE1234&token_type=bearer",
88
);
@@ -13,7 +13,7 @@ describe("extractAuthResults", () => {
1313
});
1414
});
1515

16-
it.only("should encode a string to base64 URL safe format", () => {
16+
it("should encode a string to base64 URL safe format", () => {
1717
const result = extractAuthResults(
1818
"https://gijchalnbihhgelejnhpopfimempmlel.chromiumapp.org/?access_token=someaccesstokenvalue&id_token=someidtoken&scope=email%20profile%20openid%20offline&state=ABCDE1234&token_type=bearer",
1919
);

lib/utils/generateAuthUrl.test.ts

-20
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,4 @@ describe("generateAuthUrl", () => {
9393
result.url.searchParams.delete("state");
9494
expect(result.url.toString()).toBe(expectedUrl);
9595
});
96-
97-
it("should handle default responseType if not provided", () => {
98-
const domain = "https://auth.example.com";
99-
const options: LoginOptions = {
100-
clientId: "client123",
101-
scope: [Scopes.openid, Scopes.profile, Scopes.offline_access],
102-
redirectURL: "https://example2.com",
103-
prompt: "create",
104-
state: "state123",
105-
};
106-
const expectedUrl =
107-
"https://auth.example.com/oauth2/auth?client_id=client123&response_type=code&start_page=login&redirect_uri=https%3A%2F%2Fexample2.com&scope=openid+profile+offline_access&prompt=create&state=state123";
108-
109-
const result = generateAuthUrl(domain, IssuerRouteTypes.login, options);
110-
const nonce = result.url.searchParams.get("nonce");
111-
expect(nonce).not.toBeNull();
112-
expect(nonce!.length).toBe(16);
113-
result.url.searchParams.delete("nonce");
114-
expect(result.url.toString()).toBe(expectedUrl);
115-
});
11696
});

readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ pnpm install @kinde/js-utils
2727

2828
`generateAuthUrl` - builds a authentication URL to redirect users to start auth flow
2929

30+
`extractAuthResults` - Extracts tokens and expiry from implcit flow response
31+
32+
`generateRandomString` - Generates a random sring of a defined length
33+
3034
### Session Managers
3135

3236
exports `storageSettings` which can be used to configure the storage methods.
@@ -38,8 +42,12 @@ exports `storageSettings` which can be used to configure the storage methods.
3842
}
3943
```
4044

45+
#### Session storage types.
46+
4147
`MemoryStorage` - This holds the data in a simple memory store
4248

49+
`ChromeStore` - This holds the data in chrome.store.local for use with Google Chrome extensions.
50+
4351
## Kinde documentation
4452

4553
[Kinde Documentation](https://kinde.com/docs/) - Explore the Kinde docs

0 commit comments

Comments
 (0)