File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -770,14 +770,16 @@ function embedNbApp () {
770770 this . activeClass = newClass
771771 } ,
772772 onSessionEnd : async function ( ) {
773- const token = localStorage . getItem ( "nb.user" ) ;
774- const config = { headers : { Authorization : 'Bearer ' + token } , params : { url : this . sourceURL } }
775- await axios . post ( `/api/spotlights/log/session/end` , {
776- action : 'SESSION_END' ,
777- type : 'NONE' ,
778- class_id : this . activeClass . id ,
779- role : this . user . role . toUpperCase ( )
780- } , config )
773+ if ( this . activeClass . id ) {
774+ const token = localStorage . getItem ( "nb.user" ) ;
775+ const config = { headers : { Authorization : 'Bearer ' + token } , params : { url : this . sourceURL } }
776+ await axios . post ( `/api/spotlights/log/session/end` , {
777+ action : 'SESSION_END' ,
778+ type : 'NONE' ,
779+ class_id : this . activeClass . id ,
780+ role : this . user . role . toUpperCase ( )
781+ } , config )
782+ }
781783 } ,
782784 onLogout : async function ( ) {
783785 await this . onSessionEnd ( )
You can’t perform that action at this time.
0 commit comments