GithubHelp home page GithubHelp logo

markets / sudo_rails Goto Github PK

View Code? Open in Web Editor NEW
80.0 80.0 2.0 241 KB

๐Ÿ”’ Sudo mode for your Rails controllers

Home Page: https://rubygems.org/gems/sudo_rails

License: MIT License

Ruby 75.46% HTML 24.54%
password-confirmation rails rails-engine ruby security sudo

sudo_rails's People

Contributors

araluce avatar lautarocastillo avatar markets avatar shettytejas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

majksner araluce

sudo_rails's Issues

Remove Sprockets dependency

Since now Rails has 2 assets pipelines, Sprockets and Webpacker, would be nice to remove the Sprockets dependency. I'd take the same approach we took in Maily: markets/maily#48.

We already inject some styles, for customization, via: https://github.com/markets/sudo_rails/blob/master/app/views/sudo_rails/_inject_custom_styles.html.erb. So, it would be as easy as moving all default styles there.

NOTES

  • we will need to make the custom_logo option independent from Sprockets (maybe absolute URL is just fine?)
  • remove sassc-rails gem:
    spec.add_dependency "sassc-rails"

Either I'm trying to using it wrong on something is broken

Hi @markets,

Thanks for the gem! I'm trying to use it in my Rails app and it looks like it's not working. Let's say I would like to protect devise user edit method. In registrations_controller.rb

class Users::RegistrationsController < Devise::RegistrationsController
  sudo only: [:edit]
end

as soon as I go to edit page it prompts sudo page with password ๐Ÿ‘๐Ÿป. When I enter the password I just get redirected back to the same sudo page I can't reach edit page. That is one thing.

Another thing (or maybe it's not possible) is to protect :update method of a controller so when I click on a submit button to get the sudo page and after entering password to get form submitted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.