Skip to content

Commit

Permalink
#8856 fix profile button rendering for guest users (#8865)
Browse files Browse the repository at this point in the history
  • Loading branch information
webplusai authored Dec 24, 2024
1 parent b8f2800 commit 6d44849
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ exports.handler = function(request,response,state) {
"first-guest-user": state.firstGuestUser ? "yes" : "no",
"show-anon-config": state.showAnonConfig ? "yes" : "no",
"user": JSON.stringify(state.authenticatedUser),
"has-profile-access": !!state.authenticatedUser ? "yes" : "no"
}});
response.write(html);
response.end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ exports.handler = function(request,response,state) {
"username": state.authenticatedUser ? state.authenticatedUser.username : state.firstGuestUser ? "Anonymous User" : "Guest",
"user-is-admin": state.authenticatedUser && state.authenticatedUser.isAdmin ? "yes" : "no",
"user-id": user_id,
"has-profile-access": !!state.authenticatedUser ? "yes" : "no"
}
});
response.write(html);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ title: $:/plugins/tiddlywiki/multiwikiserver/templates/mws-header
</form>
</div>
</div>
<% elseif [<username>!match[Guest]]+[<first-guest-user>match[no]] %>
<% elseif [<has-profile-access>match[yes]] %>
<$set name="userId" value={{{ [<user>jsonget[user_id]] }}}>
<a href={{{ [<userId>addprefix[/admin/users/]] }}}>
<button class="mws-profile-btn">Profile</button>
Expand Down

0 comments on commit 6d44849

Please sign in to comment.