#[Solved] Google Auth Issue

9 messages · Page 1 of 1 (latest)

deep shore
#

So, google authentication works in localhost, but not in the deployment.

code:

async createAuthSession(provider) {
  const currentDomain = process.env.NEXT_PUBLIC_WEBSITE_URL;
  this.account.createOAuth2Session(provider, `${currentDomain}/profile`, `${currentDomain}/auth`);
}

environment variable: NEXT_PUBLIC_WEBSITE_URL=(website name)

in google cloud console:
Authorised Javascript Origins:

Authorized redirect URIs (I'm aware that we don't need to add so many URIs)

error i receive is mentioned in the image as well, but adding it here too:

Error 400
Invalid success param: URL host must be one of: localhost, cloud.appwrite.io, *

Type

general_argument_invalid

it works splendidly in localhost, but not in deployment!

idle jungle
#

Try adding a hostname in the web app settings

deep shore
deep shore
split zephyr
prime juniper
#

how to make it work for the OAuth ??

nimble charm
nimble charm