Mark
DTDrizzle Team
•Created by nr7751 on 2/23/2024 in #help
Password hashing in Drizzle schema
Happy to help 👍
8 replies
DTDrizzle Team
•Created by nr7751 on 2/23/2024 in #help
Password hashing in Drizzle schema
take a look at this.
https://github.com/vercel/nextjs-postgres-auth-starter/blob/main/app/auth.ts
^ postgresql next auth example, specifically how it handles checking if the user password is correct or not.
8 replies
DTDrizzle Team
•Created by nr7751 on 2/23/2024 in #help
Password hashing in Drizzle schema
Many of the nextjs projects with any sort of functional login modules have the feature built in but it boils down to:
* Get a crypto module (not crypto as in that one currency thing) but something like crypto-ts.
* Use the modules to generate hashes use the hashed password in the db.
* Use crypto's built in function to verify the password is correct upon logins.
8 replies
DTDrizzle Team
•Created by nr7751 on 2/23/2024 in #help
Password hashing in Drizzle schema
Do you want to hash the password and then insert it into the db?
or hash the password that is already in the db?
8 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
so i have to look all over the place
Regardless that seems to be a fix, although an annoying one because i just have to expect the code to error somewhere sometime about db.
I don't think we can return an awaited db type, the code will just complain, thanks for your help! 😁
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
It's kinda annoying though because now i have look through all of my imports and and initialize an awaited db.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Interesting
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Wait no, it gave a different error that was resolved with a restart of the project that later went to
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Same error
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
will be surprising if it wont start complaining about async functions
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Vscode's intellisense.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Give me a minute, i just got on my computer.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
This gives a new error. But it seems to connect properly, it gives query is not a valid function despite it being one.
(That is if you fix the await problems)
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Seems like drizzle gets all of the required info like username, password and so on from the conncetionurl, which is nice to know but confusing on why it fails.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
printing the connection results in this.
So it seems to be valid, problem is that still says wrong version number.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
wait so. i go back to:
It kind of semi works but it complains about the await?
⨯ SyntaxError: await is only valid in async functions and the top level bodies of modules
at (action-browser)/./src/server/db/index.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:893:1)
at __webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
at eval (./src/lib/auth/index.ts:10:68)
at (action-browser)/./src/lib/auth/index.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:772:1)
at __webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
at eval (./src/lib/auth/actions.ts:21:67)
at (action-browser)/./src/lib/auth/actions.ts (/home/mark/next-lucia-auth/.next/server/app/(auth)/login/page.js:761:1)
at Function.__webpack_require__ (/home/mark/next-lucia-auth/.next/server/webpack-runtime.js:33:42)
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Wait hold on, i am getting a breakthrough.
43 replies
DTDrizzle Team
•Created by Mark on 2/20/2024 in #help
Connection failed, fetch failed.
Nope, same issue.
43 replies