refactor: remove unused OpenAIOAuthOptions after Sora platform removal
The options parameter only served to switch between 'openai' and 'sora' platforms. With Sora removed, the parameter is unnecessary.
This commit is contained in:
@@ -2898,7 +2898,7 @@ const appStore = useAppStore()
|
|||||||
|
|
||||||
// OAuth composables
|
// OAuth composables
|
||||||
const oauth = useAccountOAuth() // For Anthropic OAuth
|
const oauth = useAccountOAuth() // For Anthropic OAuth
|
||||||
const openaiOAuth = useOpenAIOAuth({ platform: 'openai' }) // For OpenAI OAuth
|
const openaiOAuth = useOpenAIOAuth() // For OpenAI OAuth
|
||||||
const geminiOAuth = useGeminiOAuth() // For Gemini OAuth
|
const geminiOAuth = useGeminiOAuth() // For Gemini OAuth
|
||||||
const antigravityOAuth = useAntigravityOAuth() // For Antigravity OAuth
|
const antigravityOAuth = useAntigravityOAuth() // For Antigravity OAuth
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
// OAuth composables
|
// OAuth composables
|
||||||
const claudeOAuth = useAccountOAuth()
|
const claudeOAuth = useAccountOAuth()
|
||||||
const openaiOAuth = useOpenAIOAuth({ platform: 'openai' })
|
const openaiOAuth = useOpenAIOAuth()
|
||||||
const geminiOAuth = useGeminiOAuth()
|
const geminiOAuth = useGeminiOAuth()
|
||||||
const antigravityOAuth = useAntigravityOAuth()
|
const antigravityOAuth = useAntigravityOAuth()
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
// OAuth composables
|
// OAuth composables
|
||||||
const claudeOAuth = useAccountOAuth()
|
const claudeOAuth = useAccountOAuth()
|
||||||
const openaiOAuth = useOpenAIOAuth({ platform: 'openai' })
|
const openaiOAuth = useOpenAIOAuth()
|
||||||
const geminiOAuth = useGeminiOAuth()
|
const geminiOAuth = useGeminiOAuth()
|
||||||
const antigravityOAuth = useAntigravityOAuth()
|
const antigravityOAuth = useAntigravityOAuth()
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { useOpenAIOAuth } from '@/composables/useOpenAIOAuth'
|
|||||||
|
|
||||||
describe('useOpenAIOAuth.buildCredentials', () => {
|
describe('useOpenAIOAuth.buildCredentials', () => {
|
||||||
it('should keep client_id when token response contains it', () => {
|
it('should keep client_id when token response contains it', () => {
|
||||||
const oauth = useOpenAIOAuth({ platform: 'openai' })
|
const oauth = useOpenAIOAuth()
|
||||||
const creds = oauth.buildCredentials({
|
const creds = oauth.buildCredentials({
|
||||||
access_token: 'at',
|
access_token: 'at',
|
||||||
refresh_token: 'rt',
|
refresh_token: 'rt',
|
||||||
@@ -34,7 +34,7 @@ describe('useOpenAIOAuth.buildCredentials', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should keep legacy behavior when client_id is missing', () => {
|
it('should keep legacy behavior when client_id is missing', () => {
|
||||||
const oauth = useOpenAIOAuth({ platform: 'openai' })
|
const oauth = useOpenAIOAuth()
|
||||||
const creds = oauth.buildCredentials({
|
const creds = oauth.buildCredentials({
|
||||||
access_token: 'at',
|
access_token: 'at',
|
||||||
refresh_token: 'rt',
|
refresh_token: 'rt',
|
||||||
|
|||||||
@@ -24,11 +24,7 @@ export interface OpenAITokenInfo {
|
|||||||
|
|
||||||
export type OpenAIOAuthPlatform = 'openai'
|
export type OpenAIOAuthPlatform = 'openai'
|
||||||
|
|
||||||
interface UseOpenAIOAuthOptions {
|
export function useOpenAIOAuth() {
|
||||||
platform?: OpenAIOAuthPlatform
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useOpenAIOAuth(_options?: UseOpenAIOAuthOptions) {
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const endpointPrefix = '/admin/openai'
|
const endpointPrefix = '/admin/openai'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user