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', + }, +};