Files
dify/web/service/oauth-provider.ts
2025-08-25 19:40:18 +08:00

24 lines
550 B
TypeScript

import { post } from './base'
export type OAuthAppInfo = {
app_icon: string
app_label: Record<string, string>
scope: string
}
export type OAuthAuthorizeResponse = {
code: string
}
export async function fetchOAuthAppInfo(client_id: string, redirect_uri: string) {
return post<OAuthAppInfo>('/oauth/provider', {
body: { client_id, redirect_uri },
}, { silent: true })
}
export async function authorizeOAuthApp(client_id: string) {
return post<OAuthAuthorizeResponse>('/oauth/provider/authorize', {
body: { client_id },
})
}