MCPcopy Index your code
hub / github.com/codecombat/codecombat / logout

Method logout

app/models/User.js:990–1012  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

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

Callers 3

'click #logout-link'Method · 0.45
'click #logout-link'Method · 0.45
onClickChangeAccountMethod · 0.45

Calls 6

clearCookieConsentMethod · 0.95
reloadMethod · 0.80
resetIdentityMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected