mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Fix Netlify OAuth
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -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, {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user