Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit accessibility so only admin can see anonymous poster #33

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added dump.rdb
Binary file not shown.
11 changes: 11 additions & 0 deletions src/middleware/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
});
};

const showUsername = (userId, currentUser) => {

Check failure on line 39 in src/middleware/user.js

View workflow job for this annotation

GitHub Actions / test

'showUsername' is assigned a value but never used
const isAdmin = currentUser && currentUser.isAdmin;

if (isAnonymous && !isAdmin) {

Check failure on line 42 in src/middleware/user.js

View workflow job for this annotation

GitHub Actions / test

'isAnonymous' is not defined
return 'Anonymous User';
}


return user.getDisplayName(userId);
};

module.exports = function (middleware) {
async function authenticate(req, res) {
async function finishLogin(req, user) {
Expand Down
Loading