Skip to content

Commit

Permalink
added logic for relative uri maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
zg009 committed May 11, 2024
1 parent 0ad5455 commit eee6488
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/models/account-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,17 @@ class AccountTemplate {
* @return {Object}
*/
static templateSubstitutionsFor (userAccount) {
let realWebId
// this means the user's webId and server Uri are the same
// therefore, we use a relative address
if (userAccount.webId.indexOf(this.hostname) > -1) {
realWebId = userAccount.webId.substring(userAccount.webId.indexOf(this.hostname))
} else {
realWebId = userAccount.webId
}
const substitutions = {
name: userAccount.displayName,
webId: userAccount.webId,
webId: realWebId, // userAccount.webId,
email: userAccount.email,
idp: userAccount.idp
}
Expand Down

0 comments on commit eee6488

Please sign in to comment.