Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/envs/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const getAppConfig = () => {

SSRF_ALLOW_PRIVATE_IP_ADDRESS: z.boolean().optional(),
SSRF_ALLOW_IP_ADDRESS_LIST: z.string().optional(),
MARKET_BASE_URL: z.string().optional(),
},
runtimeEnv: {
// Sentry
Expand Down Expand Up @@ -88,6 +89,7 @@ export const getAppConfig = () => {

SSRF_ALLOW_PRIVATE_IP_ADDRESS: process.env.SSRF_ALLOW_PRIVATE_IP_ADDRESS === '1',
SSRF_ALLOW_IP_ADDRESS_LIST: process.env.SSRF_ALLOW_IP_ADDRESS_LIST,
MARKET_BASE_URL: process.env.MARKET_BASE_URL,
},
});
};
Expand Down
21 changes: 21 additions & 0 deletions src/libs/oidc-provider/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import urlJoin from 'url-join';

import { appEnv } from '@/envs/app';

const marketBaseUrl = new URL(appEnv.MARKET_BASE_URL ?? 'https://market.lobehub.com').origin;

/**
* 默认 OIDC 客户端配置
*/
Expand Down Expand Up @@ -35,6 +37,7 @@ export const defaultClients: ClientMetadata[] = [
// 标记为公共客户端客户端,无密钥
token_endpoint_auth_method: 'none',
},

{
application_type: 'native', // 移动端使用 native 类型
client_id: 'lobehub-mobile',
Expand All @@ -50,6 +53,24 @@ export const defaultClients: ClientMetadata[] = [
// 公共客户端,无密钥
token_endpoint_auth_method: 'none',
},

{
application_type: 'web',
client_id: 'lobehub-market',
client_name: 'LobeHub Marketplace',
grant_types: ['authorization_code', 'refresh_token'],
logo_uri: 'https://hub-apac-1.lobeobjects.space/lobehub-desktop-icon.png',
post_logout_redirect_uris: [
urlJoin(marketBaseUrl!, '/lobehub-oidc/logout'),
'http://localhost:8787/lobehub-oidc/logout',
],
redirect_uris: [
urlJoin(marketBaseUrl!, '/lobehub-oidc/consent/callback'),
'http://localhost:8787/lobehub-oidc/consent/callback',
],
response_types: ['code'],
token_endpoint_auth_method: 'none',
},
];

/**
Expand Down
Loading
Loading