Repository navigation
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()
Activity
[-][bug] - login params are required[/-][+][bug] - all login params are required[/+]eldadfux commentedon Sep 9, 2019
Yes, actually we had to change the original implementation after browsers started blocking 3rd party cookies that we were using for sessions. I guess the code examples got out of sync, I will make sure to fix it.
I will have to take a deeper look at the default param issue and see how we can fix it.
mgkimsal commentedon Sep 9, 2019
Thanks. I may try to dig on this this evening or tomorrow.
To clarify @eldadfux - I'm trying to call the appwrite SDK from JS, and am just trying to get back the 200 or 401 and the corresponding payload to process and move on from that login point. The payload coming back is always '400' because of these missing fields.
eldadfux commentedon Dec 15, 2019
We are trying to remove the extra params required for the login and register methods in this issue: #268, Hopefully this will work for modern browsers and we'll only use the extra params as fallback for older ones.
Merge pull request #11 from Mou-Ikkai/dependabot/composer/0.7.x/swool…
Merge pull request appwrite#11 from utopia-php/feat-schema
Merge pull request appwrite#11 from Goheljay/main
Merge pull request appwrite#11 from utopia-php/feat-improve-error
Gate Sentry export by span level, add Level enums (appwrite#11)
Merge pull request appwrite#11 from utopia-php/fix-tanstack-nitro-def…
Merge pull request appwrite#11 from Rutam21/APPW-4358
Merge pull request appwrite#11 from kibi11/codeofconduct
Merge pull request appwrite#11 from utopia-php/fix-head-method-routing
Merge pull request appwrite#11 from utopia-php/add-url-fragment-control
Merge pull request appwrite#11 from ronelgazar/feat-4388-add-code-ana…
Merge pull request appwrite#11 from utopia-php/feat/clickhouse-insert…
Merge pull request appwrite#11 from utopia-php/feat-param-enum-metadata
Merge pull request appwrite#11 from utopia-php/fix/normalize-domain-case
Merge pull request appwrite#11 from utopia-php/fix-update-db-to-0.6
Merge pull request appwrite#11 from utopia-php/feat-update-db-lib
Merge pull request appwrite#11 from muthuannamalai12/add-code-of-conduct
Merge pull request appwrite#11 from utopia-php/christyjacob4-patch-1