Skip to content

Commit cf85ac8

Browse files
committed
update sample to use state, not data
1 parent 700180f commit cf85ac8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎sample/public/oidc-client-sample.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var client = new Oidc.OidcClient(settings);
3434
// functions for UI elements
3535
///////////////////////////////
3636
function signin() {
37-
client.createSigninRequest({ data: { bar: 15 } }).then(function(req) {
37+
client.createSigninRequest({ state: { bar: 15 } }).then(function(req) {
3838
log("signin request", req, "<a href='" + req.url + "'>go signin</a>");
3939
if (followLinks()) {
4040
window.location = req.url;
@@ -55,7 +55,7 @@ function processSigninResponse() {
5555
}
5656

5757
function signinDifferentCallback(){
58-
client.createSigninRequest({ data: { bar: 15 }, redirect_uri: 'http://localhost:5000/oidc-client-sample-callback.html' }).then(function(req) {
58+
client.createSigninRequest({ state: { bar: 15 }, redirect_uri: 'http://localhost:5000/oidc-client-sample-callback.html' }).then(function(req) {
5959
log("signin request", req, "<a href='" + req.url + "'>go signin</a>");
6060
if (followLinks()) {
6161
window.location = req.url;
@@ -66,7 +66,7 @@ function signinDifferentCallback(){
6666
}
6767

6868
function signout() {
69-
client.createSignoutRequest({ id_token_hint: signinResponse && signinResponse.id_token, data: { foo: 5 } }).then(function(req) {
69+
client.createSignoutRequest({ id_token_hint: signinResponse && signinResponse.id_token, state: { foo: 5 } }).then(function(req) {
7070
log("signout request", req, "<a href='" + req.url + "'>go signout</a>");
7171
if (followLinks()) {
7272
window.location = req.url;

‎sample/public/user-manager-sample.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function removeUser() {
100100
}
101101

102102
function startSigninMainWindow() {
103-
mgr.signinRedirect({data:'some data'}).then(function() {
103+
mgr.signinRedirect({state:'some data'}).then(function() {
104104
log("signinRedirect done");
105105
}).catch(function(err) {
106106
log(err);
@@ -116,31 +116,31 @@ function endSigninMainWindow() {
116116
}
117117

118118
function startSigninMainWindowDiffCallbackPage() {
119-
mgr.signinRedirect({data:'some data', redirect_uri: 'http://localhost:5000/user-manager-sample-callback.html'}).then(function() {
119+
mgr.signinRedirect({state:'some data', redirect_uri: 'http://localhost:5000/user-manager-sample-callback.html'}).then(function() {
120120
log("signinRedirect done");
121121
}).catch(function(err) {
122122
log(err);
123123
});
124124
}
125125

126126
function popupSignin() {
127-
mgr.signinPopup({data:'some data'}).then(function(user) {
127+
mgr.signinPopup({state:'some data'}).then(function(user) {
128128
log("signed in", user);
129129
}).catch(function(err) {
130130
log(err);
131131
});
132132
}
133133

134134
function iframeSignin() {
135-
mgr.signinSilent({data:'some data'}).then(function(user) {
135+
mgr.signinSilent({state:'some data'}).then(function(user) {
136136
log("signed in", user);
137137
}).catch(function(err) {
138138
log(err);
139139
});
140140
}
141141

142142
function startSignoutMainWindow(){
143-
mgr.signoutRedirect({data:'some data'}).then(function(resp) {
143+
mgr.signoutRedirect({state:'some data'}).then(function(resp) {
144144
log("signed out", resp);
145145
}).catch(function(err) {
146146
log(err);

0 commit comments

Comments
 (0)