From 02415839abe0c8aafdb0c705e65bf5c936134426 Mon Sep 17 00:00:00 2001 From: Sam <315859133@qq.com> Date: Fri, 6 Feb 2026 01:44:17 +0800 Subject: [PATCH] feat: add OAuth2 configuration to web-ele --- apps/web-ele/src/config/oauth.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 apps/web-ele/src/config/oauth.ts diff --git a/apps/web-ele/src/config/oauth.ts b/apps/web-ele/src/config/oauth.ts new file mode 100644 index 0000000..6618875 --- /dev/null +++ b/apps/web-ele/src/config/oauth.ts @@ -0,0 +1,22 @@ +export const oauthConfig = { + clientId: import.meta.env.VITE_OAUTH_CLIENT_ID || 'fengling-console', + redirectUri: import.meta.env.VITE_OAUTH_REDIRECT_URI || `${window.location.origin}/auth/callback`, + authUrl: import.meta.env.VITE_AUTH_SERVICE_URL || 'http://localhost:5000', + scope: import.meta.env.VITE_OAUTH_SCOPE || 'api offline_access openid profile email roles', + + endpoints: { + authorize: '/connect/authorize', + token: '/connect/token', + logout: '/connect/logout', + revocation: '/connect/revocation', + }, + + storageKeys: { + accessToken: 'oauth_access_token', + refreshToken: 'oauth_refresh_token', + expiresAt: 'oauth_expires_at', + codeVerifier: 'oauth_code_verifier', + state: 'oauth_state', + returnTo: 'oauth_return_to', + }, +};