Skip to content

← All questions

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

Asked 3,610 views1 answer

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?

asked by Devon Marsh183 ·

1 answer

Know the answer?

Reviewed before it appears. Wrap commands and output in triple backticks and they will render as a code block.

Have a different question? Ask it.

Related