Merge pull request #638 from OpenSignLabs/prafull-opensignlabs-patch-7

fix: redirect_uri mismatch in googleauth
This commit is contained in:
Amol
2024-04-23 16:13:01 +05:30
committed by GitHub
@@ -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();