is there any way to get clientId and clientSecret from a async function per each singin request #10920
Answered
by
k-taro56
feyzullahyildiz
asked this question in
Help
-
I do have a super-admin page for only super-admins. They can update clientId and clientSecret at the runtime. We planned to store these values in our database. I want to use new clientId and clientSecret values after the updates. I cannot do that right now. import NextAuth from "next-auth";
import GoogleProvider from "next-auth/providers/google";
import db from "@db";
export const authOptions = {
providers: [
GoogleProvider({
name: "google",
clientId: async () => {
const settings = await db.Settings.findOne();
return settings.googleAuth.clientId
},
clientSecret: async () => {
const settings = await db.Settings.findOne();
return settings.googleAuth.clientSecret
},
|
Beta Was this translation helpful? Give feedback.
Answered by
k-taro56
May 18, 2024
Replies: 1 comment
-
Hi, next-auth does not automatically update database values. Thank you. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
feyzullahyildiz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
next-auth does not automatically update database values.
If you need to update values after sign-in time, you must update the database manually.
Thank you.