Skip to content

Commit

Permalink
Add default logout URI if non defined in config (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
absoludity authored and Andres Martinez Gotor committed Nov 22, 2019
1 parent cc9c2d6 commit dc8b01a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dashboard/src/shared/Auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,11 @@ describe("Auth", () => {
expect(mockedAssign).toBeCalledWith(logoutURI);
expect(mockedLocalStorageRemove).toBeCalled();
});

it("defaults to the oauth2-proxy logout URI", () => {
Auth.unsetAuthCookie({ logoutURI: "", namespace: "ns", appVersion: "2" });

expect(mockedAssign).toBeCalledWith("/oauth2/sign_out");
});
});
});
2 changes: 1 addition & 1 deletion dashboard/src/shared/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Auth {
// JS, so force browser to load the sign-out URI (which expires the
// session cookie).
localStorage.removeItem(AuthTokenOIDCKey);
document.location.assign(config.logoutURI);
document.location.assign(config.logoutURI || "/oauth2/sign_out");
}

public static usingOIDCToken() {
Expand Down

0 comments on commit dc8b01a

Please sign in to comment.