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

How to modify default token expiration time #21

Open
Nmuta opened this issue Sep 1, 2019 · 1 comment
Open

How to modify default token expiration time #21

Nmuta opened this issue Sep 1, 2019 · 1 comment

Comments

@Nmuta
Copy link

Nmuta commented Sep 1, 2019

Hi, I'm using SimpleCommand in a Rails app with an Angular 7 front end. It all works beautifully and the auth is smooth and great.

I'm doing a very simple implementation similar to the one you have here in Github example.

My question is: how do I adjust the expiration date of the token ? It seems to default to 24 hours ( I think )

Let me know if you can, or point me in the right direction... thanks !

@bmorrall
Copy link
Contributor

bmorrall commented Mar 1, 2020

Disclaimer: not a member of the SimpleCommand team

SimpleCommand doesn't handle auth or token expiry itself, it's just a utility that provides a safe place to encapsulate that logic, which you are responsible for providing.

It sounds like you came here from a JWT tutorial like I did. You need to set the expiration date of the token when you create it, it's too late by the time you're using SimpleCommand.

Here's an example where a Token is created with an expiry time, from the offical ruby-jwt gem: https://github.com/jwt/ruby-jwt#expiration-time-claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants