@@ -53,14 +53,8 @@ export class AuthenticationHelper {
53
53
}
54
54
55
55
let getUserInformationFunction = ( ) => {
56
- return new Promise < ResponsePackage < string > > ( ( resolve2 , reject2 ) => {
57
- this . getClipperInfoCookie ( clipperId ) . then ( ( cookie ) => {
58
- this . retrieveUserInformation ( clipperId , cookie ) . then ( ( result ) => {
59
- resolve2 ( result ) ;
60
- } , ( errorObject ) => {
61
- reject2 ( errorObject ) ;
62
- } ) ;
63
- } ) ;
56
+ return this . getClipperInfoCookie ( clipperId ) . then ( ( cookie ) => {
57
+ return this . retrieveUserInformation ( clipperId , cookie ) ;
64
58
} ) ;
65
59
} ;
66
60
@@ -79,15 +73,15 @@ export class AuthenticationHelper {
79
73
this . user . set ( { updateReason : updateReason , writeableCookies : writeableCookies } ) ;
80
74
}
81
75
82
- resolve ( this . user . get ( ) ) ;
83
76
} , ( error : OneNoteApi . GenericError ) => {
84
77
getInfoEvent . setStatus ( Log . Status . Failed ) ;
85
78
getInfoEvent . setFailureInfo ( error ) ;
86
79
87
80
this . user . set ( { updateReason : updateReason } ) ;
88
- resolve ( this . user . get ( ) ) ;
89
81
} ) . then ( ( ) => {
90
82
this . logger . logEvent ( getInfoEvent ) ;
83
+
84
+ resolve ( this . user . get ( ) ) ;
91
85
} ) ;
92
86
} ) ;
93
87
}
@@ -186,9 +180,10 @@ export class AuthenticationHelper {
186
180
}
187
181
188
182
/**
189
- * Determins whether or not the given string is valid JSON and has the flag which lets us know if cookies are enabled.
183
+ * Determines whether or not the given string is valid JSON and has the flag which lets us know if cookies are enabled.
190
184
*/
191
185
protected isThirdPartyCookiesEnabled ( userInfo : UserInfoData ) : boolean {
192
- return userInfo . cookieInRequest ;
186
+ // Note that we are returning true by default to ensure the N-1 scenario.
187
+ return userInfo . cookieInRequest ? userInfo . cookieInRequest : true ;
193
188
}
194
189
}
0 commit comments