Changing Parameter Names in Custom Provider

Hello! I’m trying to use this library by registering a Korean service called Chzzk as a Custom Provider. However, this service requires the parameters clientId and redirectUri instead of the default client_id and redirect_uri when logging in. How can I change the parameter names used in the existing configuration? I tried the following code, but it didn’t work as expected. Thank you in advance for your help!
const db = client.db();

export const auth = betterAuth({
appName: 'service',
baseURL,
database: mongodbAdapter(db, {
client,
}),
plugins: [
genericOAuth({
config: [
{
providerId: 'chzzk',
clientId: process.env.CHZZK_CLIENT_ID!,
clientSecret: process.env.CHZZK_CLIENT_SECRET!,
authorizationUrl: `https://chzzk.naver.com/account-interlock`,
tokenUrl: 'https://openapi.chzzk.naver.com/auth/v1/token',
userInfoUrl:
'https://openapi.chzzk.naver.com/open/v1/users/me',
scopes: ['유저 정보 조회'],
authorizationUrlParams: {
response_type: 'code',
clientId: process.env.CHZZK_CLIENT_ID!,
redirectUri: `${baseURL}/api/auth/chzzk/callback`,
},
},
],
}),
bearer(),
admin(),
lastLoginMethod(),
],
});
const db = client.db();

export const auth = betterAuth({
appName: 'service',
baseURL,
database: mongodbAdapter(db, {
client,
}),
plugins: [
genericOAuth({
config: [
{
providerId: 'chzzk',
clientId: process.env.CHZZK_CLIENT_ID!,
clientSecret: process.env.CHZZK_CLIENT_SECRET!,
authorizationUrl: `https://chzzk.naver.com/account-interlock`,
tokenUrl: 'https://openapi.chzzk.naver.com/auth/v1/token',
userInfoUrl:
'https://openapi.chzzk.naver.com/open/v1/users/me',
scopes: ['유저 정보 조회'],
authorizationUrlParams: {
response_type: 'code',
clientId: process.env.CHZZK_CLIENT_ID!,
redirectUri: `${baseURL}/api/auth/chzzk/callback`,
},
},
],
}),
bearer(),
admin(),
lastLoginMethod(),
],
});
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?