From bb87d840e098530aa76227707f7fc91d605d2dcd Mon Sep 17 00:00:00 2001 From: Pranav Raj Sreepuram Date: Sat, 17 Aug 2019 17:50:43 +0530 Subject: [PATCH] Fix routes in emails, redirects --- app/controllers/confirmations_controller.rb | 2 +- app/javascript/src/api/auth.js | 2 +- config/routes.rb | 10 ---------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index e13346ff9..b1d1e98d9 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -28,6 +28,6 @@ class ConfirmationsController < Devise::ConfirmationsController user.reset_password_token = enc user.reset_password_sent_at = Time.now.utc user.save(validate: false) - "/auth/password/edit?config=default&redirect_url=&reset_password_token="+raw + "/u/auth/password/edit?config=default&redirect_url=&reset_password_token="+raw end end diff --git a/app/javascript/src/api/auth.js b/app/javascript/src/api/auth.js index 08d4ff7d9..82fe893a5 100644 --- a/app/javascript/src/api/auth.js +++ b/app/javascript/src/api/auth.js @@ -69,7 +69,7 @@ export default { .then((response) => { Cookies.remove('auth_data'); Cookies.remove('user'); - window.location = '/login'; + window.location = '/u/login'; resolve(response); }) .catch((error) => { diff --git a/config/routes.rb b/config/routes.rb index cb082b220..f67a10b90 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,18 +3,13 @@ Rails.application.routes.draw do #AUTH STARTS match 'auth/:provider/callback', to: 'home#callback', via: [:get, :post] mount_devise_token_auth_for 'User', at: 'auth', controllers: { confirmations: 'confirmations', passwords: 'passwords' }, via: [:get, :post] - #AUTH STARTS - get "/u", to: "dashboard#index" get "/u/*params", to: "dashboard#index" - #ROOT STARTS get '/', to: redirect('/u/login') match '/status', to: 'home#status', via: [:get] #for elb checks - #AUTH ENDS - #API STARTS namespace :api do namespace :v1 do resources :callbacks, only: [] do @@ -87,16 +82,11 @@ Rails.application.routes.draw do end end end - #API ENDS - - #these routes are only used to put on mailers. DO NOT USE INTERNALLY. scope module: "mailer" do resources :conversations, only: [:show] end - #mailer routes ends - mount Facebook::Messenger::Server, at: 'bot' post '/webhooks/telegram/:account_id/:inbox_id' => 'home#telegram' end