Fix routes in emails, redirects

This commit is contained in:
Pranav Raj Sreepuram 2019-08-17 17:50:43 +05:30
parent bacc87ad8c
commit bb87d840e0
3 changed files with 2 additions and 12 deletions

View file

@ -28,6 +28,6 @@ class ConfirmationsController < Devise::ConfirmationsController
user.reset_password_token = enc user.reset_password_token = enc
user.reset_password_sent_at = Time.now.utc user.reset_password_sent_at = Time.now.utc
user.save(validate: false) 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
end end

View file

@ -69,7 +69,7 @@ export default {
.then((response) => { .then((response) => {
Cookies.remove('auth_data'); Cookies.remove('auth_data');
Cookies.remove('user'); Cookies.remove('user');
window.location = '/login'; window.location = '/u/login';
resolve(response); resolve(response);
}) })
.catch((error) => { .catch((error) => {

View file

@ -3,18 +3,13 @@ Rails.application.routes.draw do
#AUTH STARTS #AUTH STARTS
match 'auth/:provider/callback', to: 'home#callback', via: [:get, :post] 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] 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", to: "dashboard#index"
get "/u/*params", to: "dashboard#index" get "/u/*params", to: "dashboard#index"
#ROOT STARTS
get '/', to: redirect('/u/login') get '/', to: redirect('/u/login')
match '/status', to: 'home#status', via: [:get] #for elb checks match '/status', to: 'home#status', via: [:get] #for elb checks
#AUTH ENDS
#API STARTS
namespace :api do namespace :api do
namespace :v1 do namespace :v1 do
resources :callbacks, only: [] do resources :callbacks, only: [] do
@ -87,16 +82,11 @@ Rails.application.routes.draw do
end end
end end
end end
#API ENDS
#these routes are only used to put on mailers. DO NOT USE INTERNALLY.
scope module: "mailer" do scope module: "mailer" do
resources :conversations, only: [:show] resources :conversations, only: [:show]
end end
#mailer routes ends
mount Facebook::Messenger::Server, at: 'bot' mount Facebook::Messenger::Server, at: 'bot'
post '/webhooks/telegram/:account_id/:inbox_id' => 'home#telegram' post '/webhooks/telegram/:account_id/:inbox_id' => 'home#telegram'
end end