{"action":"closed","issue":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/298","labels_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/298/comments","events_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/298/events","html_url":"https://github.com/tymondesigns/jwt-auth/issues/298","id":112306450,"number":298,"title":"refresh token on available","user":{"login":"ssi-anik","id":2676602,"avatar_url":"https://avatars.githubusercontent.com/u/2676602?v=3","gravatar_id":"","url":"https://api.github.com/users/ssi-anik","html_url":"https://github.com/ssi-anik","followers_url":"https://api.github.com/users/ssi-anik/followers","following_url":"https://api.github.com/users/ssi-anik/following{/other_user}","gists_url":"https://api.github.com/users/ssi-anik/gists{/gist_id}","starred_url":"https://api.github.com/users/ssi-anik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssi-anik/subscriptions","organizations_url":"https://api.github.com/users/ssi-anik/orgs","repos_url":"https://api.github.com/users/ssi-anik/repos","events_url":"https://api.github.com/users/ssi-anik/events{/privacy}","received_events_url":"https://api.github.com/users/ssi-anik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-20T07:46:32Z","updated_at":"2015-11-24T20:17:21Z","closed_at":"2015-11-24T20:17:21Z","body":"Some routes doesn't need the token and some routes does need the token. but if I apply middleware jwt.auth it will validate if the token is a valid authenticated user or not. and jwt.refresh will refresh the token on available. They both throw some exceptions and halt the program.\r\n\r\nNow if we visit those pages without any middleware & move back to authentication required pages then few minutes later the token will not be working. That's why thinking to build a common middleware if the token is available, refresh that token otherwise, leave that. \r\nIs it a good practise or there is any facility available previously?\r\n\r\n\r\nThanks."}}