Comments (14)
@threeaccents thanks for putting this together. This is biting others as well, see #47. I'm thinking we either change the default value to 1000
or set it to null and whoever wants to use refresh has to explicitly set a valid value. As far as I've seen, I think the common value people are using is 1000
.
@erichonkanen thoughts?
from ember-simple-auth-token.
@erichonkanen @jpadilla I would probably just do it ember style and change it to 1000 so I don't have to configure the null value, which might also cause some confusion with some users. Is having a check to see if the expiresAt
is valid out of the question?
from ember-simple-auth-token.
hey @threeaccents @jpadilla, so originally I had set the timeFactor to default to 1 really with the intention that people would either use the default (if their backend returned time in milliseconds) or set it to 1000 if their backend returned time in seconds (e.g. python).
It seems like a few people have been snagged by this so maybe we should update how that's handled? One solution is to default to 1000 but then people with a backend that defaults to milliseconds will get bit (node).
Another simple solution would be to change it to either "seconds" or "milliseconds" with a clear description, or make it null like you suggested and force it's definition in local config...
Any other suggestions?
from ember-simple-auth-token.
@jpadilla @erichonkanen I would just change it to 1000 since more people need that setting than 1. Also maybe I would just do a check to make sure its what expiresAt is supposed to be if not throw an error to alert the user. Since if timeFactor is set incorrectly the user is still logged in so the user has no feedback that something went wrong. I can write something up if you guys want. I also made a pull request to change the default to 1000.
from ember-simple-auth-token.
not sure if this is related but I just upgraded a project from < 1.6 to latest tagged related 0.7.1 and noticed that refreshing the page is now broken again...
not sure what the breaking change was but I also confirmed that it works fine in 0.6.0 so I'll try to look into that tomorrow!
from ember-simple-auth-token.
Has anyone found a work around for this? I am currently running version 0.7.3, using jwt authenticator and local storage's 'ember_simple_auth:session' key gets reset to an empty '{"secure":{}}' after browser refresh. I have tested with multiple browsers, certainly not a browser specific issue. It's a university project, anyone can take a look at my app configuration here if it helps, https://github.com/gcasanova/SocialDemand-Client. Please help!
from ember-simple-auth-token.
@gcasanova there was a fix submitted for issue w/refresh but hasn't been released yet. it's in master branch though, can you try using the latest master and see if it fixes it?
see: https://github.com/jpadilla/ember-cli-simple-auth-token/blob/master/addon/authenticators/jwt.js#L176
from ember-simple-auth-token.
@erichonkanen I think that commit is included in the latest release (0.7.3). I can confirm that the authenticator 'jwt.js' file included in the version I am running includes your fix though :(
from ember-simple-auth-token.
@gcasanova for your refresh fix add this to your config file
timeFactor: 1000,
from ember-simple-auth-token.
@gcasanova let me know if @threeaccents suggestion fixes it... I'm going to submit a pr that makes that the default since it seems to be a common issue
from ember-simple-auth-token.
Yes, this fixed it. Thanks a lot @threeaccents, much appreciated!
from ember-simple-auth-token.
@gcasanova np man. @erichonkanen I've already submitted a pr like 3 weeks ago with that change but for some reason when I changed it it made one of the tests fail. I looked into it and it seems to be a Travis bug with Emberjs because when I run the test on my local machine everything passes. Some other people where experiencing the same problem.
from ember-simple-auth-token.
@threeaccents ahh ok.. that's strange, what does the test fail with?
from ember-simple-auth-token.
@erichonkanen on Travis it says it fails but when I run the test locally on my machine everything passes. I saw some other people were having the same problem with ember apps.
from ember-simple-auth-token.
Related Issues (20)
- Demo app not working due to CORS issue HOT 2
- Some browser cannot write local Storage
- Possible to get a beta release that is is sync with ember-simple-auth 3.1.0-beta.0? HOT 71
- Travis CI HOT 1
- CI Integration HOT 1
- Release a version compatible with ESA v3.1.0 HOT 5
- Request to update dependency on ember-get-config to 0.3.0 HOT 3
- Refresh token after computer sleep HOT 10
- Fastboot best practice HOT 1
- Addon incompatible with latest version of ember-simple-auth HOT 3
- Transferring Ownership HOT 8
- addon/authenticators/jwt restore not called when page is refreshed HOT 1
- Dependency on old version of ember-cli-babel HOT 1
- Support for ESA v5 and v6 HOT 1
- refreshAccessToken not called on built project on Safari
- Thoughts on dropping support for very old ember and simple auth? HOT 1
- Updating the addon HOT 7
- Ember 5 support HOT 1
- server crash when using JWT with fastboot HOT 1
- Help Understanding RefreshLeeway
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-simple-auth-token.