(options = {})
| 988 | } |
| 989 | |
| 990 | logout (options = {}) { |
| 991 | options.type = 'POST' |
| 992 | options.url = '/auth/logout' |
| 993 | window?.FB?.logout?.() |
| 994 | if (!options.success) { |
| 995 | options.success = () => { |
| 996 | globalVar.application.tracker.identifyAfterNextPageLoad() |
| 997 | return globalVar.application.tracker.resetIdentity().finally(() => { |
| 998 | const location = _.result(globalVar.currentView, 'logoutRedirectURL') |
| 999 | this.clearUserSpecificLocalStorage?.() |
| 1000 | // Clear cookie consent on logout to prevent shared device issues |
| 1001 | this.clearCookieConsent() |
| 1002 | if (location) { |
| 1003 | window.location = location |
| 1004 | } else { |
| 1005 | window.location.reload() |
| 1006 | } |
| 1007 | }) |
| 1008 | } |
| 1009 | } |
| 1010 | |
| 1011 | return this.fetch(options) |
| 1012 | } |
| 1013 | |
| 1014 | clearCookieConsent () { |
| 1015 | // Clear the cookie consent cookie so the next user on this device can make their own choice |
no test coverage detected