Fix frontend mishandling of null userinfo (#1795)

* Fix frontend mishandling of null userinfo

If the authentication is disabled, the userinfo endpoint returns null.
This case needs to be handled.

 #1780

* Small fix for handling refesh tokens in auth
This commit is contained in:
bmccandless
2020-08-26 13:01:50 -07:00
committed by GitHub
parent ab1b9368a0
commit f8cdb12892
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ async function configFetch(dispatch) {
async function userInfoFetch(dispatch) {
return fetchJson("userinfo").then((response) => {
const userinfo = { ...response.userinfo };
const { userinfo } = response || {};
dispatch({
type: "userinfo load complete",
userinfo,
+3 -1
View File
@@ -29,7 +29,9 @@ class Tokens:
self.id_token = id_token
self.refresh_token = refresh_token
self.expires_at = expires_at
if not (access_token and id_token and refresh_token and expires_at):
# expires_at may be None after a token refresh, and so it is not checked here
if not (access_token and id_token and refresh_token):
raise KeyError(str(self.__dict__))