#auth.js
24 messages · Page 1 of 1 (latest)
i found https://authjs.dev/getting-started/authentication/credentials on their documentation site. is there something on that page that is hard to understand or isn't working for you?
it's okay. ill try to find someone who can help.
it jsut doenst work idk . wnting simply credentials auth starter or something. or a valid docs for this
following what they say doesnt work
you're going to need to be more specific to get help from anyone. what does "doesn't work" mean? do you get an error message? some other problem?
e.g. i've tried for hundreds of hours. nothing works. so awful
https://github.com/AlexCodeMe/auth-please-help
spun that up cuz ig ot frustrated and deleted all the rest
i am specific. i want an implementation of credentials. i mean it doesnt have to be nextauth but iw aas kinda trying to learn something and just ended up wasting a few weeks and getting frustrated
no i mean specific about the problem(s) you are hitting. how do you know it "doesn't work"? what observable thing is happening to make you say that?
i see. sorry im really confused
i think i just need a starter to follow
lik eobviouslty i cant do
import { loginGithub } from "@/app/actions";
import { signIn } from "@/lib/auth";
export default function SignIn() {
return (
<div className="flex flex-col items-center justify-center h-screen space-y-4">
<form onSubmit={loginGithub}>
<button type="submit">Signin with GitHub</button>
</form>
<form
action={async (formData) => {
"use server";
await signIn("credentials", formData);
}}
>
<label>
Email
<input name="email" type="email" />
</label>
<label>
Password
<input name="password" type="password" />
</label>
<button>Sign In</button>
</form>
</div>
);
}
directly in a form like they say
are there alternatives to this? like an actual auth library with docs that one can follow?
why not? other than the extra <form> you have there i don't see an immediate problem with that (but as i said before i don't know auth.js so it's possible you are referring to some obvious issue i am missing)
there are zillions of auth libraries, and if you're just doing traditional username+password session-based auth it's not that onerous to roll your own either (just read up on best practices regarding password hashing, token management, etc)
one of the zillion?
clerk no
kinde no
--> those are not straight forward and handle everythign for you
lucia deprecated
auth.js a lot of people seem to use but incomplete docs. ...
and there's no problem but removing the extra form for github login
GET / 200 in 155ms
anyway appreciate your help / patiences. sorrry i'm very very frustrated.
if anyone has a projec t using nextauth please share the repo so i can implement it.
nothing worse than bad docs >.<
GET /favicon.ico 200 in 21ms
GET /favicon.ico 200 in 10ms
✓ Compiled in 193ms (713 modules)
[auth][warn][debug-enabled] Read more: https://warnings.authjs.dev#debug-enabled
[auth][error] CredentialsSignin: Read more at https://errors.authjs.dev#credentialssignin
at Module.callback (webpack-internal:///(rsc)/./node_modules/@auth/core/lib/actions/callback/index.js:246:23)
at async AuthInternal (webpack-internal:///(rsc)/./node_modules/@auth/core/lib/index.js:66:24)
at async Auth (webpack-internal:///(rsc)/./node_modules/@auth/core/index.js:127:34)
at async signIn (webpack-internal:///(rsc)/./node_modules/next-auth/lib/actions.js:53:17)
at async $$ACTION_0 (webpack-internal:///(rsc)/./src/components/sign-in.tsx:77:5)
at async C:\Users\chloe\web\auth-please\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:39:418
at async rk (C:\Users\chloe\web\auth-please\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:38:8148)
at async r3
(C:\Users\chloe\web\auth-please\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:41:1256)
at async doRender (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:1413:30)
at async cacheEntry.responseCache.get.routeKind (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:1574:28)
at async DevServer.renderToResponseWithComponentsImpl (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:1482:28)
at async DevServer.renderPageComponent (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:1908:24)
at async DevServer.renderToResponseImpl (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:1946:32)
at async DevServer.pipeImpl (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:921:25)
at async NextNodeServer.handleCatchallRenderRequest (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\next-server.js:272:17)
at async DevServer.handleRequestImpl (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\base-server.js:817:17)
at async C:\Users\chloe\web\auth-please\node_modules\next\dist\server\dev\next-dev-server.js:339:20
at async Span.traceAsyncFn (C:\Users\chloe\web\auth-
please\node_modules\next\dist\trace\trace.js:154:20)
at async DevServer.handleRequest (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\dev\next-dev-server.js:336:24)
at async invokeRender (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\lib\router-server.js:173:21)
at async handleRequest (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\lib\router-server.js:350:24)
at async requestHandlerImpl (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\lib\router-server.js:374:13)
at async Server.requestListener (C:\Users\chloe\web\auth-please\node_modules\next\dist\server\lib\start-server.js:141:13)
⨯ CredentialsSignin: Read more at https://errors.authjs.dev#credentialssignin
at async $$ACTION_0 (./src/components/sign-in.tsx:77:5)
digest: "1511269581"
POST / 500 in 17ms
anyway delete this message. where could someone help me do this? sorry id ont have any friends
my first suggestion would be to try the support/community for auth.js specifically. for example it looks like they have a discord server (look at the top right of their documentation site)
also no need to delete this. maybe someone who has experience with this specific library/configuration will jump in