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

run a function continuously in ionic 3 mobile app #4678

Open
pradeepaanumalla opened this issue Jul 18, 2018 · 3 comments
Open

run a function continuously in ionic 3 mobile app #4678

pradeepaanumalla opened this issue Jul 18, 2018 · 3 comments
Labels
docs Related to the content of the documentation itself (i.e. not any particular feature on sailsjs.com) does this answer your question?

Comments

@pradeepaanumalla
Copy link

I will get an access token when i login but what i want is like this token will expire in 3 minutes,so if the user using the app also after 3 minutes the app should show the login page again how can i achieve it.

I can write a function in app.component.ts but it will work only when the user opens the app but i want to navigate to login when the user is using the app also i.e.(assume he is in the page after login)

@raqem
Copy link
Contributor

raqem commented Aug 1, 2018

You are looking for a way to logout users after 3 minutes of being logged in, is that right?

@rachaelshaw
Copy link
Member

@pradeepaanumalla to make it so users are automatically logged out in 3 minutes, you can set this.req.session.cookie.maxAge in your login action like so:

this.req.session.cookie.maxAge = 3*60*1000; // 3 minutes

Then, make sure you're using an is-logged-in policy to protect any actions that non-logged-in users shouldn't be allowed to do.

@raqem raqem transferred this issue from balderdashy/sails-docs Mar 12, 2019
@raqem raqem added does this answer your question? docs Related to the content of the documentation itself (i.e. not any particular feature on sailsjs.com) and removed needs cleanup labels Mar 12, 2019
@balderdashy balderdashy deleted a comment from sailsbot Mar 12, 2019
@raqem
Copy link
Contributor

raqem commented Mar 12, 2019

Hi @pradeepaanumalla,
We are in the processes of moving all open Sails issues into one repo, this and all issues now lives on the Sails repo.
~Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Related to the content of the documentation itself (i.e. not any particular feature on sailsjs.com) does this answer your question?
Development

No branches or pull requests

4 participants