Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating email and verifying token, user_metadata still has the old email #1670

Open
2 tasks done
budget-share-admin opened this issue Jul 21, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@budget-share-admin
Copy link

budget-share-admin commented Jul 21, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

After updating a user's email and verifying with OTP token, the user_metadata field isn't updating with the newly verified email.
The email and identities field get correctly updated.
Secure email change is disabled.

To Reproduce

  1. call updateUser({ email: "[email protected]" })
  2. call verifyOtp({ email: "[email protected]", token: token, type: "email_change" })
  3. the session that verifyOtp returns has the old email still in the user_metadata field
  4. in the auth.users table, the user_metadata field still has the old email

Expected behavior

The user_metadata field should be updated with the new email

System information

  • OS: mac
  • Version of supabase-js: "2.42.3"
  • Version of auth-js: "2.63.0"
  • Version of Node.js: "18.13.0"

Additional context

session returned from verifyOtp

{
    "app_metadata": {
        "provider": "email",
        "providers": [
            "email"
        ]
    },
    "aud": "authenticated",
    "confirmation_sent_at": "2024-07-21T00:41:57.424722Z",
    "confirmed_at": "2024-07-21T00:42:04.984262Z",
    "created_at": "2024-07-21T00:41:57.40992Z",
    "email": "[email protected]",
    "email_change_sent_at": "2024-07-21T01:03:21.984546Z",
    "email_confirmed_at": "2024-07-21T00:42:04.984262Z",
    "id": "88e3b62a-54ef-4c49-963d-c09de3a09cd1",
    "identities": [
        {
            "created_at": "2024-07-21T00:41:57.418971Z",
            "email": "[email protected]",
            "id": "88e3b62a-54ef-4c49-963d-c09de3a09cd1",
            "identity_data": [],
            "identity_id": "3fba5840-9614-4066-a38b-8d89e6a7cff6",
            "last_sign_in_at": "2024-07-21T00:41:57.418919Z",
            "provider": "email",
            "updated_at": "2024-07-21T00:55:58.797144Z",
            "user_id": "88e3b62a-54ef-4c49-963d-c09de3a09cd1"
        }
    ],
    "is_anonymous": false,
    "last_sign_in_at": "2024-07-21T01:03:32.004548674Z",
    "phone": "",
    "role": "authenticated",
    "updated_at": "2024-07-21T01:03:32.008945Z",
    "user_metadata": {
        "age": 48,
        "email": "[email protected]",
        "email_verified": false,
        "phone_verified": false,
        "sub": "88e3b62a-54ef-4c49-963d-c09de3a09cd1",
        "username": "ee"
    }
}
@budget-share-admin budget-share-admin added the bug Something isn't working label Jul 21, 2024
@budget-share-admin
Copy link
Author

any updates here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant