Back

Auth redirect error 400 Invalid `success` param:

  • 0
  • Self Hosted
  • Auth
  • Web
armanhadi
24 Mar, 2024, 11:14

I get this error :

TypeScript
Invalid `success` param: URL host must be one of: localhost, appwrite.seedkurdistan.org, control.seedkurdistan.org, portal.seedkurdistan.org

Type

general_argument_invalid```

I'm tring to login with google auth in my Sveltekit webapp localhost.

this is the url
`https://appwrite.seedkurdistan.org/v1/account/sessions/oauth2/google?success=%27http%3A%2F%2Flocalhost%27%3B&project=65d0ba52e38aa86e6994`

I added web platfrom inside my appwrite with a hostname `localhost`
TL;DR
Issue: Error 400 - Invalid `success` param due to incorrect URL host when trying to log in with Google Auth on a Sveltekit webapp. Solution: - The error occurs because the URL host must be one of the whitelisted domains (localhost, appwrite.seedkurdistan.org, control.seedkurdistan.org, portal.seedkurdistan.org). - In this case, the provided URL host is 'localhost' which is not in the whitelist. - Make sure to update the `success` parameter URL host to one of the allowed domains. - Add the correct domain to the appwrite web platform settings within
armanhadi
24 Mar, 2024, 11:15

@D5

D5
24 Mar, 2024, 11:24

What's your Appwrite version? And the SDK version?

D5
24 Mar, 2024, 11:24

What do you get in logs? You can get them by running: docker compose logs appwrite

armanhadi
24 Mar, 2024, 11:25

appwrite 1.5.3 sdk: "appwrite": "^14.0.0",

armanhadi
24 Mar, 2024, 11:31
TypeScript
appwrite  | [Error] Type: Utopia\Exception
appwrite  | [Error] Message: Invalid `success` param: URL host must be one of: localhost, appwrite.seedkurdistan.org, control.seedkurdistan.org, portal.seedkurdistan.org
appwrite  | [Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
appwrite  | [Error] Line: 765
appwrite  | [Error] Timestamp: 2024-03-24T11:11:41+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/account
appwrite  | [Error] Type: Appwrite\Extend\Exception
appwrite  | [Error] Message: User (role: guests) missing scope (account)
appwrite  | [Error] File: /usr/src/code/app/controllers/shared/api.php
appwrite  | [Error] Line: 272
appwrite  | [Error] Timestamp: 2024-03-24T11:14:14+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/account/sessions/oauth2/:provider
appwrite  | [Error] Type: Utopia\Exception
appwrite  | [Error] Message: Invalid `success` param: URL host must be one of: localhost, appwrite.seedkurdistan.org, control.seedkurdistan.org, portal.seedkurdistan.org
appwrite  | [Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
appwrite  | [Error] Line: 765
root@seed-appwrite-server-475237a:/home/root/appwrite# ```
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more