redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.27k stars 991 forks source link

[RFC]: change in seed.ts template - hashPassword remark in 'seed.ts' tempalte #7128

Closed wiezmankimchi closed 1 year ago

wiezmankimchi commented 1 year ago

Summary

The current remark in the seed.ts template is: // import { hashPassword } from '@redwoodjs/auth-providers-api' and it should changed to: // import { hashPassword } from '@redwoodjs/api'.

as if implemented as is, you will get an error: `Error in script: Cannot find module '@redwoodjs/auth-providers-api' Require stack:

Motivation

corrected template

Detailed proposal

remove // import { hashPassword } from '@redwoodjs/auth-providers-api' add // import { hashPassword } from '@redwoodjs/api'

Are you interested in working on this?

jtoar commented 1 year ago

Hey @wiezmankimchi, you're right. Now that we've fully decoupled the auth providers, it should actually be:

import { hashPassword } from '@redwoodjs/auth-dbauth-api

You can make that change if you're still up for it, but no pressure.

dthyresson commented 1 year ago

@jtoar I believe the seed template in main has already been updated.

https://github.com/redwoodjs/redwood/blob/99fce77e01198cddd1fcea83453f25562952e280/packages/create-redwood-app/template/scripts/seed.ts#L41

Perhaps this is a release notes item to update seeds (or use of this import?).

jtoar commented 1 year ago

@dthyresson yeah you're right—and good call, definitely belongs in the release notes.

jtoar commented 1 year ago

I got this wrong—the existing comment doesn't look right to me.

Tobbe commented 1 year ago

Confirming that @redwoodjs/api is wrong image

Here's the proper import image

@wiezmankimchi Do you want to create a PR with the fix, or should I do it? I don't mind either way, so totally up to you 🙂