#anyone using next auth and getting this
1 messages · Page 1 of 1 (latest)
Hi @austere schooner. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Sorry @austere schooner, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
where should i import it? since it's being used by next-auth itself
to generate a JWT token
where or how is it generated?
in the backend, it's an api route
Error during SSR Rendering
error rendering: Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported
Debug info:
- error rendering: Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported
at rng (node_modules/uuid/dist/esm-browser/rng.js:14:13) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:234387:19]
at v4 (node_modules/uuid/dist/esm-browser/v4.js:6:51) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:234406:191]
at Object.encode (node_modules/next-auth/jwt/index.js:52:72) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:222150:76]
at async Object.callback (node_modules/next-auth/core/routes/callback.js:432:22) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:224448:26]
at async AuthHandler (node_modules/next-auth/core/index.js:302:28) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:224832:38]
at async NextAuthRouteHandler (node_modules/next-auth/next/index.js:68:28) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:224943:30]
at async NextAuth._args$ (node_modules/next-auth/next/index.js:103:16) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:224977:24]
at async (node_modules/next/dist/server/future/route-modules/app-route/module.js:248:37) [C:\Users\kaako\Desktop\vs-code\studends-sis-2\.next\server\app\chunks\ssr\_63184c._.js:207794:37]
any code related?
import CredentialsProvider from "next-auth/providers/credentials";
import NextAuth from "next-auth";
import type { NextAuthOptions } from "next-auth";
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(process.env.SUPABASE_URL || "", process.env.SUPABASE_KEY || "")
const authOptions: NextAuthOptions = {
// Configure one or more authentication providers
providers: [
// ...add more providers here
CredentialsProvider({
// The name to display on the sign in form (e.g. "Sign in with...")
name: "Credentials",
credentials: {
username: {
label: "Username",
type: "text",
placeholder: "jsmith",
},
password: {
label: "Password",
type: "password",
},
},
async authorize(credentials, req) {
const { username, password } = credentials as any;
const { data, error } = await supabase.from("tb_students_info").select("*").eq("username", username).eq("password", password)
const data1 = await supabase.from("tb_students_info").select("*")
if (!data && error || data && data.length === 0) {
return null
} else {
return data[0] as any
}
},
}),
],
callbacks: {
async jwt({ token, user }) {
return { ...token, ...user };
},
async session({ session, token, user }) {
session.user = token;
return session;
},
},
pages: {
signIn: "/",
},
};
const handler = NextAuth(authOptions)
export { handler as GET, handler as POST }
here @austere schooner
looks the same as mine tbh
oh man i'm having this issue with all my repo's somehow
you using the app directory?
suddenly?
check ur node and npm version maybe
nope, it never worked
hmm, what version that works for you?
18.16.0
ok, thank you!
it's v18.12.1 already
using yarn
dependencies": {
"@headlessui/react": "^1.7.14",
"@supabase/supabase-js": "^2.21.0",
"@types/node": "^20.0.0",
"@types/react-dom": "^18.0.0",
"axios": "^1.4.0",
"next": "latest",
"next-auth": "^4.22.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-toastify": "^9.1.2",
"tailwindcss": "^3.3.2"
},
my pacakges
have you checked https://github.com/uuidjs/uuid#getrandomvalues-not-supported