Sage-Bionetworks / projectLive_NF

Live view of projects of funding partners
2 stars 3 forks source link

Add error handling for expired oauth token #167

Closed allaway closed 2 years ago

allaway commented 2 years ago

If you load a url with an expired oauth token, for example, if you refresh the app, e.g. https://shiny.synapse.org/users/jbanerjee/projectLive/?state=432e4UWH1H&code=263e4710-e83c-493c-b631-b2e977a32079, the app will disconnect without warning. It would be great if this was handled more gracefully (e.g. detect invalid token, punt users to login page).

I'm posting this over in the Data Curator App repo as well, so perhaps the solution could be the same as that one. https://github.com/Sage-Bionetworks/data_curator/issues/246

allaway commented 2 years ago

A solution for this issue can be found here: https://github.com/Sage-Bionetworks/data_curator/pull/204

@jaybee84 / @andrewelamb what do you think of adding this?

andrewelamb commented 2 years ago

I can look into that in the near future :)

andrewelamb commented 2 years ago

@rrchai @BrunoGrandePhD

I'm adding this line:

tags$script(htmlwidgets::JS("setTimeout(function(){history.pushState({}, 'Data Curator', window.location.pathname);},2000);"))

Obviously 'Data Curator' needs to be changed, but to what?

rrchai commented 2 years ago

@andrewelamb It is the page title, e.g. "ProjectLive NF"