Giter Club home page Giter Club logo

Comments (14)

jpadilla avatar jpadilla commented on May 16, 2024

@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.

 avatar commented on May 16, 2024

@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.

hoIIer avatar hoIIer commented on May 16, 2024

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.

 avatar commented on May 16, 2024

@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.

hoIIer avatar hoIIer commented on May 16, 2024

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.

gcasanova avatar gcasanova commented on May 16, 2024

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.

hoIIer avatar hoIIer commented on May 16, 2024

@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.

gcasanova avatar gcasanova commented on May 16, 2024

@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.

 avatar commented on May 16, 2024

@gcasanova for your refresh fix add this to your config file

timeFactor: 1000,

from ember-simple-auth-token.

hoIIer avatar hoIIer commented on May 16, 2024

@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.

gcasanova avatar gcasanova commented on May 16, 2024

Yes, this fixed it. Thanks a lot @threeaccents, much appreciated!

from ember-simple-auth-token.

 avatar commented on May 16, 2024

@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.

hoIIer avatar hoIIer commented on May 16, 2024

@threeaccents ahh ok.. that's strange, what does the test fail with?

from ember-simple-auth-token.

 avatar commented on May 16, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.