-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
Calling from JS aw.auth.login(this.username, this.password);
yields back
{"message":"Invalid success: URL host must be one of: https://appwrite.io, https://appwrite.test, http://appwrite.test, https://localhost, http://localhost, http://localhost/v1","code":400,"file":"/usr/share/nginx/html/vendor/utopia-php/framework/src/App.php","line":456,"trace":[{"file":"/usr/share/nginx/html/vendor/utopia-php/framework/src/App.php","line":395,"function":"validate","class":"Utopia\App","type":"->","args":["success",{"default":null,"validator":{},"description":"URL to redirect back to your app after a successful login attempt.","optional":true,"value":null},"null"]},{"file":"/usr/share/nginx/html/app/app.php","line":793,"function":"run","class":"Utopia\App","type":"->","args":[{},{}]},{"file":"/usr/share/nginx/html/public/index.php","line":27,"args":["/usr/share/nginx/html/app/app.php"],"function":"include"}],"version":"latest"}
The 'success' and 'failure' URLs are still required by the backend.
This might be related to
utopia-php/http@5ac8c91#diff-58980ac23a3a9a0b92abd9805eed1e78
in Utopia forcing default values? It's a bit hard to follow as I'm not sure what 'param' method is doing here:
appwrite/app/controllers/auth.php
Line 35 in 6a5f546
| ->param('success', null, function () use ($clients) {return new Host($clients);}, 'Redirect when registration succeed', true) |
Is param() call creating/invoking a validator directly?
The docs/examples are somewhat out of sync as well, as docs show
appwrite.users.login()
but it should be
appwrite.auth.login()