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

Fix: Handle registration error during initial deployment due to missing 'users' table #269

Closed
wants to merge 0 commits into from

Conversation

JazzuLu
Copy link

@JazzuLu JazzuLu commented Mar 17, 2024

Link issue: #262

Problem Description:

During the initial deployment, attempting to register as a user results in an error. This is because the necessary 'users' table is missing from the PostgreSQL database.

Solution:

I have added a check to verify the existence of the 'users' table. If the table does not exist, I create the 'users' table to resolve this issue.

Details of the Changes:

Added a function checkIfUsersTableExists() to check if the 'users' table exists.
If the 'users' table does not exist, it is created.

Testing Results:

I have tested this modification in my local environment to ensure that the registration functionality works correctly during the initial deployment.

Copy link

vercel bot commented Mar 17, 2024

@JazzuLu is attempting to deploy a commit to the Uncurated Tests Team on Vercel.

A member of the Team first needs to authorize it.

@JazzuLu JazzuLu changed the title fix: https://github.com/vercel/ai-chatbot/issues/262 Fix: Handle registration error during initial deployment due to missing 'users' table Mar 17, 2024
@AarushSah
Copy link

Had the same issue and this PR fixed it. +1

@jeremyphilemon
Copy link
Contributor

@JazzuLu We updated the implementation to have the kv datastore handle auth data as well, so there's no need for setting up another postgres database! Thanks for the pull request anyway :)

@rogerodipo
Copy link

@jeremyphilemon I have tried this today on a brand new deployment, but still can't get user authentication to work. Getting the error "Something went wrong, please try again." Running on Vercel. https://haki-seven.vercel.app.

@jeremyphilemon
Copy link
Contributor

@rogerodipo can you confirm

  • if your AUTH_SECRET environment variable was set up correctly?
  • if the prefix for your datastore's environment variables is KV?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants