W
Wasp-lang•4mo ago
3ghan

default password

Hello all, thanks for your work! this project looks great. I'm spinning it up from the base with the migrated db, can't find info on default password for admin, is that a manual push into the db or is there a default or defined method?
12 Replies
kapa.ai
kapa.ai•4mo ago
Hi @3ghan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hello! The default password for the admin user is not explicitly mentioned in the provided knowledge sources. However, in Wasp, you can set up admin users by specifying their emails in the ADMIN_EMAILS environment variable in the .env.server file. For example:
ADMIN_EMAILS=my@email.com
ADMIN_EMAILS=my@email.com
After setting this, you can sign up with the specified email and you should have admin access. If you're using the username and password authentication method, you can set the password during the sign-up process. If you're using the email authentication method, you'll receive an email with a link to set your password. Please note that in a production environment, you should set up an email sender for the email authentication method to work properly. For more detailed information, you might want to check the official Wasp documentation (https://wasp-lang.dev/docs). If you're still having trouble, could you please provide more details about your setup and the exact steps you're following? ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @3ghan, 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?
3ghan
3ghan•4mo ago
"If you're using the username and password authentication method, you can set the password during the sign-up process." Tried this and doesn't seem to work, I'm going to start on a fresh install and see if that works. If anybody else comes across this issue, pretty sure it's the data shaping, so I would recommend choosing your auth method before building your database out.
Vinny (@Wasp)
Vinny (@Wasp)•4mo ago
hey there. Are you referring to Open SaaS? if you want to change a user to admin for open saas, you need to set the ADMIN_EMAILS env var before you sign up with that email. or if you've already signed up, you can run (in a seperate terminal) wasp db studio, find the user, and change isAdmin to true
Vinny (@Wasp)
Vinny (@Wasp)•4mo ago
I've gone ahead and updated the docs to add these instructions to the Admin Dashboard and User Overview sections: https://docs.opensaas.sh/general/admin-dashboard/#permissions thanks for making us aware 🙂
OpenSaaS.sh
Admin Dashboard
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Vinny (@Wasp)
Vinny (@Wasp)•4mo ago
If that wasn't your issue, please let us know and we'll continue to help :godfatherboi:
3ghan
3ghan•4mo ago
Hey thanks! sorry yes opensaas, I just needed to dig into the db studio/prisma config. Fantastic project, great work loving it. for indi devs in the ai space it's huge to be able to spin up Next with auth and tools fast.
martinsos
martinsos•4mo ago
Hah not Next though :)!
3ghan
3ghan•4mo ago
ahahaha right. THANKS! nice to be free of next for a minute on the topic of Auth and DB seed, I think the docs would benifit from a short prisma sentance around " 2. Run the development database (and leave it running): wasp db start" Even just changing this to 'build the development database from main.wasp config" would make it more clear that prisma isn't going to rebulid that database shape, right? once you hit that db start your auth method is locked in right? RTFM gets complicated with large stacks 🙂
martinsos
martinsos•4mo ago
Hm good question: so wasp db start will run the development database and that is it really -> it won't do anything Wasp specific, like infusing it with information from main.wasp or with prisma schema. So it actually won't build the dev db from main.wasp config. What does apply the stuff from main.wasp (Prisma stuff) is the wasp db migrate-dev command, which makes sure schema in the db is in sync with the Prisma schema. Also, each time you run wasp db start, it continues from where it stopped. Does this help? HOw would you update docs to relfect this?
3ghan
3ghan•4mo ago
ha ya, clever. so, in practical dev process, some, as myself, will spin up several versions to test features atomically. wasp handles this very poorly? not sure where the issue arises but where I've gotten to so far is: docker volume ls | grep wasp-dev-db shows many volumes, if you manually kill a db, (prisma?) cache does not update, so you env updates to new db url but all wasp db commands will fail with: 'database "OpenSaaS-ff8c20a255" does not exist' I went with wasp uninstall reinstall, I'll document and file the issue on the repo once I've narrowed it down a bit. But you guys might wanna be aware of it as it's a full stop for some devs because that cache is hidden (somewhere in prisma land I'd guess), and so requires full debug (no search and fix)
miho
miho•4mo ago
Wasp hashes the path to the app and uses that in the volume name, so it shouldn't be a problem to hace multiple projects on one computer. But you can't run multiple dev DBs at once!
martinsos
martinsos•4mo ago
@3ghan ok that is interesting, I am not sure I am catching all the details though, and would love to. So ok, we create a db with different name for each projects, even if it is all copies of the same project, that is how we make sure they don't mix up. So that should be great. Btw what do you mean that you spin up several versions to test features atomatically? Several versions of what? How does that allow you to test features atomically? Could you maybe provide me with more details here, ideally some kind of an example use case? Hm I am not sure if Prisma is caching something in a way that could be troublesome. You mentioned all wasp db commands will fail with: . In which context? You have your wasp app on the disk, and you are in there, and you run wasp db migrate-dev for example I guess, and you get this error? Do you have wasp db start running in parallel? As Miho said, you can't run multiple dev dbs at once because they are all using the same port: 5432. But you should have gotten an error regarding that from the second wasp db start that you tried to run hm.