What does the user plugin do when the user is not authenticated ?

Hello, I'm trying to integrate webix jet with my Auth API.
I'm using the user plugin and I wrote a login() function (in the session model) which returns a promise with the user info. The plugin correctly redirects the authenticated user to the specified page.
Problem is .... If the login() function does not return a promise with the user info, the plugin does nothing. Which is the expected behavious ? Any error message ? I need to understand what the user plugin would do in this case, to understand if I'm doing something wrong or not.
Thank you for the help


  • Hey @antlomb, according to this article about the User plugin this is the expected behaviour (key word must):

    login() must return a promise of user info as a string, object or anything else that is expected.

    If you want to make any modifications I suggest you take a look towards the source code: https://github.com/webix-hub/webix-jet/blob/master/sources/plugins/User.ts.

  • Hi @dzmitry, thank you. Ok, now I understand, I always MUST return a resolved promise, with the user info (or null if not logged-in). I cannot return a rejected promise. Or at least that's how I solved the issue. Thank you for linking the source code to me.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!