mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
fix: org creation (#897)
This commit is contained in:
parent
68b6c66321
commit
703ebf75f2
1 changed files with 5 additions and 4 deletions
|
|
@ -444,13 +444,14 @@ export default function OnboardingPage() {
|
|||
|
||||
const ensureOrg = useCallback(async () => {
|
||||
if (organizations && organizations.length > 0) return
|
||||
const name = user?.name ?? user?.email ?? "My Workspace"
|
||||
const newOrg = await authClient.organization.create({
|
||||
const name = user?.name || user?.email || "Personal"
|
||||
const slug = generateOrgSlug(name)
|
||||
const result = await authClient.organization.create({
|
||||
name,
|
||||
slug: generateOrgSlug(name),
|
||||
slug,
|
||||
metadata: { signupSource: "consumer" },
|
||||
})
|
||||
await setActiveOrg(newOrg.slug)
|
||||
await setActiveOrg(result.data?.slug ?? slug)
|
||||
if (user?.name) {
|
||||
await authClient.updateUser({
|
||||
displayUsername: user.name,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue