Fix Netlify OAuth

This commit is contained in:
Alex Gleason committed 2025-10-18 21:49:37 -05:00
1 parent 552f76766b
commit ffe5cba399
2 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -26,9 +26,9 @@ export function useNetlifyOAuth() {
clientSecret: import.meta.env.VITE_NETLIFY_OAUTH_CLIENT_SECRET || '',
authorizeUrl: 'https://app.netlify.com/authorize',
tokenUrl: 'https://api.netlify.com/oauth/token',
scope: 'deploy',
// Netlify doesn't use scope parameter - permissions are configured in the OAuth app settings
redirectUri: window.location.origin + '/oauth/netlify',
usePKCE: false, // Netlify doesn't require PKCE
usePKCE: false, // Netlify doesn't support PKCE
getUserInfo: async (accessToken: string, corsProxy: string) => {
const userUrl = proxyUrl(corsProxy, 'https://api.netlify.com/api/v1/user');
const userResponse = await fetch(userUrl, {
+6 -2
View File
@@ -8,7 +8,7 @@ export interface OAuthConfig {
clientSecret: string;
authorizeUrl: string;
tokenUrl: string;
scope: string;
scope?: string; // Optional - some providers don't use scopes
redirectUri: string;
usePKCE?: boolean;
getUserInfo?: (accessToken: string, corsProxy: string) => Promise<{
@@ -93,11 +93,15 @@ export function useOAuth(config: OAuthConfig) {
const params = new URLSearchParams({
client_id: config.clientId,
redirect_uri: config.redirectUri,
scope: config.scope,
state: state,
response_type: 'code',
});
// Add scope if provided (some providers don't use scopes)
if (config.scope) {
params.append('scope', config.scope);
}
// Add PKCE parameters if enabled
if (config.usePKCE) {
const codeVerifier = generateCodeVerifier();