Skip to content

Instantly share code, notes, and snippets.

@KonnorRogers
Last active May 2, 2022 20:34
Show Gist options
  • Save KonnorRogers/8f93a71d3498265cb84ce2d665b9955a to your computer and use it in GitHub Desktop.
Save KonnorRogers/8f93a71d3498265cb84ce2d665b9955a to your computer and use it in GitHub Desktop.
Override devise
# frozen_string_literal: true
class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
private
def respond_to_on_destroy
respond_to do |format|
format.any(*navigational_formats) { redirect_to after_sign_out_path_for(resource_name), status: 303 }
format.all { head :no_content }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment