@viibestack/ui 0.6.1 → 0.6.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/package.json +1 -1
- package/src/auth.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viibestack/ui",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Dependency-free React UI kit -- icons, core components (Button, Card, Input, Modal, etc.), a real per-app data client (listRows/upsertRow/deleteRow/reportError), and a real per-app end-user auth client (signUp/logIn/logOut/getCurrentUser) backed by ViibeStack's own platform-managed data store.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/src/auth.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
export interface AppUser {
|
|
13
13
|
id: string;
|
|
14
14
|
email: string;
|
|
15
|
+
displayName?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export type AuthActionResult = { ok: true; user: AppUser } | { ok: false; error: string };
|
|
@@ -149,8 +150,8 @@ async function callAppAuth<T>(path: string, init?: RequestInit): Promise<{ ok: t
|
|
|
149
150
|
|
|
150
151
|
type SessionResponse = { jwt: string; sessionId: string; user: AppUser };
|
|
151
152
|
|
|
152
|
-
export async function signUp(email: string, password: string): Promise<AuthActionResult> {
|
|
153
|
-
const result = await callAppAuth<SessionResponse>("/signup", { method: "POST", body: JSON.stringify({ email, password }) });
|
|
153
|
+
export async function signUp(email: string, password: string, name?: string): Promise<AuthActionResult> {
|
|
154
|
+
const result = await callAppAuth<SessionResponse>("/signup", { method: "POST", body: JSON.stringify({ email, password, name }) });
|
|
154
155
|
if (!result.ok) return { ok: false, error: result.error };
|
|
155
156
|
saveStoredSession(result.body);
|
|
156
157
|
return { ok: true, user: result.body.user };
|