Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store github token in session storage, remove on logout #13947

Merged
merged 1 commit into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dashboard/src/components/api/che-keycloak.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class CheKeycloak {
}

logout(): void {
window.sessionStorage.setItem('oidcDashboardRedirectUrl', location.href);
window.sessionStorage.removeItem('githubToken');
window.sessionStorage.setItem('oidcDashboardRedirectUrl', location.href);
this.keycloak.logout({});
}

Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/components/github/github-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ export class GitHubService {
.factory('gitHubTokenStore', function () {
return {
setToken: function (token: string) {
localStorage.setItem('gitHubToken', token); // jshint ignore:line
sessionStorage.githubToken = token;
},
getToken: function () {
return localStorage.getItem('gitHubToken'); // jshint ignore:line
return sessionStorage.githubToken;
}
};
}).factory('gitHubApiUtils', ['gitHubApiUrlRoot', function (gitHubApiUrlRoot: string) {
Expand Down