Skip to content

Commit fdaa09c

Browse files
committed
use CSP in sample
1 parent 5ef48c0 commit fdaa09c

10 files changed

+29
-34
lines changed

sample/public/oidc-client-sample-callback.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
<pre id='out'></pre>
1212
<script src='log.js'></script>
1313
<script src='oidc-client.js'></script>
14-
<script>
15-
Oidc.Log.logger = console;
16-
Oidc.Log.level = Oidc.Log.INFO;
17-
new Oidc.OidcClient().processSigninResponse().then(function(response) {
18-
log("signin response success", response);
19-
}).catch(function(err) {
20-
log(err);
21-
});
22-
</script>
14+
<script src='oidc-client-sample-callback.js'></script>
2315
</body>
2416
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Oidc.Log.logger = console;
2+
Oidc.Log.level = Oidc.Log.INFO;
3+
new Oidc.OidcClient().processSigninResponse().then(function(response) {
4+
log("signin response success", response);
5+
}).catch(function(err) {
6+
log(err);
7+
});

sample/public/user-manager-sample-callback.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
<pre id='out'></pre>
1212
<script src='log.js'></script>
1313
<script src='oidc-client.js'></script>
14-
<script>
15-
Oidc.Log.logger = console;
16-
Oidc.Log.level = Oidc.Log.INFO;
17-
new Oidc.UserManager().signinRedirectCallback().then(function(user) {
18-
log("signin response success", user);
19-
}).catch(function(err) {
20-
log(err);
21-
});
22-
</script>
14+
<script src='user-manager-sample-callback.js'></script>
2315
</body>
2416
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Oidc.Log.logger = console;
2+
Oidc.Log.level = Oidc.Log.INFO;
3+
new Oidc.UserManager().signinRedirectCallback().then(function(user) {
4+
log("signin response success", user);
5+
}).catch(function(err) {
6+
log(err);
7+
});

sample/public/user-manager-sample-popup-signin.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88

99
<body>
1010
<script src='oidc-client.js'></script>
11-
<script>
12-
Oidc.Log.logger = console;
13-
Oidc.Log.level = Oidc.Log.INFO;
14-
new Oidc.UserManager().signinPopupCallback();
15-
</script>
11+
<script src='user-manager-sample-popup-signin.js'></script>
1612
</body>
1713

1814
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Oidc.Log.logger = console;
2+
Oidc.Log.level = Oidc.Log.INFO;
3+
new Oidc.UserManager().signinPopupCallback();

sample/public/user-manager-sample-popup-signout.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
<body>
1010
<h1>Signed Out</h1>
1111
<script src='oidc-client.js'></script>
12-
<script>
13-
Oidc.Log.logger = console;
14-
Oidc.Log.level = Oidc.Log.INFO;
15-
// true param will keep popup window open
16-
new Oidc.UserManager().signoutPopupCallback(true);
17-
</script>
12+
<script src='user-manager-sample-popup-signout.js'></script>
1813
</body>
1914

2015
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Oidc.Log.logger = console;
2+
Oidc.Log.level = Oidc.Log.INFO;
3+
// true param will keep popup window open
4+
new Oidc.UserManager().signoutPopupCallback(true);

sample/public/user-manager-sample-silent.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88

99
<body>
1010
<script src='oidc-client.js'></script>
11-
<script>
12-
Oidc.Log.logger = console;
13-
Oidc.Log.level = Oidc.Log.INFO;
14-
new Oidc.UserManager().signinSilentCallback();
15-
</script>
11+
<script src='user-manager-sample-silent.js'></script>
1612
</body>
1713

1814
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Oidc.Log.logger = console;
2+
Oidc.Log.level = Oidc.Log.INFO;
3+
new Oidc.UserManager().signinSilentCallback();

0 commit comments

Comments
 (0)