diff --git a/README.md b/README.md index 718847d9e..ffb54a4fd 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ alternative methods of loading configuration during development. - iPad - iPad Pro +- iPhone 7 Plus +- iPhone 7 - iPhone 6 Plus - iPhone 6 - iPhone 5 diff --git a/client/coral-admin/src/actions/auth.js b/client/coral-admin/src/actions/auth.js index 57871b79d..ca48764f1 100644 --- a/client/coral-admin/src/actions/auth.js +++ b/client/coral-admin/src/actions/auth.js @@ -68,7 +68,9 @@ const forgotPassowordFailure = () => ({ export const requestPasswordReset = (email) => (dispatch) => { dispatch(forgotPassowordRequest(email)); - return coralApi('/account/password/reset', {method: 'POST', body: {email}}) + const redirectUri = location.href; + + return coralApi('/account/password/reset', {method: 'POST', body: {email, loc: redirectUri}}) .then(() => dispatch(forgotPassowordSuccess())) .catch((error) => dispatch(forgotPassowordFailure(error))); }; diff --git a/graph/resolvers/root_query.js b/graph/resolvers/root_query.js index 9f3a5e157..e2cd58828 100644 --- a/graph/resolvers/root_query.js +++ b/graph/resolvers/root_query.js @@ -86,7 +86,7 @@ const RootQuery = { // this returns an arbitrary user user(_, {id}, {user, loaders: {Users}}) { - if (user == null || !user.hasRoles('ADMIN')) { + if (user == null || !user.can(SEARCH_OTHER_USERS)) { return null; } diff --git a/graph/resolvers/user.js b/graph/resolvers/user.js index d3254588e..0d8fdcbf3 100644 --- a/graph/resolvers/user.js +++ b/graph/resolvers/user.js @@ -1,5 +1,11 @@ const KarmaService = require('../../services/karma'); -const {SEARCH_ACTIONS, SEARCH_OTHERS_COMMENTS, UPDATE_USER_ROLES} = require('../../perms/constants'); +const { + SEARCH_ACTIONS, + SEARCH_OTHER_USERS, + SEARCH_OTHERS_COMMENTS, + UPDATE_USER_ROLES, + SEARCH_COMMENT_METRICS +} = require('../../perms/constants'); const User = { action_summaries({id}, _, {loaders: {Actions}}) { @@ -14,7 +20,7 @@ const User = { }, created_at({roles, created_at}, _, {user}) { - if (user && user.hasRoles('ADMIN')) { + if (user && user.can(SEARCH_OTHER_USERS)) { return created_at; } @@ -33,7 +39,7 @@ const User = { profiles({profiles}, _, {user}) { // if the user is not an admin, do not return the profiles - if (user && user.hasRoles('ADMIN')) { + if (user && user.can(SEARCH_OTHER_USERS)) { return profiles; } @@ -43,7 +49,7 @@ const User = { // Only allow a logged in user that is either the current user or is a staff // member to access the ignoredUsers of a given user. - if (!user || ((user.id !== id) && !(user.hasRoles('ADMIN') || user.hasRoles('MODERATOR')))) { + if (!user || ((user.id !== id) && !user.can(SEARCH_OTHER_USERS))) { return null; } @@ -66,7 +72,7 @@ const User = { // Extract the reliability from the user metadata if they have permission. reliable(user, _, {user: requestingUser}) { - if (requestingUser && requestingUser.hasRoles('ADMIN')) { + if (requestingUser && requestingUser.can(SEARCH_COMMENT_METRICS)) { return KarmaService.model(user); } } diff --git a/package.json b/package.json index 11634fa8d..152871fae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "1.6.0", + "version": "1.7.0", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "scripts": { diff --git a/services/users.js b/services/users.js index 496db4528..4c76f179c 100644 --- a/services/users.js +++ b/services/users.js @@ -566,7 +566,6 @@ module.exports = class UsersService { // endpoint. return; } - let redirectDomain; try { redirectDomain = url.parse(loc).hostname;