W
Wasp5d ago
csbk

unable to delete user in wasp db studio to test Google Auth.

Password reset also not working.
13 Replies
kapa.ai
kapa.ai5d ago
Hi @csbk. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- If you are unable to delete a user in Wasp DB Studio to test Google Auth, and password reset is also not working, here are some things to consider based on the knowledge sources: Deleting Users in Wasp DB Studio - Wasp uses Prisma under the hood, so wasp db studio opens Prisma Studio, which allows you to view and edit your database records. - If you cannot delete a user, ensure you are selecting the correct table/entity (likely User or AuthIdentity in the new auth system). If you migrated to Wasp 0.12.x, user credentials are now stored in the internal AuthIdentity entity, not directly on the User entity. You may need to delete the corresponding record in AuthIdentity for a full removal of login credentials, especially if you are testing different auth methods with the same email address. This is important because having the same email in both Google and Email/Password can cause conflicts, and deleting the user from the correct table is necessary for a clean test environment. If you are still seeing issues, double-check that you are deleting from all relevant tables/entities, not just UserOauth redirects to localhost:3001 instead of 3000. Password Reset Not Working - For password reset to work with the Email auth method, you must configure the passwordReset field in your main.wasp under the email auth method. This includes specifying the clientRoute and optionally customizing the email content via getEmailContentFnDocs > Auth > Email > Password Reset Flow. - You also need to have a working email provider (like SendGrid or Mailgun) set up, as Wasp will send a reset link to the user's email. If this is not configured, password reset emails will not be sent. - For local development, if you want the simplest setup, you can use the usernameAndPassword method, which does not require email configuration and is easier for quick testingDiscord support thread: Unable to access the Dashboard as an admin user. Recommendations - For local testing, consider switching to usernameAndPassword auth for simplicity, as it requires no email setup. - If you want to test Google Auth, ensure you have deleted all user records (including in AuthIdentity) that might conflict with the email you are using for Google login. - If password reset is not working, verify your email provider configuration and that your main.wasp is set up correctly for the email auth method. If you are still having trouble deleting users or with password reset, the knowledge sources do not provide more detailed troubleshooting steps. You may want to check for errors in your terminal or logs, or ask for help in the Wasp Discord community. Let me know if you need more specific guidance on configuring your auth methods or troubleshooting! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP5d ago
@kapa.ai also now this error: Access blocked: Authorization Error The OAuth client was not found. If you are a developer of this app, see error details. Error 401: invalid_client I have not changed anything in Google cloud or in env.server
kapa.ai
kapa.ai5d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- The error message:
Access blocked: Authorization Error
The OAuth client was not found.
Error 401: invalid_client
indicates that Google cannot find the OAuth client specified by your credentials. According to the Wasp documentation, this usually means there is an issue with your GOOGLE_CLIENT_ID and/or GOOGLE_CLIENT_SECRET environment variables in your .env.server file. The most common causes are: - The client ID or secret is missing, incorrect, or not matching what is set up in your Google Cloud project. - The environment variables are not being loaded correctly by your server. - The OAuth client was deleted or changed in Google Cloud Console. What to check: 1. Verify your .env.server file:
Make sure you have the correct values for:
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

These should match exactly what is shown in your Google Cloud Console under Credentials for your OAuth client. Even a small typo will cause this error.
Docs > Auth > Social-auth > Google > 4. Adding Environment Variables 2. Restart your server:
If you update your .env.server, you must restart your Wasp server for the changes to take effect. 3. Check Google Cloud Console:
- Ensure the OAuth client still exists and is not deleted. - Make sure the redirect URIs in Google Cloud match what your app is using (e.g., <https://your-server-url.com/auth/google/callback>).
Docs > Auth > Social-auth > Google > 3. Creating a Google OAuth App 4. Environment variable loading:
If deploying (e.g., to Fly.io), ensure the environment variables are set in the deployment environment, not just locally.
Fly.io deployment notes If you have not changed anything in Google Cloud or your .env.server, double-check that the file is present, correctly formatted, and being loaded by your server. Sometimes, deployment environments require you to set secrets separately. If all of the above is correct and you still see the error, the knowledge sources do not provide further troubleshooting steps for this specific error. In that case, consider re-creating your OAuth credentials in Google Cloud and updating your .env.server accordingly. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
oasisenterprise
@csbk not sure if your testing locally but check your localhost port. if you opened a second instance to test and it went to port 3001 you need to update your google client id in .env.server and then also add that to authorized redirects in google cloud console. No idea if that is your issue I had ran into that in the past so thought I would mention it. Also on the delete user try shutting down your DB instance and restarting it. that seemed to fix my issue when I was running into that.
csbk
csbkOP5d ago
@kapa.ai this is the error Prisma gives me when trying to delete a user. I want to delete all users and start from scratch in testing mode to test Google Auth is fixed. Error:
kapa.ai
kapa.ai5d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but the knowledge sources you provided do not contain the specific Prisma error message you are encountering when trying to delete a user. Without the exact error message or more details, I cannot give a precise solution. However, based on the available information, here are some general steps that have been discussed in the Wasp community for resetting your database and starting from scratch: 1. Reset the Database:
You can use the wasp db reset command to drop all data and tables from your development database and re-apply all migrations. This should remove all users and give you a clean slate for testing. If wasp db reset is not working as expected (e.g., only showing help instructions), this is a known issue and is being tracked for a fix in an upcoming release. As a workaround, you can manually use Prisma in your seed function to clean your data, as some community members have doneDiscord: wasp db reset showing help instructions. 2. Check for Foreign Key Constraints:
If you are unable to delete a user due to foreign key constraints (for example, related records in AuthIdentity or other tables), you may need to delete those related records first. The new auth system stores credentials in the AuthIdentity entity, so ensure you are removing related records there as wellDocs: AuthIdentity Entity. 3. Manual Deletion in Prisma Studio:
You can open Prisma Studio with wasp db studio and manually delete users and related records. If you encounter errors, check for related records that need to be deleted first. If you can provide the exact error message from Prisma, I may be able to give more targeted advice. Otherwise, the knowledge sources do not contain enough information to address your specific error. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP5d ago
@kapa.ai The full error:
kapa.ai
kapa.ai5d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but you have not provided the full error message from Prisma. Without the specific error text, I cannot give a targeted answer. The knowledge sources do not contain enough information to address your issue without the actual error details. If you share the complete error message, I will do my best to help you based on the available knowledge sources. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP5d ago
@kapa.ai my bad, this should be right:
kapa.ai
kapa.ai5d ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- I'm sorry, but I still do not see the full Prisma error message in your messages. Without the actual error text, I cannot provide a specific solution. The knowledge sources do not contain enough information to address your issue without the exact error details. Please provide the complete error message from Prisma, and I will review it and help you based on the available knowledge sources. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP5d ago
kapa.ai
kapa.ai5d ago
Let me check the knowledge base for you again. One moment! :books: Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP5d ago
wasp db reset worked for me in the end and now OAuth is tested and working. I have not figured out how to delete a user yet. Maybe it's because I am the amin user and trying to delete myself brings up the error? @oasisenterprise thank you for your help

Did you find this page helpful?