Skip to content

Commit eee6488

Browse files
committed
added logic for relative uri maybe
1 parent 0ad5455 commit eee6488

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/models/account-template.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,17 @@ class AccountTemplate {
8585
* @return {Object}
8686
*/
8787
static templateSubstitutionsFor (userAccount) {
88+
let realWebId
89+
// this means the user's webId and server Uri are the same
90+
// therefore, we use a relative address
91+
if (userAccount.webId.indexOf(this.hostname) > -1) {
92+
realWebId = userAccount.webId.substring(userAccount.webId.indexOf(this.hostname))
93+
} else {
94+
realWebId = userAccount.webId
95+
}
8896
const substitutions = {
8997
name: userAccount.displayName,
90-
webId: userAccount.webId,
98+
webId: realWebId, // userAccount.webId,
9199
email: userAccount.email,
92100
idp: userAccount.idp
93101
}

0 commit comments

Comments
 (0)