Skip to content

Commit 40a18c8

Browse files
authored
Merge pull request #108 from alexisluque/logout-from-auth0
Logout from Auth0 authorization server
2 parents 1c73580 + d0a850a commit 40a18c8

5 files changed

Lines changed: 20 additions & 0 deletions

File tree

01-Login/src/Auth/Auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export default class Auth {
8484
// Remove isLoggedIn flag from localStorage
8585
localStorage.removeItem('isLoggedIn');
8686

87+
this.auth0.logout({
88+
return_to: window.location.origin
89+
});
90+
8791
// navigate to the home route
8892
history.replace('/home');
8993
}

02-User-Profile/src/Auth/Auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export default class Auth {
9898
// Remove isLoggedIn flag from localStorage
9999
localStorage.removeItem('isLoggedIn');
100100

101+
this.auth0.logout({
102+
return_to: window.location.origin
103+
});
104+
101105
// navigate to the home route
102106
history.replace('/home');
103107
}

03-Calling-an-API/src/Auth/Auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export default class Auth {
9999
// Remove isLoggedIn flag from localStorage
100100
localStorage.removeItem('isLoggedIn');
101101

102+
this.auth0.logout({
103+
return_to: window.location.origin
104+
});
105+
102106
// navigate to the home route
103107
history.replace('/home');
104108
}

04-Authorization/src/Auth/Auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export default class Auth {
108108
// Remove isLoggedIn flag from localStorage
109109
localStorage.removeItem('isLoggedIn');
110110

111+
this.auth0.logout({
112+
return_to: window.location.origin
113+
});
114+
111115
// navigate to the home route
112116
history.replace('/home');
113117
}

05-Token-Renewal/src/Auth/Auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ export default class Auth {
107107
// Remove isLoggedIn flag from localStorage
108108
localStorage.removeItem('isLoggedIn');
109109

110+
this.auth0.logout({
111+
return_to: window.location.origin
112+
});
113+
110114
// navigate to the home route
111115
history.replace('/home');
112116
}

0 commit comments

Comments
 (0)