djamel8907
TTCTheo's Typesafe Cult
•Created by djamel8907 on 7/25/2023 in #questions
S3 or google cloud storage ?
Hey, i am creating an ecommerce using nextjs, and i wanted to ask which one of the two services, s3 and google cloud storage should i use to store images of the website?
10 replies
TTCTheo's Typesafe Cult
•Created by djamel8907 on 7/9/2023 in #questions
NextAuth sign in function not working properly
hey, i have nextauth set up with
credentialsProvider
on, i have the following onClick on a button:
however when i click on the button, the authorize function on the nextauth route doesn't get called( i put in some console logs to see it called)
any idea why?
note: i did add my own signIn page in the nextauth config
note2: it works just fine when i use the predfined sign in page
nextauth config:
import dbPromise from "@/modules/db";
import NextAuth from "next-auth/next";
import GoogleProvider from "next-auth/providers/google";
import CredentialsProvider from "next-auth/providers/credentials";
const handler = NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
CredentialsProvider({
name: "Credentials",
credentials: {
email: {
label: "Email",
type: "email",
placeholder: "[email protected]",
},
password: { label: "Password", type: "password" },
},
async authorize({ email, password }) {
console.log("next auth authorize function called");
try {
if (!email || !password) {
return null;
}
const dbUser = await (await dbPromise)
.db("auth")
.collection("users")
.findOne({ email });
if (dbUser && dbUser.password === password) {
return dbUser;
}
} catch (error) {
console.error(
"NEXT_AUTH_ERROR, this error happened during the authorize function",
error
);
}
console.log("next auth authorized function done");
},
}),
],
pages: {
signIn: "/login",
},
});
export const GET = handler;
export const POST = handler;2 replies
TTCTheo's Typesafe Cult
•Created by djamel8907 on 6/30/2023 in #questions
Terms and conditions + privacy policy
Hey everyone, hope u are doing great, i wanted to ask about the terms and conditions of a website, is there an easy way to get them ? since i have no experience in law, it's a bit annoying.
6 replies
TTCTheo's Typesafe Cult
•Created by djamel8907 on 4/21/2023 in #questions
which payment gateway should i pick if stripe is not available in my country?
Hey guys, hope u doing fine, i want to learn to set up payment gateways on websites, i wanted to set up stripe, but it is not available in my country, so i googled for alternatives and i found a bunch such as: 2CheckOut, paypal, braintree...ect, however, i really don't know which one to choose, so i wanted to ask here for orientations on which one should i pick, considering i use nextjs.
2 replies