Skip to content

Commit 184f941

Browse files
committed
Add support for session lock
1 parent 4c4a3c1 commit 184f941

4 files changed

Lines changed: 246 additions & 108 deletions

File tree

README.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,25 @@ studio.api.Client(uri, notificationListener)
113113
class NotificationListener {
114114
applicationAcceptanceRequested(request) {
115115
return new Promise(function(resolve, reject) {
116-
window.confirm(request.systemUseNotification()) ? resolve() : reject();
116+
if (request.systemUseNotification()) {
117+
// Pop up a System Use Notification message and ask for confirmation to continue,
118+
// then based on the user answer call either resolve() or reject()
119+
}
120+
else
121+
resolve();
117122
});
118123
}
119124
120125
credentialsRequested(request) {
121126
return new Promise(function(resolve, reject) {
122-
resolve({Username: "cdpuser", Password: "cdpuser"});
127+
if (request.userAuthResult().code() == studio.api.CREDENTIALS_REQUIRED) {
128+
// Do something to gather username and password variables (either sync or async way) and then call:
129+
resolve({Username: "cdpuser", Password: "cdpuser"});
130+
}
131+
if (request.userAuthResult().code() == studio.api.REAUTHENTICATIONREQUIRED) {
132+
// Pop user a message that idle lockout was happened and server requires new authentication to continue:
133+
resolve({Username: "cdpuser", Password: "cdpuser"});
134+
}
123135
});
124136
}
125137
}

0 commit comments

Comments
 (0)