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

'token expired' on different time zones #638

Closed
wcone opened this issue Jan 22, 2019 · 7 comments
Closed

'token expired' on different time zones #638

wcone opened this issue Jan 22, 2019 · 7 comments
Labels
bug 🐞 Something isn't working

Comments

@wcone
Copy link

wcone commented Jan 22, 2019

Hi i'm quite new to this and docker.

i setup a v2.0.0 with docker on machine A in the local network and everything works like a charm.
i tried to access the filebrowser from machine B in the same local network but somehow i'm getting "invalid credential" error message. I've checked the token return on jwt, seems valid and with proper expiry date.

i proceed with a "noAuth" config and this time round on machine B i'm getting "Uncaught (in promise) Error: token expired" from the console.
screenshot 2019-01-22 at 2 49 42 pm

this is how i ran the docker:
docker run -d --privileged --name=filebrowser -v <root path>:/srv -v <path to json>:/.filebrowser.json -p 80:80 filebrowser/filebrowser:v2.0.0

and this is the json config:
{ "port": 80, "noAuth": true, "baseURL": "", "address": "", "log": "stdout", "database": "/database.db", "root": "/srv" }

I've tried v1.11.0 and is working as expected.
i'm not sure if i missed out anything for v2.0.0 but any help is appreciated.
Thank you!

@hacdias
Copy link
Member

hacdias commented Jan 23, 2019

@wcone could you try cleaning up the cache and cookies please?

@wcone
Copy link
Author

wcone commented Jan 24, 2019

@hacdias i figured out why... my machine A was running on a different time zone. After correcting the time it works seamlessly thank you.

@wcone wcone closed this as completed Jan 24, 2019
@hacdias
Copy link
Member

hacdias commented Jan 24, 2019

@wcone oh, it shouldn't happen though. I'll reopen this.

@hacdias hacdias reopened this Jan 24, 2019
@hacdias hacdias changed the title Error: token expired 'token expired' on different time zones Jan 24, 2019
@hacdias hacdias added the bug 🐞 Something isn't working label Jan 24, 2019
@laleveille
Copy link

laleveille commented Feb 8, 2019

Same problem, but my machines are running on same time zone.
Cache and cookies cleared, everything is fine.

@ttys3
Copy link
Contributor

ttys3 commented Apr 22, 2019

@hacdias I also noticed this problem. (and I've wrote an article http://nanodm.net/post/why-filebrowser-raise-wrong-credentials-error-even-with-right-credentials/ )

it is a frontend code problem.
I think the js code should not determine the expiration status:

frontend/src/utils/auth.js

  if (Math.round(new Date().getTime() / 1000) > data.exp) {
    throw new Error('token expired')
  }

@hacdias
Copy link
Member

hacdias commented Apr 23, 2019

@ttys3, what would you recommend? Just remove that code and let the backend determine it? If so, could you open a PR for that ? 😃

@hacdias
Copy link
Member

hacdias commented Jan 9, 2020

I'm closing this since this repository will be archived. Please read the information on the README for more information. Thanks for all your contributions!

@hacdias hacdias closed this as completed Jan 9, 2020
ramiresviana added a commit to ramiresviana/filebrowser that referenced this issue Jan 16, 2020
ramiresviana added a commit to ramiresviana/filebrowser that referenced this issue Jan 16, 2020
ramiresviana added a commit to ramiresviana/filebrowser that referenced this issue Jan 16, 2020
ramiresviana added a commit to ramiresviana/filebrowser that referenced this issue Jun 17, 2020
monkeyWie pushed a commit to monkeyWie/filebrowser that referenced this issue Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants