auth-vir 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ export declare class FrontendAuthClient<AssumedUserParams extends JsonCompatible
33
33
  getCurrentCsrfToken(): Promise<string | undefined>;
34
34
  /** @returns Whether the user assuming succeeded or not. */
35
35
  assumeUser(assumedUserParams: Readonly<AssumedUserParams>): Promise<boolean>;
36
+ /** Gets the assumed user params stored in local storage, if any. */
36
37
  getAssumedUser(): AssumedUserParams | undefined;
37
38
  /**
38
39
  * Creates a `RequestInit` object for the `fetch` API. If you have other request init options,
@@ -33,6 +33,7 @@ export class FrontendAuthClient {
33
33
  (this.config.overrides?.localStorage || globalThis.localStorage).setItem(this.config.overrides?.assumedUserHeaderName || AuthHeaderName.AssumedUser, JSON.stringify(assumedUserParams));
34
34
  return true;
35
35
  }
36
+ /** Gets the assumed user params stored in local storage, if any. */
36
37
  getAssumedUser() {
37
38
  const rawValue = (this.config.overrides?.localStorage || globalThis.localStorage).getItem(this.config.overrides?.assumedUserHeaderName || AuthHeaderName.AssumedUser);
38
39
  if (!rawValue) {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth-client/backend-auth.client.js';
2
+ export * from './auth-client/frontend-auth.client.js';
2
3
  export * from './auth.js';
3
4
  export * from './cookie.js';
4
5
  export * from './csrf-token.js';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth-client/backend-auth.client.js';
2
+ export * from './auth-client/frontend-auth.client.js';
2
3
  export * from './auth.js';
3
4
  export * from './cookie.js';
4
5
  export * from './csrf-token.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth-vir",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Auth made easy and secure via JWT cookies, CSRF tokens, and password hashing helpers.",
5
5
  "keywords": [
6
6
  "auth",
@@ -74,6 +74,7 @@ export class FrontendAuthClient<AssumedUserParams extends JsonCompatibleObject =
74
74
  return true;
75
75
  }
76
76
 
77
+ /** Gets the assumed user params stored in local storage, if any. */
77
78
  public getAssumedUser(): AssumedUserParams | undefined {
78
79
  const rawValue = (this.config.overrides?.localStorage || globalThis.localStorage).getItem(
79
80
  this.config.overrides?.assumedUserHeaderName || AuthHeaderName.AssumedUser,
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth-client/backend-auth.client.js';
2
+ export * from './auth-client/frontend-auth.client.js';
2
3
  export * from './auth.js';
3
4
  export * from './cookie.js';
4
5
  export * from './csrf-token.js';