It's possible for a user's OAuth token to get invalidated by whoever manages the connected OpenSourceFriday OAuth app on GitHub. With the current behavior, the user will be shown a 500 error page which doesn't describe what went wrong or how to fix it.
Fixing the problem is pretty straightforward though, the user needs to sign out and sign back in to go through the OAuth flow again and generate a new token. To give a better overall experience, I've updated the UsersController#show action to catch the error when it occurs and then
sign the user out
redirect them to the homepage
prompt them to sign in again with a flash error message
I reproduced the issue when running the app locally per the README instructions (🙇 very helpful!) and with the change in this PR the user will end up seeing the following after being redirected:
I added the token to the english localization file but I don't speak the other languages to supply non-english translations.
It's possible for a user's OAuth token to get invalidated by whoever manages the connected OpenSourceFriday OAuth app on GitHub. With the current behavior, the user will be shown a 500 error page which doesn't describe what went wrong or how to fix it.
Fixing the problem is pretty straightforward though, the user needs to sign out and sign back in to go through the OAuth flow again and generate a new token. To give a better overall experience, I've updated the
UsersController#show
action to catch the error when it occurs and thenI reproduced the issue when running the app locally per the README instructions (🙇 very helpful!) and with the change in this PR the user will end up seeing the following after being redirected:
I added the token to the english localization file but I don't speak the other languages to supply non-english translations.