@authgate/browser 0.5.0 → 0.5.2
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.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,10 @@ export type CurrentUser = {
|
|
|
84
84
|
id: string;
|
|
85
85
|
email: string;
|
|
86
86
|
username: string;
|
|
87
|
+
/** Whether the user account is disabled */
|
|
88
|
+
disabled: boolean;
|
|
89
|
+
/** Account creation time (ISO 8601) */
|
|
90
|
+
created_at: string;
|
|
87
91
|
};
|
|
88
92
|
/**
|
|
89
93
|
* Fetches the currently authenticated user's identity.
|
package/dist/index.js
CHANGED
|
@@ -164,11 +164,14 @@ export async function refreshSession(audience = "app") {
|
|
|
164
164
|
export async function getCurrentUser(opts) {
|
|
165
165
|
let res;
|
|
166
166
|
try {
|
|
167
|
-
res = await authFetch("/auth/user", { method: "GET" }, { audience: opts?.audience ?? "app" });
|
|
167
|
+
res = await authFetch("/auth/api/v1/user", { method: "GET" }, { audience: opts?.audience ?? "app" });
|
|
168
168
|
}
|
|
169
169
|
catch {
|
|
170
170
|
return null;
|
|
171
171
|
}
|
|
172
|
+
if (res.status === 401) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
172
175
|
if (!res.ok) {
|
|
173
176
|
return null;
|
|
174
177
|
}
|
package/package.json
CHANGED