fix: redirect_uri mismatch in googleauth

This commit is contained in:
prafull-opensignlabs
2024-04-23 12:31:47 +05:30
committed by GitHub
parent eddf70f102
commit ed1120927c
@@ -17,7 +17,9 @@ export default async function gooogleauth(request, response) {
const clientId = process.env.GOOGLE_CLIENT_ID;
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
const redirectUri =
baseUrl?.hostname === 'localhost' ? 'http://localhost:3000' : baseUrl.origin; // Should match the redirect URI used in the authorization request
baseUrl?.hostname === 'localhost'
? 'http://localhost:3000'
: 'https://console.opensignlabs.com'; // Should match the redirect URI used in the authorization request
const tokenEndpoint = 'https://oauth2.googleapis.com/token';
const params = new URLSearchParams();