Skip to content

Commit

Permalink
minor cleaning and variable clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
zg009 committed May 13, 2024
1 parent b795602 commit 72b20b4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/models/account-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ class AccountTemplate {
* @throws if hostname already registered
*/
static registerHostname (hostname) {
// if (this.hostname) {
// throw new Error('hostname already registered')
// } else {
this.hostname = hostname
// }
}

/**
Expand Down Expand Up @@ -85,17 +81,17 @@ class AccountTemplate {
* @return {Object}
*/
static templateSubstitutionsFor (userAccount) {
let realWebId
let podRelativeWebId
// this means the user's webId and server Uri are the same
// therefore, we use a relative address
// therefore, we use a relative uri ref
if (userAccount.webId.indexOf(this.hostname) > -1) {
realWebId = path.join('/', userAccount.webId.substring(userAccount.webId.indexOf(this.hostname) + this.hostname.length))
podRelativeWebId = path.join('/', userAccount.webId.substring(userAccount.webId.indexOf(this.hostname) + this.hostname.length))
} else {
realWebId = userAccount.webId
podRelativeWebId = userAccount.webId
}
const substitutions = {
name: userAccount.displayName,
webId: realWebId, // userAccount.webId,
webId: podRelativeWebId,
email: userAccount.email,
idp: userAccount.idp
}
Expand Down

0 comments on commit 72b20b4

Please sign in to comment.