Skip to content

supabase.auth.signUp() with metadata returns nil User, even if result successful #172

Closed
@marcusraty

Description

@marcusraty

Bug report

supabase.auth.signUp()

Describe the bug

I was previously using supabase.auth.signUp() successfully, but have added a trigger to the auth table, I am sending metadata in supabase.auth.signUp() now and using this in my trigger. I have confirm email turned off.

supabase.auth.signUp() returns (ie does not throw an error). In my dashboard I can see the new user in my auth table, and I can see the new row in my public.profiles which was the result of my trigger.

Printing the result seems to show a User as well, unless I am mistaken! However when I attempt to unwrap this and get the user, it returns nil.

`result is session(GoTrue.Session(providerToken: nil, providerRefreshToken: nil, accessToken: REMOVED", tokenType: "bearer", expiresIn: 3600.0, refreshToken: "REMOVED", user: GoTrue.User(id: REMOVED, appMetadata: ["providers": _Helpers.AnyJSON.array([_Helpers.AnyJSON.string("email")]), "provider": _Helpers.AnyJSON.string("email")], userMetadata: ["isPublic": _Helpers.AnyJSON.bool(true), "username": _Helpers.AnyJSON.string("marcusroar"), "dateOfBirth": _Helpers.AnyJSON.string("2004-12-05")], aud: "authenticated", confirmationSentAt: nil, recoverySentAt: nil, emailChangeSentAt: nil, newEmail: nil, invitedAt: nil, actionLink: nil, email: Optional("REMOVED"), phone: Optional(""), createdAt: 2023-12-05 06:52:23 +0000, confirmedAt: nil, emailConfirmedAt: Optional(2023-12-05 06:52:23 +0000), phoneConfirmedAt: nil, lastSignInAt: Optional(2023-12-05 06:52:23 +0000), role: Optional("authenticated"), updatedAt: 2023-12-05 06:52:23 +0000, identities: Optional([GoTrue.UserIdentity(id: "df71ad62-ef45-4025-b2f6-282744d2938d", userId: DF71AD62-EF45-4025-B2F6-282744D2938D, identityData: Optional(["email": _Helpers.AnyJSON.string("[email protected]"), "email_verified": _Helpers.AnyJSON.bool(false), "sub": _Helpers.AnyJSON.string("df71ad62-ef45-4025-b2f6-282744d2938d"), "phone_verified": _Helpers.AnyJSON.bool(false)]), provider: "email", createdAt: 2023-12-05 06:52:23 +0000, lastSignInAt: 2023-12-05 06:52:23 +0000, updatedAt: 2023-12-05 06:52:23 +0000)]), factors: nil)))

`

Expected behavior

If supabase.auth.signUp() is successful both User and Session should be returned

Additional context

Happy to provide any additional details - thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions