meeting-pane 2.3.6-alpha-2b12f04c → 2.3.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +20 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meeting-pane",
3
- "version": "2.3.6-alpha-2b12f04c",
3
+ "version": "2.3.6-beta.0",
4
4
  "description": "Solid-compatible Panes: meeting collaborative tool",
5
5
  "main": "./lib/meetingPane.js",
6
6
  "files": [
@@ -49,7 +49,7 @@
49
49
  "buffer": "^6.0.3",
50
50
  "crypto-browserify": "^3.12.0",
51
51
  "path-browserify": "^1.0.1",
52
- "solid-ui": "^2.4.9-alpha-2b12f04c"
52
+ "solid-ui": "^2.4.9-beta"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@babel/cli": "^7.14.5",
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const MeetingPane = require('./meetingPane.js')
2
2
  const $rdf = require('rdflib')
3
3
  const UI = require('solid-ui')
4
- const SolidAuth = require('solid-auth-client')
4
+ // const SolidAuth = require('solid-auth-client')
5
5
 
6
6
  async function appendMeetingPane (dom, uri) {
7
7
  const subject = $rdf.sym(uri)
@@ -26,32 +26,29 @@ document.addEventListener('DOMContentLoaded', function () {
26
26
  // Set up the view for the subject indicated in the fragment of the window's URL
27
27
  const uri = decodeURIComponent(window.location.hash.substr(1))
28
28
  if (uri.length === 0) {
29
- window.location = '?#' + encodeURIComponent('https://michielbdejong.inrupt.net/meetings/Data%20browser%2016%20Dec%202019/index.ttl#this')
29
+ // window.location = '?#' + encodeURIComponent('https://michielbdejong.inrupt.net/meetings/Data%20browser%2016%20Dec%202019/index.ttl#this')
30
+ window.location = '?#' + encodeURIComponent('https://timbl.com/timbl/Public/Test/Meeting/Brainstorming/index.ttl#this')
30
31
  }
31
32
  appendMeetingPane(document, uri)
32
33
  })
33
34
 
34
- window.onload = () => {
35
- console.log('document ready')
36
- SolidAuth.trackSession(session => {
37
- if (!session) {
38
- console.log('The user is not logged in')
39
- document.getElementById('loginBanner').innerHTML = '<button onclick="popupLogin()">Log in</button>'
40
- } else {
41
- console.log(`Logged in as ${session.webId}`)
35
+ // window.onload = () => {
36
+ console.log('document ready')
37
+ const loginBanner = document.getElementById('loginBanner')
38
+ loginBanner.appendChild(UI.authn.loginStatusBox(document, null, {}))
42
39
 
43
- document.getElementById('loginBanner').innerHTML = `Logged in as ${session.webId} <button onclick="logout()">Log out</button>`
44
- }
45
- })
46
- }
47
- window.logout = () => {
48
- SolidAuth.logout()
49
- window.location = ''
50
- }
51
- window.popupLogin = async function () {
52
- let session = await SolidAuth.currentSession()
53
- const popupUri = 'https://solid.community/common/popup.html'
54
- if (!session) {
55
- session = await SolidAuth.popupLogin({ popupUri })
40
+ async function finishLogin () {
41
+ await UI.authn.authSession.handleIncomingRedirect()
42
+ const session = UI.authn.authSession
43
+ if (session.info.isLoggedIn) {
44
+ console.log(`Logged in as ${session.webId}`)
45
+
46
+ document.getElementById('loginBanner').innerHTML = `Logged in as ${UI.authn.currentUser().uri}`
47
+ } else {
48
+ console.log('The user is not logged in')
49
+ // document.getElementById('loginBanner').innerHTML = '<button onclick="popupLogin()">Log in</button>'
56
50
  }
57
51
  }
52
+
53
+ finishLogin()
54
+ // }