mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 17:06:41 -05:00
feat: Add Refresh Token Support to Kick OAuth Provider (#6263)
This commit is contained in:
committed by
GitHub
parent
a9c986a27e
commit
b1102e3458
@@ -1,6 +1,10 @@
|
||||
import { betterFetch } from "@better-fetch/fetch";
|
||||
import type { OAuthProvider, ProviderOptions } from "../oauth2";
|
||||
import { createAuthorizationURL, validateAuthorizationCode } from "../oauth2";
|
||||
import {
|
||||
createAuthorizationURL,
|
||||
refreshAccessToken,
|
||||
validateAuthorizationCode,
|
||||
} from "../oauth2";
|
||||
|
||||
export interface KickProfile {
|
||||
/**
|
||||
@@ -53,6 +57,18 @@ export const kick = (options: KickOptions) => {
|
||||
codeVerifier,
|
||||
});
|
||||
},
|
||||
refreshAccessToken: options.refreshAccessToken
|
||||
? options.refreshAccessToken
|
||||
: async (refreshToken) => {
|
||||
return refreshAccessToken({
|
||||
refreshToken,
|
||||
options: {
|
||||
clientId: options.clientId,
|
||||
clientSecret: options.clientSecret,
|
||||
},
|
||||
tokenEndpoint: "https://id.kick.com/oauth/token",
|
||||
});
|
||||
},
|
||||
async getUserInfo(token) {
|
||||
if (options.getUserInfo) {
|
||||
return options.getUserInfo(token);
|
||||
|
||||
Reference in New Issue
Block a user