feat: add OAuth2 configuration to web-ele

This commit is contained in:
Sam 2026-02-06 01:44:17 +08:00
parent bad60b5108
commit 02415839ab

View File

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