feat: add OIDC login support
- Introduced OIDC configuration options in config.example.yaml. - Added OIDC client initialization and routes for OIDC login, callback, and exchange. - Implemented OIDC login service to handle user authentication via OIDC. - Created frontend components for OIDC login and callback handling. - Updated user creation logic to support OIDC users and their identities. - Enhanced error handling for OIDC login processes.
This commit is contained in:
@@ -26,6 +26,16 @@ export async function exchangeWxWorkTicket(ticket: string) {
|
||||
return data
|
||||
}
|
||||
|
||||
export async function exchangeOIDCTicket(ticket: string) {
|
||||
const data = await request<AuthSession>("/api/auth/oidc_exchange", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ ticket }),
|
||||
skipAuth: true,
|
||||
})
|
||||
writeSession(data)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function fetchProfile() {
|
||||
return request<AuthSession>("/api/auth/profile")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user