It’s in lib/devise/controllers/helpers.rb
1 and is generated dynamically (user being only one of the possible suffixes):
def self.define_helpers(mapping) #:nodoc: mapping = mapping.name class_eval <<-METHODS, __FILE__, __LINE__ + 1 def authenticate_#{mapping}!(opts={}) opts[:scope] = :#{mapping} warden.authenticate!(opts) if !devise_controller? || opts.delete(:force) end def #{mapping}_signed_in? !!current_#{mapping} end def current_#{mapping} @current_#{mapping} ||= warden.authenticate(:scope => :#{mapping}) end def #{mapping}_session current_#{mapping} && warden.session(:#{mapping}) end METHODS ActiveSupport.on_load(:action_controller) do helper_method "current_#{mapping}", "#{mapping}_signed_in?", "#{mapping}_session" end end
Related Posts:
- Sign in with Google temporarily disabled for this app
- Rails 5 ActionController::InvalidAuthenticityToken error
- What are the main differences between JWT and OAuth authentication?
- Cannot load such file — bcrypt_ext
- Generate model in Rails using user_id:integer vs user:references
- Nginx error: client intended to send too large body
- What is the difference between “rake db:seed” and rake db:fixtures:load”
- How do I parse JSON with Ruby on Rails? [duplicate]
- What is an Endpoint?
- 400 Bad Request – request header or cookie too large
- Advanced AREL or just Rails Query for has_many through search by association
- Use Device Login on Smart TV / Console
- Why Puma listen on ‘tcp://localhost:3000’ instead of ‘http://localhost:3000’
- What is the OAuth 2.0 Bearer Token exactly?
- Explain what " means
- Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000?
- bundle install returns “Could not locate Gemfile”
- ActionController::InvalidAuthenticityToken
- Constructing requests with URL Query String in Python
- what does ? ? mean in ruby
- localhost/phpinfo.php
- Rails: Can’t verify CSRF token authenticity when making a POST request
- Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails
- undefined method `each’ for nil:NilClass… why?
- Bundler: You must use Bundler 2 or greater with this lockfile
- Google OAuth 2 authorization – Error: redirect_uri_mismatch
- undefined method `each’ for nil:NilClass… why?
- Parsing XML with Ruby
- What is the difference between Rails.cache.clear and rake tmp:cache:clear?
- Unable to install gem – Failed to build gem native extension – cannot load such file — mkmf (LoadError)
- Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
- How do I remove Permission denied @ rb_sysopen – Gem install error?
- Email validation in Ruby on Rails?
- Can’t find the ‘libpq-fe.h header when trying to install pg gem
- warning: constant ::Fixnum is deprecated When generating new model
- could not connect to server: No such file or directory (PG::ConnectionBad)
- curl : (1) Protocol https not supported or disabled in libcurl
- extconf failed, exit code 1 error when installing [Ruby on Rails] 5 on OS X Yosemite 10.10.5
- Rails 4 RoutingError: No Route Matches
- couldn’t find file ‘jquery’ with type ‘application/javascript’
- Passing parameters in rails redirect_to
- Getting: “Migrations are pending; run ‘bin/rake db:migrate RAILS_ENV=development’ to resolve this issue.” after cloning and migrating the project
- PG::ConnectionBad – could not connect to server: Connection refused
- How to find out which rails version an existing rails application is built on?
- RubyMine Unit tests – Test Framework quit unexpectedly
- bcrypt LoadError: Cannot load such file
- Uninitialized constant “Controller Name”
- Devise lockable – How to unlock account using unlock_in
- Ruby: What is the easiest way to remove the first element from an array?
- How do I format datetime in rails?
- Ruby String to Date Conversion
- heroku open – no app specified
- Difference between rake db:migrate db:reset and db:schema:load
- “Error installing rails” because “extconf.rb failed” on Ubuntu 18.04
- Install oAuth PECL error: Cannot install, php_dir for channel “pecl.php.net” is not writeable by the current user
- TypeError: no implicit conversion of Symbol into Integer
- Spring-Security-Oauth2: Full authentication is required to access this resource
- An unhandled lowlevel error occurred. The application logs may have details
- Rails button_to vs. HTML Button Tag
- “An access token is required to request this resource” while accessing an album / photo with Facebook php sdk
- GROUP BY and COUNT using ActiveRecord
- How to stop (and restart) the Rails Server?
- Purge or recreate a Ruby on Rails database
- Migrations are pending; run ‘bin/rake db:migrate RAILS_ENV=development’ to resolve this issue
- Uploading a file in Rails
- An error occurred while installing json (1.8.1), and Bundler cannot continue – Rails
- Discord OAuth2 redirect URI how-to
- Override WordPress user with Oauth2 account
- How to allow users login to WP from external domain and make REST requests
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- Implement authentication to an organization oAuth server
- WP-API: how do I allow authenticated clients only?
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- How do I authenticate WP users from a chrome extension?
- $_SESSION variables lost during OAuth callback
- Create a php callback/endpoint for an OAuth script
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- Use WordPress with a custom OAuth2 provider
- Authenticated request to WP REST API V2 returning 403 error on /users/me [closed]
- WP REST API GET Requests require authentication
- Allow logged in WordPress user to access 3rd party Laravel API via OAuth
- WordPress Google Calendar Oath 404
- Redirect URL on OAuth2.0 after switching from http to https
- Test WordPress api with postman
- Authorizing a plugin to call Google Analytics v4 API on wp_cron
- OAuth1 empty “authentication” in /wp-json
- OAuth 2 and saving the authenticated user
- OAuth Plugin Produces Error With Yahoo
- Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions
- WooCommerce OAuth 1.0 + JWT authentication with JS/React
- oAuth2 Authentication in WordPress using WP OAuth Server and WP API plugins
- WordPress login set cookie that survive browser exit (wp_signon function)
- Output Redirect Headers on Admin Dashboard Page
- How to use google api for wordpress login
- How to make an other web app can login with wordpress authentication?
- Connecting a wordpress site to an AngularJS APP
- Email verification feature in wordpress social login plugin
- Implement OAuth2 in custom plugin
- How to force or redirect to SSL in nginx?
- WordPress User Registration/ Sign Up -> Able to take Paid Certification Courses & keep track of Completed Certificates