Skip to content

Commit 0abe2b8

Browse files
authored
Merge pull request #39 from SolidOS/discovery
Discovery - a fresh approach to preferences and typeIndexes
2 parents 2bf19bb + 615b75c commit 0abe2b8

8 files changed

Lines changed: 1486 additions & 518 deletions

File tree

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
verbose: true,
3-
testEnvironment: 'node',
3+
testEnvironment: 'jsdom',
44
setupFilesAfterEnv: [
55
'./test/helpers/setup.ts'
66
]

package-lock.json

Lines changed: 462 additions & 459 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/authn/SolidAuthnLogic.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import * as debug from '../util/debug'
44
import { Session } from "@inrupt/solid-client-authn-browser";
55
import { AuthenticationContext, AuthnLogic } from "../types";
66
export class SolidAuthnLogic implements AuthnLogic {
7-
private session: Session;
7+
private session: Session;
88

99
constructor(solidAuthSession: Session) {
1010
this.session = solidAuthSession;
1111
}
12-
12+
1313
// we created authSession getter because we want to access it as authn.authSession externally
14-
get authSession():Session { return this.session }
14+
get authSession():Session { return this.session }
1515

1616
currentUser(): NamedNode | null {
1717
const app = appContext()
1818
if (app.viewingNoAuthPage) {
1919
return sym(app.webId)
2020
}
21-
if (this.session.info.webId && this.session.info.isLoggedIn) {
21+
if (this && this.session && this.session.info && this.session.info.webId && this.session.info.isLoggedIn) {
2222
return sym(this.session.info.webId)
2323
}
2424
return offlineTestID() // null unless testing
@@ -120,4 +120,4 @@ export class SolidAuthnLogic implements AuthnLogic {
120120
return webId
121121
}
122122

123-
}
123+
}

0 commit comments

Comments
 (0)