diff --git a/jam-ui/src/components/auth/ConfirmMailContent.js b/jam-ui/src/components/auth/ConfirmMailContent.js index df3d6ddaa..d08db3d4c 100644 --- a/jam-ui/src/components/auth/ConfirmMailContent.js +++ b/jam-ui/src/components/auth/ConfirmMailContent.js @@ -5,12 +5,12 @@ import { Link } from 'react-router-dom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import envelope from '../../assets/img/illustrations/envelope.png'; -const ConfirmMailContent = ({ email, layout, titleTag: TitleTag }) => ( +const ConfirmMailContent = ({ layout, titleTag: TitleTag }) => ( sent Please check your email!

- An email has been sent to {email}. Please click on the included link to reset your password. + An email has been sent to you. Please click on the included link to reset your password.

- + {/* I can't recover my account using this page - + */} + + I can't recover my account using this page + + ); }; diff --git a/jam-ui/src/components/auth/basic/ConfirmMail.js b/jam-ui/src/components/auth/basic/ConfirmMail.js index bf3642e91..0a366ff82 100644 --- a/jam-ui/src/components/auth/basic/ConfirmMail.js +++ b/jam-ui/src/components/auth/basic/ConfirmMail.js @@ -3,7 +3,7 @@ import ConfirmMailContent from '../ConfirmMailContent'; const ConfirmMail = () => (
- +
); diff --git a/jam-ui/src/components/auth/basic/JKAuthBasicRoutes.js b/jam-ui/src/components/auth/basic/JKAuthBasicRoutes.js index f7565be4f..76ffc4c53 100644 --- a/jam-ui/src/components/auth/basic/JKAuthBasicRoutes.js +++ b/jam-ui/src/components/auth/basic/JKAuthBasicRoutes.js @@ -6,20 +6,22 @@ import Login from './Login'; // import Logout from './Logout'; // import Registration from './Registration'; import ForgetPassword from './ForgetPassword'; -// import PasswordReset from './PasswordReset'; -// import ConfirmMail from './ConfirmMail'; +import PasswordReset from './PasswordReset'; +import ConfirmMail from './ConfirmMail'; // import LockScreen from './LockScreen'; const AuthBasicRoutes = ({ match: { url } }) => ( + + {/* - - + + */} {/*Redirect*/} diff --git a/jam-ui/src/helpers/rest.js b/jam-ui/src/helpers/rest.js index 2b944bf5d..db8a4e31a 100644 --- a/jam-ui/src/helpers/rest.js +++ b/jam-ui/src/helpers/rest.js @@ -309,6 +309,28 @@ export const resetPassword = email => { }); }; +export const requstResetForgotPassword = email => { + return new Promise((resolve, reject) => { + apiFetch(`/request_reset_forgot_password`, { + method: 'POST', + body: JSON.stringify({ email }) + }) + .then(response => resolve(response)) + .catch(error => reject(error)); + }); +}; + +export const resetForgotPassword = (options = {}) => { + return new Promise((resolve, reject) => { + apiFetch(`/reset_forgot_password`, { + method: 'POST', + body: JSON.stringify(options) + }) + .then(response => resolve(response)) + .catch(error => reject(error)); + }); +}; + export const postUserAppInteraction = (userId, options) => { return new Promise((resolve, reject) => { apiFetch(`/users/${userId}/app_interactions`, { diff --git a/web/app/assets/javascripts/dialog/textMessageDialog.js b/web/app/assets/javascripts/dialog/textMessageDialog.js index 953f8b2ba..d83f0efb5 100644 --- a/web/app/assets/javascripts/dialog/textMessageDialog.js +++ b/web/app/assets/javascripts/dialog/textMessageDialog.js @@ -263,7 +263,6 @@ // called from sidebar when messages come in function messageReceived(payload) { - alert("messageReceived"); if(showing && otherId == payload.sender_id) { if(fullyInitialized) { renderMessage(payload.msg, payload.sender_id, payload.sender_name, payload.created_at, true); diff --git a/web/app/controllers/api_sessions_controller.rb b/web/app/controllers/api_sessions_controller.rb index 5fe58f10a..d6c4067c5 100644 --- a/web/app/controllers/api_sessions_controller.rb +++ b/web/app/controllers/api_sessions_controller.rb @@ -18,13 +18,15 @@ class ApiSessionsController < ApiController end end + #reset_password_token is updated. inteanded for the react app (spa) def request_reset_password begin - User.reset_password(params[:email], ApplicationHelper.base_uri(request)) + User.reset_password(params[:email], APP_CONFIG.spa_origin) + render :json => {}, :status => 204 rescue JamRuby::JamArgumentError render :json => {:message => ValidationMessages::EMAIL_NOT_FOUND}, :status => 403 end - render :json => {}, :status => 204 + end end diff --git a/web/config/routes.rb b/web/config/routes.rb index 022ffe75a..6e0ccd6df 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -16,9 +16,6 @@ Rails.application.routes.draw do root to: 'users#home' end - - - # signup, and signup completed, related pages get '/signup', to: 'users#new' post '/signup', to: 'users#create' @@ -31,8 +28,8 @@ Rails.application.routes.draw do post '/signin', to: 'sessions#create' delete '/signout', to: 'sessions#destroy' get '/passthrough', to: 'sessions#passthrough' - - post '/request_reset_password', to: 'api_sessions#request_reset_password' + + match '/redeem_giftcard', to: 'landings#redeem_giftcard', via: :get match '/account/activate/code_old', to: 'landings#account_activate', via: :get @@ -412,6 +409,10 @@ Rails.application.routes.draw do match '/users/:id/reset_password' => 'api_users#reset_password', :via => :post match '/users/:id/app_interactions' => 'api_users#post_app_interactions', :via => :post + #reset forgot password (not logged in) + post '/request_reset_forgot_password', to: 'api_sessions#request_reset_password' + post '/reset_forgot_password', to: 'users#reset_forgot_password' + match '/reviews' => 'api_reviews#index', :via => :get match '/reviews' => 'api_reviews#create', :via => :post match '/reviews/:id' => 'api_reviews#update', :via => :post