Bugfix: Fix password reset (#455)

This commit is contained in:
Sojan Jose 2020-02-02 23:07:38 +05:45 committed by GitHub
parent 0b31e14132
commit a287c86bc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,4 @@
class Devise::ConfirmationsController < Devise::ConfirmationsController
class DeviseOverrides::ConfirmationsController < Devise::ConfirmationsController
skip_before_action :require_no_authentication, raise: false
skip_before_action :authenticate_user!, raise: false

View file

@ -1,4 +1,4 @@
class Devise::PasswordsController < Devise::PasswordsController
class DeviseOverrides::PasswordsController < Devise::PasswordsController
include AuthHelper
skip_before_action :require_no_authentication, raise: false

View file

@ -1,4 +1,4 @@
class Devise::SessionsController < ::DeviseTokenAuth::SessionsController
class DeviseOverrides::SessionsController < ::DeviseTokenAuth::SessionsController
# Prevent session parameter from being passed
# Unpermitted parameter: session
wrap_parameters format: []

View file

@ -1,4 +1,4 @@
class Devise::TokenValidationsController < ::DeviseTokenAuth::TokenValidationsController
class DeviseOverrides::TokenValidationsController < ::DeviseTokenAuth::TokenValidationsController
def validate_token
# @resource will have been set by set_user_by_token concern
if @resource

View file

@ -1,9 +1,12 @@
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: 'devise/confirmations', passwords: 'devise/passwords',
sessions: 'devise/sessions',
token_validations: 'devise/token_validations' }, via: [:get, :post]
mount_devise_token_auth_for 'User', at: 'auth', controllers: {
confirmations: 'devise_overrides/confirmations',
passwords: 'devise_overrides/passwords',
sessions: 'devise_overrides/sessions',
token_validations: 'devise_overrides/token_validations'
}, via: [:get, :post]
root to: 'dashboard#index'