Commit aeea1281 authored by Alexandre's avatar Alexandre Committed by Clément

update: moving to solid-auth

parent f84c27a8
......@@ -2,16 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
<script
type="module"
src="http://127.0.0.1:8081/index.js"
data-authority="https://api.test-paris.happy-dev.fr/openid/"
data-client_id="196656"
data-response_type="id_token token"
data-scope="openid profile email"
data-automaticSilentRenew="true"
data-loadUserInfo="true"
></script>
<script type="module" src="https://unpkg.com/@startinblox/oidc@0.7" ></script>
<script type="module" src="sib-chat.js"></script>
<title>XMPP chat</title>
......@@ -87,19 +78,10 @@
reload.onclick = () => location.reload();
</script>
<script>
reset.onclick = () => {
window.sessionStorage.clear();
window.localStorage.clear();
history.pushState({}, '', '.?time=' + new Date().toLocaleTimeString());
};
reload.onclick = () => location.reload();
</script>
<script type="module">
import { SIBBase, store } from 'https://unpkg.com/@startinblox/core@0.7';
class TestComponent extends SIBBase {
class TestComponent extends HTMLElement {
async connectedCallback() {
stat.onclick = () => console.log(this.getStatus());
login.onclick = () => this.triggerLogin();
......@@ -109,15 +91,15 @@
}
async triggerLogin() {
await this.login();
await document.querySelector("sib-auth").login();
}
async triggerLogout() {
await this.logout();
await document.querySelector("sib-auth").logout();
}
async update() {
let user = await this.getUser();
let idToken = await this.getUserIdToken();
let user = await document.querySelector("sib-auth").getUser();
let idToken = await document.querySelector("sib-auth").getUserIdToken();
if (!user) {
result.innerHTML = `Vous n'êtes pas connecté !`;
return;
......
......@@ -14,7 +14,7 @@
"resolved": "https://registry.npmjs.org/@startinblox/oidc/-/oidc-0.5.1.tgz",
"integrity": "sha512-0laMDJ//g+BPBBJCydIVazqWDJpP8fAK6TdnLFCUpUBk3tywuXxgg5vhn0wizKrkQYW2nofmtoJOpia1qzrARg==",
"requires": {
"oidc-client": "^1.6.1"
"oidc-client": "1.6.1"
},
"dependencies": {
"oidc-client": {
......@@ -22,8 +22,8 @@
"resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.6.1.tgz",
"integrity": "sha512-buA9G0hlFjUwxoL/xuHunBtTgoICtJSojnZtATqMliUTKxPYAzHprOQ85Lj0hgF+Zv8lI/ViqaNFDG0Z5KCUKA==",
"requires": {
"babel-polyfill": ">=6.9.1",
"jsrsasign": "^8.0.12"
"babel-polyfill": "6.26.0",
"jsrsasign": "8.0.12"
}
}
}
......@@ -45,9 +45,9 @@
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
"optional": true,
"requires": {
"babel-runtime": "^6.26.0",
"core-js": "^2.5.0",
"regenerator-runtime": "^0.10.5"
"babel-runtime": "6.26.0",
"core-js": "2.5.7",
"regenerator-runtime": "0.10.5"
}
},
"babel-runtime": {
......@@ -56,8 +56,8 @@
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"optional": true,
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
"core-js": "2.5.7",
"regenerator-runtime": "0.11.1"
},
"dependencies": {
"regenerator-runtime": {
......@@ -79,7 +79,7 @@
"resolved": "https://registry.npmjs.org/converse.js/-/converse.js-4.1.0.tgz",
"integrity": "sha512-Efhp4cn6LjDqyG8y/BAyQxgIiQA9dx48DArsYc4cKqzj3yxD0VjFrXlxUeFqU/y5HGMNHYjkA7CPauNXG8WYsg==",
"requires": {
"fast-text-encoding": "^1.0.0"
"fast-text-encoding": "1.0.0"
}
},
"core-js": {
......@@ -108,10 +108,10 @@
"integrity": "sha512-Goilx/2cfU9vvfQjgtNgc2VmJAD8CasQ6rZDqCd2u4Hsyd/qFET6nBf60jiHodevR3nl3IGzNKtrzPXWP88utQ==",
"dev": true,
"requires": {
"he": "^1.1.1",
"mime": "^1.4.1",
"minimist": "^1.1.0",
"url-join": "^2.0.2"
"he": "1.1.1",
"mime": "1.6.0",
"minimist": "1.2.0",
"url-join": "2.0.5"
}
},
"eventemitter3": {
......@@ -131,7 +131,7 @@
"integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==",
"dev": true,
"requires": {
"debug": "^3.1.0"
"debug": "3.1.0"
}
},
"he": {
......@@ -146,9 +146,9 @@
"integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==",
"dev": true,
"requires": {
"eventemitter3": "^3.0.0",
"follow-redirects": "^1.0.0",
"requires-port": "^1.0.0"
"eventemitter3": "3.1.0",
"follow-redirects": "1.5.0",
"requires-port": "1.0.0"
}
},
"http-server": {
......@@ -158,13 +158,13 @@
"dev": true,
"requires": {
"colors": "1.0.3",
"corser": "~2.0.0",
"ecstatic": "^3.0.0",
"http-proxy": "^1.8.1",
"opener": "~1.4.0",
"optimist": "0.6.x",
"portfinder": "^1.0.13",
"union": "~0.4.3"
"corser": "2.0.1",
"ecstatic": "3.2.0",
"http-proxy": "1.17.0",
"opener": "1.4.3",
"optimist": "0.6.1",
"portfinder": "1.0.13",
"union": "0.4.6"
}
},
"jsrsasign": {
......@@ -219,8 +219,8 @@
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
"dev": true,
"requires": {
"minimist": "~0.0.1",
"wordwrap": "~0.0.2"
"minimist": "0.0.10",
"wordwrap": "0.0.3"
},
"dependencies": {
"minimist": {
......@@ -237,9 +237,9 @@
"integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=",
"dev": true,
"requires": {
"async": "^1.5.2",
"debug": "^2.2.0",
"mkdirp": "0.5.x"
"async": "1.5.2",
"debug": "2.6.9",
"mkdirp": "0.5.1"
},
"dependencies": {
"debug": {
......@@ -277,7 +277,7 @@
"integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=",
"dev": true,
"requires": {
"qs": "~2.3.3"
"qs": "2.3.3"
}
},
"url-join": {
......
......@@ -3,7 +3,7 @@ import {
Helpers,
SIBBase,
store,
} from 'https://unpkg.com/@startinblox/core@0.7';
} from 'https://unpkg.com/@startinblox/core@0.8';
const base_url = import.meta.url.replace(/\/[^\/]*$/, '');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment