Skip to content

← All questions

auth.strategy "custom" needs an auth export in steps/auth.ts, and I wrote one

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Our login is a two-step form — email, continue, then password on the next screen — so the four selectors in auth.form do not cover it. Set the strategy to custom and wrote the file:

text
✖ CONFIG_INVALID: auth.strategy "custom" needs an `auth` export in projects/shop/steps/auth.ts.
  hint: export const auth = defineAuth({ strategy: 'custom', login: async ({ page, user }) => { ... } })

projects/shop/steps/auth.ts exists and exports auth. It is a defineAuth call with strategy: 'custom' in it. What is it looking for that I have not given it?

1 answer

Have a different question? Ask it.

Related