Skip to content

[bug] - all login params are required #11

Closed

Description

@mgkimsal

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:

->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

  1. changed the title [-][bug] - login params are required[/-] [+][bug] - all login params are required[/+] on Sep 9, 2019
  2. added
    bug
    on Sep 9, 2019
  3. self-assigned this
    on Sep 9, 2019
  4. eldadfux commented on Sep 9, 2019

    @eldadfux
    Member

    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.

  5. mgkimsal commented on Sep 9, 2019

    @mgkimsal
    Author

    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.

  6. added
    help wanted
    on Sep 13, 2019
  7. eldadfux commented on Dec 15, 2019

    @eldadfux
    Member

    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.

  8. added a commit that references this issue on Oct 1, 2020
  9. added a commit that references this issue on Sep 16, 2026
  10. added a commit that references this issue on Sep 24, 2026
  11. added a commit that references this issue on Sep 24, 2026
  12. added a commit that references this issue on Sep 25, 2026
  13. added 9 commits that reference this issue on Sep 25, 2026
  14. added a commit that references this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions