Saas-Starter-Kit / Saas-Kit-prisma

🚀A template for building Software-as-Service (SAAS) apps with Reactjs, Nextjs, Prisma and OpenAI integration
https://www.saasstarterkit.com/dashboard/test243/main
435 stars 70 forks source link

Auth is not Working at all #11

Open m8nt0 opened 3 weeks ago

m8nt0 commented 3 weeks ago

I have been fighting with this for days, and I am sure i have filled out my .env.local with the needed information. But i keep getting this:

"``` Object { name: "Auth Error", message: "EmailSignin" } ​ message: "EmailSignin" ​ name: "Auth Error" ​

: Object { … } ​​ __defineGetter__: function __defineGetter__() ​​ __defineSetter__: function __defineSetter__() ​​ __lookupGetter__: function __lookupGetter__() ​​ __lookupSetter__: function __lookupSetter__() ​​ __proto__: ​​ constructor: function Object() ​​ hasOwnProperty: function hasOwnProperty() ​​ isPrototypeOf: function isPrototypeOf() ​​ propertyIsEnumerable: function propertyIsEnumerable() ​​ toLocaleString: function toLocaleString() ​​ toString: function toString() ​​ valueOf: function valueOf() ​​ : function __proto__() ​​ : function __proto__() [error.ts:19:12](webpack://_N_E/src/lib/utils/error.ts?cb8f) Object { name: "Auth Error", message: "EmailSignin" } ​ message: "EmailSignin" ​ name: "Auth Error" ​ : Object { … } ​​ __defineGetter__: function __defineGetter__() ​​ __defineSetter__: function __defineSetter__() ​​ __lookupGetter__: function __lookupGetter__() ​​ __lookupSetter__: function __lookupSetter__() ​​ __proto__: ​​ constructor: function Object() ​​ hasOwnProperty: function hasOwnProperty() ​​ isPrototypeOf: function isPrototypeOf() ​​ propertyIsEnumerable: function propertyIsEnumerable() ​​ toLocaleString: function toLocaleString() ​​ toString: function toString() ​​ valueOf: function valueOf() ​​ : function __proto__() ​​ : function __proto__() [error.ts:19:12](webpack://_N_E/src/lib/utils/error.ts?cb8f) Uncaught (in promise) Object { name: "Auth Error", message: "EmailSignin" } ​ message: "EmailSignin" ​ name: "Auth Error" ​ : Object { … } [index.esm.mjs:2147](webpack://_N_E/node_modules/react-hook-form/dist/index.esm.mjs?de64) handleSubmit index.esm.mjs:2147 AsyncFunctionThrow self-hosted:804 (Async: async) callCallback react-dom.development.js:20565 invokeGuardedCallbackImpl react-dom.development.js:20614 invokeGuardedCallback react-dom.development.js:20689 invokeGuardedCallbackAndCatchFirstError react-dom.development.js:20703 executeDispatch react-dom.development.js:32128 processDispatchQueueItemsInOrder react-dom.development.js:32160 processDispatchQueue react-dom.development.js:32173 dispatchEventsForPlugins react-dom.development.js:32184 dispatchEventForPluginEventSystem react-dom.development.js:32374 batchedUpdates$1 react-dom.development.js:24953 batchedUpdates react-dom.development.js:28844 dispatchEventForPluginEventSystem react-dom.development.js:32373 dispatchEvent react-dom.development.js:30141 dispatchDiscreteEvent react-dom.development.js:30112 (Async: EventListener.handleEvent) addEventBubbleListener react-dom.development.js:30361 addTrappedEventListener react-dom.development.js:32277 listenToNativeEvent react-dom.development.js:32216 listenToAllSupportedEvents react-dom.development.js:32227 forEach self-hosted:4281 listenToAllSupportedEvents react-dom.development.js:32222 hydrateRoot$1 react-dom.development.js:37940 hydrateRoot react-dom.development.js:38526 hydrateRoot client.js:20 hydrate app-index.tsx:245 startTransition react.development.js:2596 hydrate app-index.tsx:244 app-next-dev.ts:8 appBootstrap app-bootstrap.ts:61 loadScriptsInSequence app-bootstrap.ts:20 appBootstrap app-bootstrap.ts:60 app-next-dev.ts:6 NextJS 7 ```" I know I am knew to programming but I really need help to get the authentication working, to be able to access the dasboard. From my debugging work I concluded the next/auth SignIn and SignOut are the problem, or maybe the way my environment variables are handled or the auth/auth.ts but that seems right. By deafult the authentication is not working at all. Help me I really like this boilerplate.
m8nt0 commented 3 weeks ago

Also, after reading the auth.js documentation, the auth.ts is supposed to be under src not lib/API/services/auth/auth.ts. do you think this is the issue? although i see that "src/app/api/auth/[...nextauth]/route.ts" is configured to work with the one in "ib/API/services/auth/auth.ts". Please let me know. I'm guessing this is working for everybody else, so, I am assuming I did something wrong in my .env.local

iqbal125 commented 1 week ago

@m8nt0 Sure thing, are you running the maildev server ?