Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "core/CvLogout"

Index

Variables

CvLogout

CvLogout: ClassicComponentClass<CvLogoutProps> = React.createClass<CvLogoutProps, CvLogoutState>({mixins: [CvBaseMixin],getChildContext: function() {return this.getDefaultChildContext();},getDefaultProps: function () {return { renderer:null, logoutListeners: [] }},render: function () {if(this.props.renderer) {return this.props.renderer(this.getChildContext().cvContext, this._getCallbackObject());} else {return null;}},_getCallbackObject: function():CvLogoutCallback {return {isLoggedIn: ():boolean => {return this.catavolt().isLoggedIn;},logout: ():void => {let tenantId = null;if(this.catavolt().sessionContextTry.isSuccess){tenantId = this.catavolt().sessionContextTry.success.tenantId;} else {const sessionContext:SessionContext = CvSessionManager.getSession();if(sessionContext) {tenantId = sessionContext.tenantId;}}(CvLogout as any).performLogout(this.catavolt(), this.eventRegistry(), tenantId, this.props.logoutListeners);}}},statics : {performLogout: function (catavolt:AppContext, eventRegistry:CvEventRegistry,tenantId:string, logoutListeners?:Array<(event:CvEvent<CvLogoutResult>)=>void>):void {if(catavolt.isLoggedIn) {catavolt.logout().onComplete((result:Try<VoidResult>) => {(CvLogout as any).postLogout(eventRegistry, tenantId, logoutListeners);});} else {(CvLogout as any).postLogout(eventRegistry, tenantId, logoutListeners);}},postLogout: function (eventRegistry:CvEventRegistry, tenantId:string, logoutListeners?:Array<(event:CvEvent<CvLogoutResult>)=>void>):void {CvSessionManager.removeSession();const event:CvEvent<CvLogoutResult> = {type: CvEventType.LOGOUT,eventObj: {tenantId: tenantId}};eventRegistry.publish<CvLogoutResult>(event, false);if(logoutListeners) {logoutListeners.forEach((listener)=> {listener(event)});}eventRegistry.clearAll();}}})

Generated using TypeDoc