Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing the $.fn.idleTimeout() after it was initialized #37

Open
hrvojegolcic opened this issue Jul 19, 2016 · 1 comment
Open

Accessing the $.fn.idleTimeout() after it was initialized #37

hrvojegolcic opened this issue Jul 19, 2016 · 1 comment
Assignees
Labels

Comments

@hrvojegolcic
Copy link

hrvojegolcic commented Jul 19, 2016

In the README it's described that $.fn.idleTimeout().logout(); should destroy the session. This doesn't work correctly because it creates a new $.fn.idleTimeout(). object with its default settings and then redirect you to default redirectUrl, not the one that you specified in the previously created object. Hopefully there would be some interface where one could the same object after it was initialized already.

Workaround for me was to use it like this:
$idleTimeoutObj = $(document).idleTimeout({ ...
...
$idleTimeoutObj.logout()

Speaking of which, if this is going to be fixed, it can be taken in mind that this jQuery extension don't necessarily need to be executed on an element. It can be made as a plugin executed directly on jQuery object. So $.idleTimeout and $.idleTimeout() instead of $.fn.idleTimeout and $(document).idleTimeout()

I was trying to do it like this and it worked but there were some issues so I didn't commit my code. I also had the idea of implementing the object as a Singleton which might not be bad direction to go

@JillElaine
Copy link
Owner

I am not able to work on code development right now. I encourage you to fork the project.

@JillElaine JillElaine self-assigned this Feb 26, 2017
@JillElaine JillElaine added the bug label Feb 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants