query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Stores requested URI to redirect the user after signing in. We can't use the scoped session provided by warden here, since the user is not authenticated yet, but we still need to store the URI based on scope, so different scopes would never use the same URI to redirect. source://devise//lib/devise/failure_app.rb246
def store_location!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_location\n session[:redirect_after_login] = request.request_uri\n end", "def store_location!\n session[:\"#{scope}_return_to\"] = attempted_path if request.get? && !http_auth?\n end", "def store_location\n session[:redirect_path] = request.path\n end", "def store_location\n session[:user_return_to] = request.url if request.get? and controller_name != \"sessions\" and controller_name != \"registrations\" and controller_name != \"omniauth_callbacks\"\n end", "def store_current_location\n # To redirect to the url user hit before signin.\n store_location_for(:user, request.url)\n # devise handles redirect after sign in using session[:user_return_to]\n # updating redirect url for api\n session[:user_return_to] = params[:redirect_url] if params['redirect_url'].present?\n end", "def store_location\n session[:redirect] = request.url\n end", "def store_location!\n session[\"return_to\"] = request.env[\"warden.options\"][:attempted_path] if request.get?\n end", "def store_location\n store_location_for(:user, params[:redirect_to]) if params[:redirect_to].present?\n\n # note: don't store the previous url on each call. this led to an issue where\n # missing asset might get run through this code, causing the user to be redirected\n # to the missing asset during a login\n # session[:previous_url] = request.url if request.url != new_user_session_url\n end", "def store_location\n if request.get? && request.format.html? && !request.xhr? && !devise_controller?\n session[:\"user_return_to\"] = request.fullpath\n end\n end", "def store_devise_redirect_location\n return if request.xhr?\n return if !request.get?\n\n not_store_for = {\n registrations: %w[ new ],\n confirmation: %w[ new ],\n sessions: %w[ new ],\n passwords: %w[ new edit ],\n omniauth_callbacks: %[ vkontakte facebook twitter google_oauth2 odnoklassniki failure ],\n\n users: %w[ profile ],\n carts: %w[ index ],\n orders: %w[ index ]\n }.with_indifferent_access\n\n return if not_store_for.try(:[], controller_name).try(:include?, action_name)\n\n cookies[:previous_location] = request.fullpath\n end", "def after_sign_in_path_for(resource_or_scope)\n\t stored_location_for(resource_or_scope) || super\n\tend", "def store_location\n session[:return_to] = request.request_uri if not current_user\n end", "def after_sign_in_path_for(resource_or_scope)\n if (session[:my_previous_url].include?(new_user_session_path)|| \n session[:my_previous_url].include?(user_session_path) || \n session[:my_previous_url].include?(destroy_user_session_path) || \n session[:my_previous_url].include?(user_facebook_omniauth_authorize_path) || \n session[:my_previous_url].include?(user_facebook_omniauth_callback_path) || \n session[:my_previous_url].include?(user_google_oauth2_omniauth_authorize_path) || \n session[:my_previous_url].include?(user_google_oauth2_omniauth_callback_path) || \n session[:my_previous_url].include?(new_user_password_path) || \n session[:my_previous_url].include?(edit_user_password_path) || \n session[:my_previous_url].include?(user_password_path) || \n session[:my_previous_url].include?(cancel_user_registration_path) || \n session[:my_previous_url].include?(new_user_registration_path) || \n session[:my_previous_url].include?(edit_user_registration_path) || \n session[:my_previous_url].include?(user_registration_path) || \n session[:my_previous_url].include?(users_path) || \n session[:my_previous_url].include?(new_user_path) || \n session[:my_previous_url].include?(edit_user_path(current_user)) || \n session[:my_previous_url].include?(user_path(current_user)))\n \n session[:my_previous_url] = root_path\n end\n\n stored_location_for(resource_or_scope) || session[:my_previous_url]\n end", "def store_location\n\t # store last url - this is needed for post-login redirect to whatever the user last visited.\n\t if !devise_controller? && !request.xhr? # don't store ajax calls\n\t session[:previous_url] = request.fullpath \n\t end\n\tend", "def after_sign_in_path_for(resource)\n stored_location_for(:user) || super\n end", "def store_location\n session[:return_to] = request.request_uri unless request.request_uri == \"/logout\"\n end", "def store_location\n # after registration is another special case - do not redirect to \"current page\"\n session[:user_return_to] = request.url unless [\"devise/passwords\", \"devise/sessions\", \"devise/registrations\"].include?(params[:controller])\n end", "def after_sign_in_path_for(resource)\n session.delete(:auth_return_url) || request.env['omniauth.origin'] || stored_location_for(resource) || signed_in_root_path(resource)\n end", "def after_sign_in_path_for(resource_or_scope)\n stored_location_for(resource) || online_root_path\n end", "def store_redirect\n if params.key?(:redirect)\n store_redirect_url_for(params[:redirect], request.referer)\n end\n end", "def after_sign_in_path_for(resource)\n sign_in_url = new_user_session_url\n if request.referer == sign_in_url\n super\n else\n stored_location_for(resource) || request.referer || root_path\n end\n end", "def store_location\n session[:return_to] = request.fullpath if request.get? and controller_name != \"user_sessions\" and controller_name != \"sessions\"\n end", "def after_sign_in_path_for(resource_or_scope)\n case resource_or_scope\n when :user, User\n store_location = session[:return_to]\n clear_stored_location\n store_location = \"/\" if store_location && store_location.include?(\"/users/\")\n (store_location.nil?) ? \"/\" : store_location.to_s\n else\n super\n end\n end", "def after_sign_in_path_for(resource)\n sign_in_url = new_user_session_url\n if request.referer == sign_in_url\n super\n else\n stored_location_for(resource) || request.referrer || root_path\n end\n end", "def after_sign_up_path_for(resource_or_scope)\n if session[:redirect_url]\n session.delete(:redirect_url)\n else\n super\n end\n end", "def store_location\n session['user_return_to'] = request.original_url\n end", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n if (request.path != \"/users/sign_in\" &&\n request.path != \"/users/sign_up\" &&\n request.path != \"/users/password/new\" &&\n request.path != \"/users/password/edit\" &&\n request.path != \"/users/confirmation\" &&\n request.path != \"/users/sign_out\" &&\n !request.fullpath.match(/\\/users\\/auth\\//) &&\n !request.xhr?) # don't store ajax calls\n session[:previous_url] = request.fullpath\n end\n end", "def after_sign_in_path_for(resource_or_scope)\n case resource_or_scope\n when :user, User\n store_location = session[:return_to]\n clear_stored_location\n (store_location.nil?) ? \"/\" : store_location.to_s\n else\n super\n end\n end", "def after_sign_in_path_for(resource)\n if request.referer =~ /\\/users/\n super\n else\n stored_location_for(resource) || request.referer || root_path\n end\n end", "def after_sign_in_path_for(resource_or_scope)\n pop_stored_location ||\n sanitized_stored_location_for(resource_or_scope) ||\n signed_in_root_path(resource_or_scope)\n end", "def store_location\n session[:user_return_to] = request.url unless params[:controller] == \"devise/sessions\"\n # If devise model is not User, then replace :user_return_to with :{your devise model}_return_to\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def set_sign_in_redirect\n if (hash = params[:x_return_to]).present?\n session[:user_return_to] =\n \"#{request.protocol}#{request.host_with_port}/##{hash}\"\n end\n end", "def set_sign_in_redirect\n if (hash = params[:x_return_to]).present?\n session[:user_return_to] =\n \"#{request.protocol}#{request.host_with_port}/##{hash}\"\n end\n end", "def store_location\n session[:redirect_stack] ||= []\n session[:redirect_stack] << request.fullpath\n end", "def store_last_location\r\n session[:return_to] = request.referer unless URI(request.referer).path == \"/passwords\"\r\n end", "def after_omniauth_failure_path_for(_scope)\n\t\tnew_users_session_path\n\tend", "def store_location\n session[:redirect_url] = params[:redirect_url] if params[:redirect_url]\n session[:role] = params[:role] if params[:role]\n end", "def store_location!(scope)\n session[:\"#{scope}.return_to\"] = request.env['REQUEST_URI'] if request && request.get?\n end", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n return unless request.get? \n if (!request.fullpath.match(\"/users\") &&\n !request.xhr?) # don't store ajax calls\n session[\"user_return_to\"] = request.fullpath\n end\n end", "def after_sign_in_path_for(resource_or_scope)\n\t\tsession.fetch 'user_return_to', client_profil_path\n\tend", "def store_location\n\t\t# store last url - this is needed for post-login redirect to whatever the user last visited.\n\t\tif (request.fullpath != \"/users/sign_in\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_up\" &&\n\t\t\t\trequest.fullpath != \"/users/password\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_out\" &&\n\t\t\t\trequest.fullpath !~ /\\/users\\/confirmation/i &&\n\t\t\t\t!request.xhr?) # don't store ajax calls\n\t\t\tsession[:previous_url] = request.fullpath\n\t\tend\n\tend", "def after_sign_in_path_for(resource_or_scope)\n if params[:return_to].present?\n session[:return_to] = params[:return_to]\n elsif session[:return_to].present?\n session[:return_to]\n else\n root_url\n end\n end", "def store_and_redirect_location\n #session[:return_to] = \"/\"\n redirect_to \"/welcome/new\",:status => 401\n end", "def store_location!\n store_location_for(scope, attempted_path) if request.get? && !http_auth?\n end", "def store_location\n unless controller_name == \"sessions\" || action_name == \"activate\"\n session[:return_to] =\n if request.get?\n request.request_uri\n else\n request.referer\n end\n end\n end", "def after_sign_in_path_for(resource)\n clear_session_response_key\n request.env['omniauth.origin'] || stored_location_for(resource) || signed_in_root_path(resource)\n end", "def store_location(url = url_for(:controller => controller_name, :action => action_name))\n # It's possible to create a redirection attack with a redirect to data: protocol... and possibly others, so:\n # Whitelisting redirection to our own site and relative paths.\n url = nil unless url =~ /\\A([%2F\\/]|#{root_url})/\n session[:return_to] = url\n end", "def after_sign_in_path_for(resource)\n\t\trequest.env['omniauth.origin'] || stored_location_for(resource) || root_path\n\tend", "def store_current_location\n Rails.logger.debug \"[AUTHN] CALLED store_current_location\"\n Rails.logger.debug \"[AUTHN] REQUEST URL IS: #{request.url}\"\n store_location_for(:user, request.url) unless ( request.fullpath == \"/login\" || request.fullpath == \"/login_info\" || request.fullpath == \"/go_back\" || request.fullpath == '/logout' || request.fullpath.end_with?('/toggle_highlight') )\n end", "def authorize!(failure_path = nil)\n return if warden.authenticated?\n\n session[:return_to] = request.path if request.request_method == 'GET'\n redirect(failure_path)\n end", "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || home_path\n end", "def after_sign_up_path_for(resource_or_scope)\n session[:redirect_url] || super\n end", "def after_sign_out_path_for resource_or_scope\n redirect_uri = params[:redirect_uri]\n redirect_uri ? redirect_uri : super\n end", "def after_sign_in_path_for(resource_or_scope)\n if !session[:return_location].nil?\n return_location = session[:return_location]\n session[:return_location] = nil\n end\n return_location || stored_location_for(resource_or_scope) || signed_in_root_path(resource_or_scope)\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || account_url\n end", "def authentication_failed_redirect_path_for(_resource)\n after_sign_in_path_for(current_user)\n end", "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || root_path\n end", "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || root_path\n end", "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || root_path\n end", "def after_sign_in_path_for(resource_or_scope)\n session[:return_to] || super\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || landing_path\n end", "def store_location\n session[:return_to] = request.uri\n end", "def store_location(uri = nil)\n session[:return_to] = uri || request.request_uri\n end", "def after_devise_action_for(resource)\n stored_location_for(resource) || root_url\n end", "def after_sign_in_path_for(resource)\n session[:forwarding_url] || root_path\n end", "def store_location\n session[:return_to] = request.uri\n end", "def store_location\n session[:return_to] = request.uri\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || root_path\n end", "def after_sign_in_path_for(resource)\n session[:requested_url] || myriorunner_path\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def after_sign_in_path_for(resource)\n session[\"user_return_to\"] || dashboard_path\n end", "def after_sign_in_path_for(resource)\n if current_user.present? and !current_user.in_beta?\n current_user.update_attributes(:in_beta => true)\n end\n session_return_to = session[:redirect_after_oauth]\n session[:redirect_after_oauth] = nil\n # stored_location_for(resource) || \n session_return_to || root_path\n end", "def after_sign_in_path_for(resource)\n stored_location_for(resource) || user_dashboard_path(resource.id)\n end", "def after_sign_in_path_for(resource)\r\n stored_location_for(resource) || root_path\r\n end", "def redirect_after_unsuccessful_authentication\n params_hsh = {}\n params_hsh[:client_app] = params[:client_app] if params[:client_app]\n params_hsh[:redirect_back_url] = params[:redirect_back_url] if params[:redirect_back_url]\n redirect_to add_query_params(default_sign_in_url, params_hsh)\n return\n end", "def after_sign_in_path_for(resource)\n return request.env['omniauth.origin'] || stored_location_for(resource) || dashboards_path\n end", "def after_sign_in_path_for(resource)\n request.env['omniauth.origin'] || stored_location_for(resource) || user_foods_path(current_user)\n end", "def store_location\n session[:return_to] = request.original_url\n end", "def store_location\n session[\"return-to\"] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:return_to] = request.fullpath\n end", "def after_sign_in_path_for(resource)\n return stored_location_for(resource) || dashboard_path\n end", "def store_location\n session['return-to'] = request.path\n end" ]
[ "0.7282544", "0.71675694", "0.7097233", "0.69801223", "0.6937392", "0.6929037", "0.69032824", "0.6804344", "0.677797", "0.67439365", "0.66925716", "0.66922927", "0.6683306", "0.6657359", "0.6655114", "0.6637672", "0.66364115", "0.661656", "0.6616322", "0.6607153", "0.6593283", "0.6593273", "0.6591794", "0.6591338", "0.65862346", "0.65791094", "0.6564526", "0.6563767", "0.65429825", "0.65423733", "0.6516849", "0.65102684", "0.65102684", "0.65102684", "0.65102684", "0.65102684", "0.65102684", "0.6507852", "0.6507852", "0.6497632", "0.649465", "0.6487049", "0.6484823", "0.6477436", "0.6475987", "0.6468917", "0.6450086", "0.6441685", "0.6423445", "0.6421045", "0.6415009", "0.6402365", "0.6400538", "0.63879144", "0.63789564", "0.6364947", "0.63644594", "0.63598406", "0.6355739", "0.6337203", "0.63360107", "0.6332422", "0.63302636", "0.63302636", "0.63302636", "0.6319574", "0.6315642", "0.6307974", "0.6305677", "0.6296561", "0.62957346", "0.62905025", "0.6282751", "0.6273633", "0.6273633", "0.6273633", "0.6273633", "0.6272517", "0.6270534", "0.6266795", "0.62639105", "0.62629473", "0.62478864", "0.6247867", "0.6243786", "0.62375593", "0.62349606", "0.6227074", "0.6226196", "0.6220305", "0.621626", "0.621626", "0.621626", "0.621626", "0.621626", "0.621626", "0.621626", "0.621626", "0.621626", "0.62090486", "0.6205651" ]
0.0
-1
Try retrieving the URL options from the parent controller (usually ApplicationController). Instance methods are not supported at the moment, so only the classlevel attribute is used. source://devise//lib/devise/failure_app.rb29
def default_url_options(*args); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_missing method, *args, &block\n if main_app_url_helper?(method)\n main_app.send(method, *args)\n else\n super\n end\n end", "def method_missing method, *args, &block\n if main_app_url_helper?(method)\n main_app.send(method, *args)\n else\n super\n end\n end", "def method_missing method, *args, &block\n if main_app_url_helper?(method)\n main_app.send(method, *args)\n else\n super\n end\n end", "def decorator_options_for_error\n { user_options: { base_url: base_url } }\n end", "def default_url_options(options)\n defaults = {} \n my_controller = (options[:controller] || controller_name).to_sym\n my_action = (options[:action] || action_name).to_sym\n secure = ActionController::Base::SECURE\n \n if USE_SSL\n options[:override_only_path] ? options[:only_path] = options[:override_only_path] : options[:only_path] = false \n if ((secure[my_controller] || []).include?(my_action))\n defaults[:protocol] = 'https://' \n else\n defaults[:protocol] = 'http://'\n end\n end\n options.delete :override_only_path \n return defaults\n end", "def url_options_authenticate?(params = {})\n params = params.symbolize_keys\n if params[:controller]\n # find the controller class\n klass = eval(\"#{params[:controller]}_controller\".classify)\n else\n klass = self.class\n end\n klass.user_authorized_for?(current_visitor, params, binding)\n end", "def method_missing method, *args, &block\n method.to_s.end_with?('_path', '_url') and main_app.respond_to?(method) ? main_app.send(method, *args) : super\n end", "def method_missing(method, *args)\n if main_app_url_helper?(method)\n main_app.send(method, *args)\n else\n super\n end\n end", "def configure_default_url_options!\n DefaultUrlOptions.configure!(request)\n ensure\n def ApplicationController.configure_default_url_options!() end\n ### TODO - should be able to removed the filter but rails doesn't like it...\n end", "def url_options_authenticate?(params = {})\n params = params.symbolize_keys\n if params[:controller]\n # find the controller class\n klass = eval(\"#{params[:controller]}_controller\".classify)\n else\n klass = self.class\n end\n klass.user_authorized_for?(current_user, params, binding)\n end", "def valid_options\n super | [ :controller_matches ]\n end", "def call_failure_app(env, options = {})\n if config.failure_app\n options.merge!(:attempted_path => ::Rack::Request.new(env).fullpath)\n env[\"PATH_INFO\"] = \"/#{options[:action]}\"\n env[\"warden.options\"] = options\n\n _run_callbacks(:before_failure, env, options)\n config.failure_app.call(env).to_a\n else\n raise \"No Failure App provided\"\n end\n end", "def call_failure_app(env, opts = {})\n if env['warden'].custom_failure?\n opts[:original_response]\n else\n env[\"PATH_INFO\"] = \"/#{opts[:action]}\"\n env[\"warden.options\"] = opts\n\n # Call the before failure callbacks\n Warden::Manager._before_failure.each{|hook| hook.call(env,opts)}\n\n @failure_app.call(env).to_a\n end\n end", "def redirect_to(*options)\n target = fallback_action[2]\n if target\n target = controller.instance_exec(*options,&target)\n logger.debug \"redirection path: #{target}\" unless target.blank?\n super(target)\n else\n options.empty? ? super(current_user) : super(*options)\n end\n end", "def method_missing(method, *args, &block)\n if (method.to_s.end_with?('_path') || method.to_s.end_with?('_url')) && main_app.respond_to?(method)\n main_app.send(method, *args, &block)\n else\n super\n end\n end", "def method_missing(method, *args, &block)\n if method.to_s.end_with?('_path', '_url')\n if main_app.respond_to?(method)\n main_app.send(method, *args)\n else\n super\n end\n else\n super\n end\n end", "def url_options; end", "def skip_validation?\n devise_controller? || welcome_controller? || appointment_path?\n end", "def url_options_for_navigation_entry(entry)\n {\n controller: entry[\"controller\"],\n action: entry[\"action\"],\n only_path: true,\n params: entry[\"params\"]\n }.delete_if { |_k, v| v.nil? }\n end", "def default_url_options; end", "def url_for(options = {})\n options ||= {}\n url = case options\n when String\n options\n when Hash\n options = options.symbolize_keys\n if request.host[Regexp.new(@@retailer_server)] \n# route = options[:use_route]\n options = options.merge!({:only_path => false})\n# debugger\n# options = options.merge!({:use_route => \"proxy\", :extra_data => route}) if route\n elsif (request.domain && request.domain(4)[Regexp.new(@@embedded_optemo_server)]) \n options = options.merge!({:only_path => false}) # reverse merge host and port here as necessary\n else\n options = options.reverse_merge!(:only_path => options[:host].nil?)\n end\n super\n when :back\n controller.request.env[\"HTTP_REFERER\"] || 'javascript:history.back()'\n else\n polymorphic_path(options)\n end\n url\n end", "def validate_options!(_options)\n raise(NotImplemetedError, \"subclass responsability\")\n end", "def url_options\n {}\n end", "def auth_options\n { scope: resource_name, recall: \"#{controller_path}#unauthorized\" }\n end", "def url_options_for_module(alchemy_module)\n url_options_for_navigation_entry(alchemy_module[\"navigation\"] || {})\n end", "def redirect_to(url_options = {}, response_options = {})\n response_options[:status] ||= :see_other unless request.get?\n super url_options, response_options\n end", "def valid_options\n @valid_options ||= super + [:absolute_base, :relative_base]\n end", "def url_for options = {}\n @controller.url_for options\n end", "def default_url_options\n if defined?(Settings.application.protocol) && !Settings.application.protocol.blank?\n Rails.logger.debug(\"Setting default URL protocol to #{Settings.application.protocol}\")\n {protocol: Settings.application.protocol}\n else\n {}\n end\n end", "def options\n self.class.options(url)\n end", "def options_call\n OmniAuth.config.before_options_phase.call(env) if OmniAuth.config.before_options_phase\n verbs = OmniAuth.config.allowed_request_methods.collect(&:to_s).collect(&:upcase).join(', ')\n [200, {'Allow' => verbs}, []]\n end", "def default_url_options(options = {})\n if cannot_use_subdomain?\n { _subdomain: current_subdomain }\n else\n {}\n end\n end", "def inherit_view_paths\n instance_variable_get('@inherit_view_paths') || instance_variable_set('@inherit_view_paths', [controller_path] + (superclass.inherit_view_paths rescue []))\n end", "def enforce_viewing_context_for_show_requests \n end", "def permissable_options; read_inheritable_attribute(:permissable_options); end", "def better_errors_hack\n request.env['puma.config'].options.user_options.delete(:app) if request.env.key?('puma.config')\n end", "def default_url_options\n if request\n { port: request.port, protocol: request.protocol, host: request.host }\n else\n { protocol: 'https', host: provider.external_domain }\n end\n end", "def url_path\n self.class.url_path_class.new(self).call\n end", "def default_url_options\n { host: ScihistDigicoll::Env.lookup!(:app_url_base) }\n end", "def inherit_view_paths\n instance_variable_get('@inherit_view_paths') || instance_variable_set('@inherit_view_paths', [controller_path] + (superclass.inherit_view_paths rescue []))\n end", "def default_url_options_without_override\n super.merge(alternate_name.present? ? {prefill: {alternate: alternate_name}} : {})\n end", "def devise_controller?; end", "def base_path\n instance.options[:base_path]\n end", "def after_omniauth_failure_path_for(scope)\n super(scope)\n end", "def current_page_matches?(options)\n url_string = CGI.escapeHTML(url_for(options))\n request = @controller.request\n if url_string =~ /^\\w+:\\/\\//\n url_string == \"#{request.protocol}#{request.host_with_port}#{request.request_uri}\"\n else\n #request.request_uri.include?(url_string)\n @current_page_uri ||= request.request_uri.sub(/\\?.*$/,'')\n @current_page_uri == url_string\n end\n end", "def redirect_to(options = {}, response_options = {})\n response_options.merge!(status: :see_other) unless [\"GET\", \"POST\"].include?(request.request_method)\n super(options, response_options)\n end", "def default_url_options\n {\n host: ScihistDigicoll::Env.lookup(:app_url_base)\n }\n end", "def app_options\n # Unsafe to generate these twice, so use the cached version if it exists.\n return @app_options unless @app_options.nil?\n\n if @level.channel_backed?\n view_options(channel: get_channel_for(@level, @user))\n # readonly if viewing another user's channel\n readonly_view_options if @user\n end\n\n # Always pass user age limit\n view_options(is_13_plus: current_user && !current_user.under_13?)\n\n view_options(server_level_id: @level.id)\n if @script_level\n view_options(\n stage_position: @script_level.stage.absolute_position,\n level_position: @script_level.position,\n next_level_url: @script_level.next_level_or_redirect_path_for_user(current_user, @stage)\n )\n end\n\n if @script\n view_options(script_name: @script.name)\n end\n\n unless params[:share]\n # Set videos and callouts.\n view_options(\n autoplay_video: select_and_track_autoplay_video,\n callouts: select_and_remember_callouts(params[:show_callouts])\n )\n end\n\n # External project levels are any levels of type 'external' which use\n # the projects code to save and load the user's progress on that level.\n view_options(is_external_project_level: true) if @level.is_a? Pixelation\n\n if @level.channel_backed?\n view_options(is_channel_backed: true)\n view_options(server_project_level_id: @level.project_template_level.try(:id))\n end\n\n post_milestone = @script ? Gatekeeper.allows('postMilestone', where: {script_name: @script.name}, default: true) : true\n post_failed_run_milestone = @script ? Gatekeeper.allows('postFailedRunMilestone', where: {script_name: @script.name}, default: true) : true\n view_options(post_milestone_mode: post_milestone_mode(post_milestone, post_failed_run_milestone))\n\n @public_caching = @script ? ScriptConfig.allows_public_caching_for_script(@script.name) : false\n view_options(public_caching: @public_caching)\n\n if PuzzleRating.enabled?\n view_options(puzzle_ratings_url: puzzle_ratings_path)\n end\n\n if AuthoredHintViewRequest.enabled?\n view_options(authored_hint_view_requests_url: authored_hint_view_requests_path(format: :json))\n if current_user && @script\n view_options(authored_hints_used_ids: AuthoredHintViewRequest.hints_used(current_user.id, @script.id, @level.id).pluck(:hint_id).uniq)\n end\n end\n\n if @user\n pairing_check_user = @user\n elsif @level.channel_backed?\n pairing_check_user = current_user\n end\n\n if pairing_check_user\n recent_driver, recent_attempt, recent_user = UserLevel.most_recent_driver(@script, @level, pairing_check_user)\n if recent_driver && !recent_user.is_a?(DeletedUser)\n level_view_options(@level.id, pairing_driver: recent_driver)\n if recent_attempt\n level_view_options(@level.id, pairing_attempt: edit_level_source_path(recent_attempt)) if recent_attempt\n elsif @level.channel_backed?\n recent_channel = get_channel_for(@level, recent_user) if recent_user\n level_view_options(@level.id, pairing_channel_id: recent_channel) if recent_channel\n end\n end\n end\n\n @app_options =\n if @level.is_a? Blockly\n blockly_options\n elsif @level.is_a? Weblab\n weblab_options\n elsif @level.is_a?(DSLDefined) || @level.is_a?(FreeResponse) || @level.is_a?(CurriculumReference)\n question_options\n elsif @level.is_a? Widget\n widget_options\n elsif @level.is_a? Scratch\n scratch_options\n elsif @level.unplugged?\n unplugged_options\n else\n # currently, all levels are Blockly or DSLDefined except for Unplugged\n view_options.camelize_keys\n end\n\n # Blockly caches level properties, whereas this field depends on the user\n @app_options['teacherMarkdown'] = @level.properties['teacher_markdown'] if current_user.try(:authorized_teacher?)\n\n @app_options[:dialog] = {\n skipSound: !!(@level.properties['options'].try(:[], 'skip_sound')),\n preTitle: @level.properties['pre_title'],\n fallbackResponse: @fallback_response.to_json,\n callback: @callback,\n sublevelCallback: @sublevel_callback,\n app: @level.type.underscore,\n level: @level.level_num,\n shouldShowDialog: @level.properties['skip_dialog'].blank? && @level.properties['options'].try(:[], 'skip_dialog').blank?\n }\n\n # Sets video options for this level\n if @app_options[:level]\n @app_options[:level][:levelVideos] = @level.related_videos.map(&:summarize)\n end\n\n if current_user\n section =\n if @script\n current_user.sections_as_student.detect {|s| s.script_id == @script.id} ||\n current_user.sections_as_student.first\n else\n current_user.sections_as_student.first\n end\n if section && section.first_activity_at.nil?\n section.first_activity_at = DateTime.now\n section.save(validate: false)\n end\n @app_options[:experiments] =\n Experiment.get_all_enabled(user: current_user, section: section, script: @script).pluck(:name)\n @app_options[:usingTextModePref] = !!current_user.using_text_mode\n @app_options[:userSharingDisabled] = current_user.sharing_disabled?\n end\n\n @app_options\n end", "def is_active_link?(url, options = {})\n case options[:when]\n when :self, nil\n !request.fullpath.match(/^#{Regexp.escape(url)}(\\/.*|\\?.*)?$/).blank?\n when :self_only\n !request.fullpath.match(/^#{Regexp.escape(url)}\\/?(\\?.*)?$/).blank?\n when Regexp\n !request.fullpath.match(options[:when]).blank?\n when Array\n controllers = options[:when][0]\n actions = options[:when][1]\n (controllers.blank? || controllers.member?(params[:controller])) &&\n (actions.blank? || actions.member?(params[:action]))\n when TrueClass\n true\n when FalseClass\n false\n end\n end", "def controller_path(**options)\n url_for(controller: described_class.controller_path, only_path: true, **options)\n end", "def options\n render \"devise/shared/_links\"\n end", "def default_url_options\n {}\n end", "def set_url(opts)\n opts = check_params(opts,[:urls])\n super(opts)\n end", "def redirect_uri_settings\n return @redirect_uri_settings\n end", "def url_for options = {}\n return \"/#{options[:controller].downcase}/#{options[:action]}/#{options[:id]}\" if options[:id].present?\n \"/#{options[:controller.downcase]}/#{options[:action]}\"\nend", "def app_url\n url\n end", "def page_url_is_correct\n ( current_url =~ self.class.page_url_validation_value ) !=nil\n end", "def options\n\t\treturn {\n\t\t\tdomain: self.domain,\n\t\t\tpath: self.path,\n\t\t\tsecure: self.secure?,\n\t\t\thttponly: self.httponly?,\n\t\t\texpires: self.expires,\n\t\t\tmax_age: self.max_age,\n\t\t\tversion: self.version,\n\t\t}\n\tend", "def redirect_url; end", "def allow_path_state\n super\n end", "def url(name, *args)\n return base_controller.url(name, *args) if base_controller\n super\n end", "def url\n raise \"Implement in child class\"\n end", "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\nend", "def checkOptions\n if request.options?\n render nothing: true and return\n end\n end", "def restrict_access(options = {})\n self.access_denied_message = options[:access_denied_message] || \"You must be logged in to access this page\"\n self.require_no_user_message = options[:require_no_user_message] || \"You must be logged out to access this page\"\n self.unauthorized_redirect_path = options[:unauthorized_redirect_path] || :unauthorized_path\n include InstanceMethods\n end", "def current_class?(test_path)\n return 'active' if request.path == test_path\n return 'active' if request.path == root_path && test_path == users_path\n end", "def url\n if self.controller and self.action and self.page_id\n return \"/#{self.controller}/#{self.action}/#{self.page_id}\"\n end\n if self.controller and self.action\n return \"/#{self.controller}/#{self.action}\"\n end\n if self.controller\n return \"/#{self.controller}\"\n end\n return \"/#{self.shortcut}\"\n end", "def custom_initialize_instance_variables\n puts \"[Application Error]\".colorize(:color => :white, :background => :red) + \" [#{__FILE__}][Need to override #{__method__} method in #{self.class} class]\".red\n return false\n end", "def normalize_controller!\n if controller\n if controller.start_with?(\"/\")\n @options[:controller] = controller[1..-1]\n else\n @options[:controller] = controller\n end\n end\n end", "def scope_path\n opts = {}\n route = :\"new_#{scope}_session_path\"\n alt_route = :\"new_#{scope}_ichain_session_path\"\n opts[:format] = request_format unless skip_format?\n\n config = Rails.application.config\n opts[:script_name] = (config.relative_url_root if config.respond_to?(:relative_url_root))\n\n context = send(Devise.available_router_name)\n\n if context.respond_to?(route)\n context.send(route, opts)\n elsif context.respond_to?(alt_route)\n context.send(alt_route, opts)\n elsif respond_to?(:root_path)\n root_path(opts)\n else\n \"/\"\n end\n end", "def try_options\n\t\t\treturn unless request.http_method == :OPTIONS\n\n\t\t\tallow = available_endpoint&.allow\n\t\t\thalt 404 unless allow\n\t\t\tresponse.headers['Allow'] = allow\n\t\tend", "def default_url_options=(_arg0); end", "def options_for(action)\n action = action == :new_action ? [action] : \"#{action}\".split('_').map(&:to_sym)\n options = self.class.send(action.first)\n options = options.send(action.last == :fails ? :fails : :success) if ResourceController::FAILABLE_ACTIONS.include? action.first\n \n options\n end", "def back_url\n if (controller_name == 'sessions') || (controller_name == 'users')\n url = controller_name + '/new'\n elsif (request.referrer != request.path)\n url = request.referrer\n elsif (controller_name != 'sessions') && (controller_name != 'users')\n url = root_path + controller_name\n else \n url = root_path \n end \n end", "def failed_path\n\t\t\t\t\t\tmain_app.root_path\n\t\t\t\t\tend", "def options\n app.options\n end", "def options\n app.options\n end", "def context_url\n if params[:context_type] == 'countries'\n admin_country_url(@country)\n else\n admin_province_url(@province)\n end\n end", "def supports_path?; end", "def auth_controller?\n false\n end", "def my_routes\n my_routes = []\n exceptions = %w(Login Signin)\n self.class.routes['GET'].each do |r|\n route = r.first.to_s.gsub(/\\W+|mix/,'').capitalize\n my_routes << route unless exceptions.include?(route)\n end\n return my_routes\n end", "def url_allowlist; end", "def validate_url(params={})\n url = controller.send(validate_url_name, \n :return_url => user_session_redirect_url(params[:return_url]))\n return url if params.blank?\n url << \"?\" if url.match('\\?').blank?\n params.each do |key, value|\n next if [:controller, :action, :return_url].include?(key)\n next if key.blank? or value.blank?\n url << \"&#{calling_system}_#{key}=#{CGI::escape(value)}\"\n end\n url\n end", "def valid_options\n super | [\n :controllers,\n :ignore_tagging\n ]\n end", "def use_url_path_for_native_authorization\n @config.instance_variable_set(:@use_url_path_for_native_authorization, true)\n end", "def freeze\n opts[:class_level_routes].freeze\n super\n end", "def class_settings\n if controller.controller_name == 'settings'\n \"current\"\n end\n end", "def set_boot_location(opts)\n opts = check_params(opts,[:location])\n super(opts)\n end", "def method_missing(method, *args)\r\n return super unless defined?(Rails) && Rails.application.routes.url_helpers.respond_to?(method)\r\n # Check to see if one of the args is an open struct. If it is, we'll assume it's the\r\n # test stub and try to call a path or url attribute.\r\n if args.any? {|arg| arg.kind_of?(MandrillMailer::Mock)}\r\n # take the first OpenStruct found in args and look for .url or.path\r\n args.each do |arg|\r\n if arg.kind_of?(MandrillMailer::Mock)\r\n break arg.url || arg.path\r\n end\r\n end\r\n else\r\n options = args.extract_options!.merge({host: MandrillMailer.config.default_url_options[:host], protocol: MandrillMailer.config.default_url_options[:protocol]})\r\n args << options\r\n Rails.application.routes.url_helpers.method(method).call(*args)\r\n end\r\n end", "def is_controller?; false; end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def auto_url_for(resource)\n\n\n\n config = active_admin_resource_for(resource.class)\n\n\n\n return unless config\n\n\n\n\n\n\n\n if config.controller.action_methods.include?(\"show\") &&\n\n\n\n authorized?(ActiveAdmin::Auth::READ, resource)\n\n\n\n url_for config.route_instance_path resource\n\n\n\n elsif config.controller.action_methods.include?(\"edit\") &&\n\n\n\n authorized?(ActiveAdmin::Auth::UPDATE, resource)\n\n\n\n url_for config.route_edit_instance_path resource\n\n\n\n end\n\n\n\n end", "def default_url_options\n Linkable.default_url_options\n end", "def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end", "def auto_url_for(resource)\n config = active_admin_resource_for(resource.class)\n return unless config\n\n if config.controller.action_methods.include?(\"show\") &&\n authorized?(ActiveAdmin::Auth::READ, resource)\n url_for config.route_instance_path resource, url_options\n elsif config.controller.action_methods.include?(\"edit\") &&\n authorized?(ActiveAdmin::Auth::EDIT, resource)\n url_for config.route_edit_instance_path resource, url_options\n end\n end", "def routing_mismatch\n raise ::ActionController::RoutingError,\"URL not supported\"\n end", "def default_url_options(options ={})\n if Rails.env.production?\n if TestDB::Application.config.ssl_enabled == true\n options.merge({ :only_path => false, :protocol => 'https' })\n else\n options.merge({})\n end\n else\n options.merge({}) \n end\n \n end", "def respond_to?(method, include_all = false)\n if method.to_s.end_with?('_path', '_url')\n if main_app.respond_to?(method)\n true\n else\n super\n end\n else\n super\n end\n end", "def after_inactive_sign_up_path_for(resource)\n scope = Devise::Mapping.find_scope!(resource)\n router_name = Devise.mappings[scope].router_name\n context = router_name ? send(router_name) : self\n context.respond_to?(:root_path) ? context.root_path : \"/\"\n # context.respond_to?(:index) ? context.index : \"/users\"\n end" ]
[ "0.5749755", "0.5749755", "0.5749755", "0.5680493", "0.5625153", "0.5566728", "0.5554148", "0.5535013", "0.5455548", "0.5412374", "0.5360341", "0.52920246", "0.5238842", "0.5231411", "0.52303535", "0.5215854", "0.5173967", "0.51597446", "0.51214266", "0.5102096", "0.50556886", "0.5045422", "0.50226676", "0.49996778", "0.4943064", "0.49343765", "0.4926513", "0.49241975", "0.49159923", "0.4911276", "0.49043328", "0.4894245", "0.48554978", "0.485043", "0.4846104", "0.48447186", "0.4841078", "0.4818524", "0.4788889", "0.47802058", "0.47601703", "0.4750497", "0.4741467", "0.4730794", "0.47258973", "0.4723743", "0.47098094", "0.4703918", "0.46995786", "0.46855584", "0.46746257", "0.4673531", "0.46702978", "0.46692216", "0.46553278", "0.46327633", "0.46315625", "0.4630519", "0.4629802", "0.46249872", "0.46210983", "0.4615939", "0.46051195", "0.46032384", "0.46021414", "0.45999", "0.45990682", "0.45979878", "0.45973185", "0.45965314", "0.45955327", "0.45861736", "0.45772433", "0.4576013", "0.4574023", "0.45645565", "0.45645565", "0.45639083", "0.455251", "0.45444205", "0.45440745", "0.45425838", "0.45394814", "0.45294628", "0.452647", "0.45204985", "0.4518589", "0.45064458", "0.44997406", "0.44973695", "0.44940984", "0.44940984", "0.44922078", "0.44867074", "0.44866964", "0.4486509", "0.4480359", "0.44770256", "0.44761378", "0.44740793" ]
0.4601062
65
Returns the value of attribute warden. source://devise//lib/devise/hooks/proxy.rb11
def warden; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warden\n request.env['warden']\n end", "def warden\n request.env['warden']\n end", "def warden\n request.env['warden']\n end", "def warden\n env['warden']\n end", "def warden\n env['warden']\n end", "def warden\n request.env['warden']\n end", "def warden\n @warden ||= begin\n env['warden']\n end\n end", "def warden_options\n env['warden.options']\n end", "def current_user\n warden.user\n end", "def current_user\n warden.user\n end", "def current_user\n warden.user(WARDEN_SCOPE)\n end", "def current_wink_user_id\n request.env['auth.wink.user_id']\n end", "def current_user(*args)\n warden.user(*args)\n end", "def current_user(*args)\n warden.user(*args)\n end", "def strategies\n Warden::Strategies\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def passworde\n @passworde\n end", "def getforwardingentitypassword\r\n return getvalue(SVTags::FORWARDING_ENTITY_PASSWORD)\r\n end", "def protection\n return @protection\n end", "def protection\n\t\treturn @shieldPower\n\tend", "def encrypted_password\n read_attribute(:password)\n end", "def current_user=(user)\n warden.set_user(user, event: :authentication)\n end", "def current_user(*args)\n warden.user(*args)\n end", "def current_user\n return @current_user ||= warden.authenticate(:scope => :user)\n end", "def bit_locker_encrypt_device\n return @bit_locker_encrypt_device\n end", "def wldap32\n client.railgun.wldap32\n end", "def password\n \t\t return password_virtual_attr\n end", "def getPass\n\t\treturn @pass\n\tend", "def authenticate_from_warden\n warden = env[\"warden\"]\n return unless warden\n\n env[\"warden\"].authenticate(scope: \"user\")\n end", "def authenticate!\n warden.authenticate!\n end", "def warner\n Dynamic[:warner]\n end", "def authenticated_user?\n warden.authenticated?\n end", "def jwt_payload\n @jwt_payload ||= request.env['JWT_PAYLOAD']\n end", "def cloud_app_security\n return @cloud_app_security\n end", "def password_protected\n @attributes[:password_protected]\n end", "def devise_mapping\n @devise_mapping ||= request.env[\"devise.mapping\"]\n end", "def host_lead_dxuser\n host_lead_member.user.dxuser\n end", "def warden_cookies\n warn \"warden_cookies was never functional and is going to be removed in next versions\"\n env['warden.cookies'] ||= {}\n end", "def old_password\n @old_password\n end", "def login_attribute\n super\n end", "def guest_lead_dxuser\n guest_lead_member.user.dxuser\n end", "def app_locker_application_control\n return @app_locker_application_control\n end", "def manager_password\n\t\t@manager_password\n\tend", "def devise_parameter_sanitizer; end", "def getsecretword\r\n\t\t return @secretword\r\n\t\t end", "def site_admin\n @attributes[:site_admin]\n end", "def site_admin\n @attributes[:site_admin]\n end", "def user\n\t\tdatastore['IRCNICK']\n\tend", "def password\n return self[:password]\n end", "def ldap\n @attributes[:ldap]\n end", "def firewall_profile_domain\n return @firewall_profile_domain\n end", "def wtk\n MnoEnterprise.jwt(user_id: current_user.uid)\n end", "def post_on_wall_authorized\n return nil unless (temp_post_on_wall_authorized = read_attribute(:post_on_wall_authorized))\n # logger.debug2 \"temp_extended_post_on_wall_authorized = #{temp_extended_post_on_wall_authorized}\"\n YAML::load encrypt_remove_pre_and_postfix(temp_post_on_wall_authorized, 'post_on_wall_authorized', 47)\n end", "def current_sign_in_ip; end", "def current_sign_in_ip; end", "def getpassword()\r\n return getvalue(SVTags::PASSWORD)\r\n end", "def device_threat_protection_enabled\n return @device_threat_protection_enabled\n end", "def user(*args)\n warden.user(*args)\n end", "def user(*args)\n warden.user(*args)\n end", "def enterprise_app_block_trust\n return @enterprise_app_block_trust\n end", "def is_admin_pass\r\n get_setting(:is_admin_pass, IS_ADMIN_PASS)\r\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def malware_settings\r\n MalwareSettingsController.instance\r\n end", "def firewall_profile_public\n return @firewall_profile_public\n end", "def app_config_key_value\n return @app_config_key_value\n end", "def dedicated_ip\n @attributes[:dedicated_ip]\n end", "def inbound_trust\n return @inbound_trust\n end", "def current_dwelling\n @current_dwelling ||= current_user.dwelling if current_user\n end", "def app_store_require_password\n return @app_store_require_password\n end", "def lucee_password\n @lucee_password||=@options['lucee_password']\n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def ldap_username\n @attributes[:ldap_username]\n end", "def user_data\n User.user_data login\n end", "def appl_settings\n @appl_settings\n end", "def admin_username\n vm.os_profile.admin_username\n end", "def password\n @attributes[:password]\n end", "def password\n @attributes[:password]\n end", "def user_name\n read_attribute('user_name') || \"anonymous\"\n end", "def authenticatable_salt\n read_attribute(:authenticatable_salt)\n end", "def password_require_mixed\n @attributes[:password_require_mixed]\n end", "def restricted_password\n return nil if game_state == 'active'\n\n password.word\n end", "def pass\n conf['dashboard']['pass']\n end", "def set_garden\n @garden = Garden.find(params[:id])\n end", "def set_garden\n @garden = Garden.find(params[:id])\n end", "def wireless_settings\r\n WirelessSettingsController.instance\r\n end", "def cookie_value\n @screen_data.to_json\n end", "def web_browser_cookie_settings\n return @web_browser_cookie_settings\n end", "def pass\n return @pass\n end", "def getPassword()\n return @password\n\tend", "def intrusion_settings\r\n IntrusionSettingsController.instance\r\n end", "def ldap\n conf['dashboard']['ldap']\n end", "def devise_controller?; end", "def attack_technique\n return @attack_technique\n end", "def code_lens_provider\n attributes.fetch(:codeLensProvider)\n end", "def core_getRecoveryPasswordPermission\n return CORE_RECOVERYPASSWORDPERMISSION if defined? CORE_RECOVERYPASSWORDPERMISSION\n # accedo al config.yml\n directory = core_getCacheDirectory\n config = YAML.load(\n File.read(File.expand_path(\"#{directory}/config.yml\", __FILE__))\n )\n # controllo che il file di configurazione esista e abbia i dati necessari\n return false if !config['recovery_password'] || config['recovery_password'].nil?\n # ritorno valore letto\n return config['recovery_password']\n end", "def current_settings\n Weby::Settings\n end" ]
[ "0.75570065", "0.75570065", "0.75570065", "0.7473051", "0.7473051", "0.73836493", "0.69030476", "0.6588906", "0.654929", "0.64261997", "0.6172713", "0.57391673", "0.55661714", "0.55661714", "0.5532922", "0.54861", "0.54861", "0.54322773", "0.5395543", "0.53577125", "0.5355256", "0.5318956", "0.52102107", "0.5204348", "0.51967597", "0.5183474", "0.5178683", "0.5178597", "0.5169601", "0.51578355", "0.51111376", "0.51084554", "0.5101053", "0.5072243", "0.5046549", "0.5010464", "0.4999525", "0.4997047", "0.4966503", "0.49641857", "0.49582735", "0.49558574", "0.49476823", "0.49286962", "0.49278763", "0.4923409", "0.49130416", "0.49130416", "0.4903957", "0.4901383", "0.4885725", "0.48806983", "0.48784605", "0.48689705", "0.4866105", "0.4866105", "0.4863265", "0.48617563", "0.48599127", "0.48599127", "0.48483735", "0.48406747", "0.48294222", "0.48294222", "0.48185953", "0.48175442", "0.48155215", "0.4811956", "0.4810132", "0.48003492", "0.47963288", "0.47944114", "0.47910377", "0.47908187", "0.47906032", "0.47895283", "0.47852015", "0.47723663", "0.47723663", "0.47714913", "0.47652027", "0.47648996", "0.47605222", "0.4752781", "0.47507894", "0.47507894", "0.4748891", "0.47478408", "0.47467542", "0.4745863", "0.47455746", "0.47424373", "0.47421843", "0.4741062", "0.47403693", "0.47361165", "0.47295368", "0.47280788" ]
0.56714153
12
Configure default email options source://devise//lib/devise/mailers/helpers.rb17
def devise_mail(record, action, opts = T.unsafe(nil), &block); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_email(options)\n @recipients = options[:recipients]\n @from = options[:from] || SocialNewsConfig[\"email_addrs\"][\"support\"] \n @cc = options[:cc] || ''\n @bcc = options[:bcc] || ''\n @subject = SUBJECT_PREFIX + (options[:subject] || 'No Subject')\n @body = options[:body] || {}\n @headers = options[:headers] || {}\n @charset = options[:charset] || 'utf-8'\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def email_via\n @email_via || :smtp\n end", "def setup_recipients( email )\r\n if RAILS_ENV == 'production'\r\n return email\r\n else\r\n return AppConfig.DEBUG_EMAIL_ADDRESS\r\n end\r\n end", "def setup_delivery\n method = @config.delivery['method'] || :smtp\n options = @config.delivery['options'] || {}\n\n options.keys.each do |key|\n options[(key.to_sym rescue key) || key] = options.delete(key)\n end\n\n options = Idid::Configuration::SMTP_DEFAULTS.merge options if method == :smtp\n options = Idid::Configuration::EXIM_DEFAULTS.merge options if method == :exim\n\n mail_defaults_for method, options\n end", "def default_email( cid )\n return \"#{cid}@#{DEFAULT_DOMAIN}\"\n end", "def email(options)\n puts \"sending to #{options}\"\n Pony.mail(BASE_EMAIL.merge(options))\n end", "def set_email_host_and_protocol\n unless ( ActionMailer::Base.default_url_options.has_key?( :host ) )\n ActionMailer::Base.default_url_options[ :host ] = request.host_with_port\n end\n\n unless ( ActionMailer::Base.default_url_options.has_key?( :protocol ) )\n ActionMailer::Base.default_url_options[ :protocol ] = request.protocol\n end\n end", "def config_mail\n ActionMailer::Base.raise_delivery_errors = true\n ActionMailer::Base.delivery_method = :smtp\n ActionMailer::Base.perform_deliveries = true\n #mail_server = MailConfig.read_mail_server_config\n\n ActionMailer::Base.smtp_settings = {\n :address => @@mail_server.mail_server_address,\n :port => @@mail_server.mail_server_port,\n :domain => @@mail_server.mail_server_domain,\n #:authentication => :plain,\n #:user_name => mail_server.mail_server_username,\n # hthngoc - Fix: decode pwd before use\n #:password => mail_server.mail_server_password,\n :enable_starttls_auto => @@mail_server.mail_server_enable_tls,\n :openssl_verify_mode => 'none'\n }\n end", "def smtp_options\n {\n address: smtp_address,\n port: smtp_port,\n domain: smtp_domain,\n authentication: smtp_authentication,\n user_name: smtp_user_name,\n password: smtp_password\n }.select { |_key, value| value.presence }\n end", "def devise_mail(record, action, opts={})\n logger.debug Rails.application.secrets.email_sender\n logger.debug Rails.application.secrets.email_domain_name\n initialize_from_record(record)\n mail(headers_for(action, opts)) do |format|\n format.text\n format.html\n end\n end", "def configure_email\n @config[\"config\"][\"smtp\"] = {}\n if @config[\"config\"][\"contact\"][\"email\"]\n @config[\"config\"][\"smtp\"][\"smtp_username\"] = @config[\"config\"][\"contact\"][\"email\"]\n end\n if @args.empty?\n box(\"You will now need an email to drive emails from the app. If you don't have one, register a Gmail #{TTY::Link.link_to(\"here.\", \"http://url.perlmutterapp.com/gmail\")}\")\n smtp_verified = false\n until smtp_verified\n @config[\"config\"][\"smtp\"][\"smtp_username\"] = @prompt.ask(prompt_box(\"What is the email to send notifications from?\"), default: @config[\"config\"][\"smtp\"][\"smtp_username\"], required: true) { |q| q.validate :email, \"Invalid email\" }\n @config[\"config\"][\"smtp\"][\"smtp_password\"] = @prompt.mask(prompt_box(\"What is the email\\'s password?\"), required: true)\n @config[\"config\"][\"smtp\"][\"smtp_port\"] = 587\n case @prompt.select(prompt_box(\"Please select the email's provider to configure the app:\"), %W[Gmail Yahoo AOL Outlook Office365 Other])\n when \"Gmail\"\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = \"smtp.gmail.com\"\n when \"Yahoo\"\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = \"smtp.mail.yahoo.com\"\n @config[\"config\"][\"smtp\"][\"smtp_port\"] = 465\n when \"AOL\"\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = \"smtp.aol.com\"\n when \"Outlook\"\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = \"smtp.live.com\"\n when \"Office365\"\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = \"smtp.office365.com\"\n else\n box(\"You will now need the email\\'s SMTP settings. You can get help finding these #{TTY::Link.link_to(\"here.\", \"http://url.perlmutterapp.com/smtp\")}\")\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = @prompt.ask(prompt_box(\"What is the email\\'s SMTP address?\"), default: @config[\"config\"][\"smtp\"][\"smtp_address\"], required: true)\n @config[\"config\"][\"smtp\"][\"smtp_port\"] = @prompt.ask(prompt_box(\"What is the email\\'s SMTP port?\"), default: @config[\"config\"][\"smtp\"][\"smtp_port\"], convert: :int, required: true) { |q| q.validate /\\A\\d+\\z/, \"Must be integer\" }\n end\n smtp_verified = verify_email\n end\n else\n @config[\"config\"][\"smtp\"][\"smtp_username\"] = get_argument_value(\"smtp_username\", true, nil)\n @config[\"config\"][\"smtp\"][\"smtp_password\"] = get_argument_value(\"smtp_password\", true, nil)\n @config[\"config\"][\"smtp\"][\"smtp_address\"] = get_argument_value(\"smtp_address\", true, nil)\n @config[\"config\"][\"smtp\"][\"smtp_port\"] = get_argument_value(\"smtp_port\", false, 587)\n smtp_verified = verify_email\n unless smtp_verified\n raise ArgumentError\n end\n end\nend", "def default_user_email\n return default_email( DEFAULT_USER )\n end", "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "def get_delivery_options\n # do we use the custom mail configuration?\n if custom?\n smtp_settings = {\n user_name: username,\n password: password,\n address: server,\n port: port,\n ssl: ssl,\n authentication: authentication,\n openssl_verify_mode: openssl,\n enable_starttls_auto: starttls\n }\n else\n smtp_settings = {\n user_name: username,\n password: password,\n address: server,\n port: port,\n ssl: ssl\n }\n end\n end", "def restartOptionsServerConfiguration\n # SAME ON config/initializers/mailer.rb !!!\n begin\n # mail_delivery_method can be :smtp, :smtp_tls, :sendmail, :test\n delivery_method = Option.getValue(MAIL_DELIVERY_METHOD).nil? ? nil : Option.getValue(MAIL_DELIVERY_METHOD).strip\n if delivery_method == ':sendmail'\n ActionMailer::Base.delivery_method = :sendmail\n elsif delivery_method == ':test'\n ActionMailer::Base.delivery_method = :test\n else\n ActionMailer::Base.delivery_method = :smtp\n end\n ActionMailer::Base.smtp_settings = {\n :address => Option.getValue(SMTP_ADDRESS).nil? ? nil : Option.getValue(SMTP_ADDRESS).strip,\n :port => Option.getValue(SMTP_PORT).nil? ? nil : Option.getValue(SMTP_PORT).strip,\n :domain => Option.getValue(SMTP_DOMAIN).nil? ? nil : Option.getValue(SMTP_DOMAIN).strip,\n :user_name => Option.getValue(SMTP_USER_NAME).nil? ? nil : Option.getValue(SMTP_USER_NAME).strip,\n :password => Option.getValue(SMTP_PASSWORD).nil? ? nil : Option.getValue(SMTP_PASSWORD).strip\n }\n if delivery_method == ':smtp_tls' and RUBY_VERSION > \"1.8.6\"\n ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true\n end\n smtp_authentication = Option.getValue(SMTP_AUTHENTICATION).nil? ? nil : Option.getValue(SMTP_AUTHENTICATION).strip\n if smtp_authentication == ':login' then \n ActionMailer::Base.smtp_settings[:authentication] = :login\n elsif smtp_authentication == ':cram_md5'\n ActionMailer::Base.smtp_settings[:authentication] = :cram_md5\n else\n ActionMailer::Base.smtp_settings[:authentication] = :plain\n end\n rescue => e\n RAILS_DEFAULT_LOGGER.error e\n RAILS_DEFAULT_LOGGER.error \"... database not created yet?\"\n end\nend", "def default_email=(default_email)\n\n if !default_email.nil? && default_email.to_s.length > 250\n fail ArgumentError, \"invalid value for 'default_email', the character length must be smaller than or equal to 250.\"\n end\n\n @default_email = default_email\n end", "def admin_email\n ContactMailer.admin_email\n end", "def send_email( options={} )\n mail_opts = {\n :to => self.config[\"email\"][\"to\"],\n :from => self.config[\"email\"][\"from\"],\n :subject => \"A Message from MartSearch...\",\n :body => \"You have been sent this message from your MartSearch portal.\"\n }.merge!(options)\n \n mail = Mail.new do\n from mail_opts[:from]\n to mail_opts[:to]\n subject mail_opts[:subject]\n body mail_opts[:body]\n end\n \n if self.config[\"email\"][\"smtp\"]\n smtp_opts = { :host => \"127.0.0.1\", :port => \"25\" }\n \n [:host, :port, :user, :pass].each do |opt|\n if self.config[\"email\"][\"smtp\"][opt.to_s]\n smtp_opts[opt] = self.config[\"email\"][\"smtp\"][opt.to_s]\n end\n end\n \n Mail.defaults do\n smtp smtp_opts[:host], smtp_opts[:port]\n if smtp_opts[:user] then user smtp_opts[:user] end\n if smtp_opts[:pass] then pass smtp_opts[:pass] end\n end\n \n mail.deliver!\n else\n # Send via sendmail\n sendmail = `which sendmail`.chomp\n if sendmail.empty? then sendmail = \"/usr/sbin/sendmail\" end\n \n IO.popen('-', 'w+') do |pipe|\n if pipe\n pipe.write(mail.to_s)\n else\n exec(sendmail, \"-t\")\n end\n end\n end\n end", "def casein_config_email_from_address\n\t\t'[email protected]'\n\tend", "def app_email\n dflt = Rails.application.routes.url_helpers.contact_us_url || ''\n Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)\n end", "def admin_email(e=nil)\n return @admin_email unless e\n @admin_email = e\n end", "def send_email(options = {})\n options = { server: 'remotesmtp.freescale.net',\n port: 25,\n from: '',\n from_alias: '',\n subject: '',\n body: '',\n to: ''\n }.merge(options)\n\n # Force to an array\n to = options[:to].respond_to?('each') ? options[:to] : [options[:to]]\n\n # Convert any user objects to an email\n to = to.map { |obj| obj.respond_to?('email') ? obj.email : obj }\n\n to.uniq.each do |addr|\n msg = <<END_OF_MESSAGE\nFrom: #{options[:from_alias]} <#{options[:from]}>\nTo: #{addr}\nSubject: #{options[:subject]}\n\n#{options[:body]}\n\nEND_OF_MESSAGE\n\n begin\n # Exceptions raised here will be caught by rescue clause\n Net::SMTP.start(options[:server], options[:port]) do |smtp|\n smtp.send_message msg, options[:from], addr\n end\n rescue\n warn \"Email not able to be sent to address '#{addr}'\"\n end\n end\n end", "def determine_default_user_email\n Cadenero.default_user_email = options[\"default-user-email\"].presence ||\n ask(\"What will be the email for the default user owner of the default account? [[email protected]]\").presence ||\n '[email protected]'\n end", "def email_optional?\n false\n end", "def generic_email_domain_check\n\n notification_helper = NotificationHelper.new\n\n if is_generic_email?\n notification_helper.set_generic_email(self.id)\n end\n\n\n end", "def ar_mailer_smtp_settings(new_settings = nil)\n ar_mailer_setting(:smtp_settings, new_settings)\n end", "def user_options\n @user_options ||= {\n :max_email_size => self.max_email_size\n }\n end", "def set_email(email, vars = {}, lists = {}, templates = {})\n data = {:email => email}\n data[:vars] = vars unless vars.empty?\n data[:lists] = lists unless lists.empty?\n data[:templates] = templates unless templates.empty?\n self.api_post(:email, data)\n end", "def post_edit_email\n NotificationMailer.post_edit_email('[email protected]')\n end", "def reset_password_email\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def delivery_options(address, port, domain, user_name, password,\n authentication, enable_starttls_auto)\n @mail.delivery_method :smtp, address: address,\n port: port,\n domain: domain,\n user_name: user_name,\n password: password,\n authentication: authentication,\n enable_starttls_auto: enable_starttls_auto\n end", "def email_enabled\n self[:email_enabled]\n end", "def email\n options.email || repo.email\n end", "def mailer_set_url_options\n ActionMailer::Base.default_url_options[:host] = request.host_with_port\n end", "def email\n if self[:email] && !@email_name\n self[:email]\n elsif self.email_name && self.email_domain\n self[:email] = \"#{self.email_name}@#{self.email_domain}\"\n end\n end", "def email_attributes(mail)\n if mail['ar_mailer_settings']\n ar_settings = JSON.parse(mail['ar_mailer_settings'].value).stringify_keys\n mail['ar_mailer_settings'] = nil\n else\n ar_settings = {}\n end\n\n email_options = {}\n email_options[:delivery_time] = ar_settings.delete('delivery_time')\n email_options[:smtp_settings] = smtp_settings(ar_settings)\n email_options[:mail] = mail.encoded\n email_options[:from] = (mail['return-path'] && mail['return-path'].spec) || mail.from.first\n email_options.reverse_merge!(ar_settings['custom_attributes'] || {})\n end", "def setup_email(user, company_id)\n # Check the environment files for each environment for these settings.\n # EMAIL_SAFETY will make sure email messages don't go out to real people in dev and staging environments.\n \n email_safety_val = SystemSettingService.get_value_for_key('email_safety.enabled', company_id)\n \n if email_safety_val != 'no'\n safety_address_val = SystemSettingService.get_value_for_key('email_safety.forward_to_email', company_id)\n \n recipients safety_address_val\n safety_dance = \"** EMAIL SAFETY TURNED ON. Intended recipient: #{user.email} **\"\n else \n recipients \"#{user.email}\"\n end\n #bcc \"[email protected]\"\n from \"[email protected]\"\n subject \"Klaratee: \"\n body :user => user, :safety_text => safety_dance\n sent_on Time.now\n end", "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def set_mailer_host\n ActionMailer::Base.default_url_options[:host] = host\n ActionMailer::Base.smtp_settings.update(user_name: ENV[\"#{current_website.subdomain}_email\"],password: ENV[\"#{current_website.subdomain}_password\"])\n end", "def email=(value)\n if value.present?\n super(value)\n else\n super(nil)\n end\n end", "def email=(value)\n if value.present?\n super(value)\n else\n super(nil)\n end\n end", "def setup_admin_email(official)\n @recipients = Array.new\n @recipients << 'Jeremy Driscoll <[email protected]>'\n do_not_deliver! if @recipients.empty?\n @from = AppConfig.admin_email\n @subject = \"[Q2016] \"\n @sent_on = Time.now\n @body[:official] = official\n end", "def email\n\t\tnil\n\tend", "def email\n\t\tnil\n\tend", "def email\n @email ||= ENV['EMAIL']\n end", "def deliver_emails?\n if self.default_options[:deliver_emails].nil?\n true\n else\n self.default_options[:deliver_emails]\n end\n end", "def email\n em = Email.new\n em.host = domain\n em.user = \"info\"\n em\n end", "def hf_email_opts\n return options_for_select(@email_enum, @agg)\n end", "def default_value_for_email\n git_global_config_for(\"user.email\") do |email_val|\n warn(\"Using email from git as: #{email_val}\")\n end\n end", "def email=(value)\n self.from_email = value\n end", "def email_required?; false end", "def set_default_contact_method\n self.contact_methods = [{name: 'email', value: self.email}].to_json\n end", "def casein_config_email_from_address\n '[email protected]'\n end", "def smtp_settings\n ActionMailer::Base.smtp_settings rescue ActionMailer::Base.server_settings\n end", "def default_values\n self.communication_email ||= self.email\n end", "def email; end", "def email; end", "def email; end", "def email; end", "def email\n preferred_email\n end", "def default_email_preferences\n EmailPreference.default_set_for_user(self) if email_preferences.blank?\n end", "def set_from_email_address\n self.from_user_email ||= Settings::NotificationsFromEmail || user&.email\n end", "def setup_email(user)\n @recipients = user.email\n @body[:user] = user\n @from = FROM_EMAIL\n @subject = case ENV['RAILS_ENV'] \n when 'development': \"[YourApp Development] \"\n when 'staging': \"[YourApp Staging] \"\n else \"[YourApp] \"\n end\n @sent_on = Time.now\n headers \"Reply-to\" => FROM_EMAIL\n end", "def deliver_invitation_with options={}\n if model = options[:model]\n # self.override_devise_notification = \"invitation_instructions_with_#{model.class.model_name.to_s.underscore}\"\n self.override_devise_notification = \"invitation_instructions_with_member\"\n self.override_devise_model = model\n end\n if message = options[:personal_message]\n self.invitation_message = message\n end\n deliver_invitation\n end", "def setup_email(user)\n recipients user.email\n from self.contact_email\n sent_on Time.now\n end", "def to_ude\n UserDefaultEmail.new self.as_ude_attributes\n end", "def format\n options['format'] || :email\n end", "def set_defaults\n self.emailing_sections.each do |section|\n section.set_defaults\n end\n end", "def email(name, &block)\n raise \"The email '#{name}' is already defined\" if self.messages[name].present?\n self.messages[name] = Proc.new { |*attrs|\n message = Mail::Message.new(self.app)\n message.defaults = self.defaults if self.defaults.any?\n message.delivery_method(*delivery_settings)\n message.instance_exec(*attrs, &block)\n message\n }\n end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def setup_email(user)\n @recipients = \"#{user.email}\"\n @from = AppConfig.app_email\n @subject = \"[#{AppConfig.app_name}] \"\n @sent_on = Time.now\n @body[:user] = user\n end", "def validate_email_field(value = nil)\n config(:validate_email_field, value, true)\n end", "def email\n end", "def email_required?\n false\n end", "def smtp_settings\n {\n address: smtp_host,\n password: smtp_password,\n port: smtp_port,\n user_name: smtp_username\n }\n end", "def contact_email\n UserMailer.contact_email\n end", "def from_email\n AppConfig[:pui_request_email_fallback_from_address]\n end", "def reset_password_instructions(user, token, commit)\n @resource = user\n @token = token\n mail(:to => @resource.email, :subject => \"Reset password instructions\", :tag => 'password-reset', :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n mail.delivery_method.settings.merge! @@smtp_settings\n mail\n end", "def email_required?\r\n false\r\n end", "def symbolized_mail_options\n symbolize(@options[\"mail\"])\n end", "def email_required?\n false\n end", "def email=(value)\n reset_agent\n @email = value\n end", "def reserved_mail\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def init_mail(params)\n username = params['username']\n password = params['password']\n domain = params['domain']\n host = params['host']\n port = params['port']\n\n puts \"Preparing mail configuration\"\n mail_conf = {:address => host,\n :port => port,\n :domain => domain, #custom domain\n :user_name => username,\n :password => password,\n :authentication => 'plain',\n :enable_starttls_auto => true} #gmail require this option\n Mail.defaults do\n delivery_method :smtp, mail_conf\n end\n puts \"Mail service configured\"\nend", "def email\n begin\n super\n rescue NoMethodError\n nil\n end\n end", "def get_smtp_parameters\n smtp = {\n address: 'smtp.gmail.com',\n port: 587,\n domain: 'moovweb.com',\n user_name: '[email protected]',\n password: ENV['email_password'],\n authentication: 'plain',\n enable_starttls_auto: true\n }\nend", "def mailboxer_email(object)\n\t #Check if an email should be sent for that object\n\t #if true\n\t return \"define_email@on_your.model\"\n\t #if false\n\t #return nil\n\tend", "def email\n @email ||= select { |type,value| type == :email }.map do |(type,value)|\n value\n end\n end", "def configure_email\n config = {\n :username => ask('Gmail', :required => true),\n :password => ask('Password', :required => true)\n }\n File.open(email_file, 'w') { |f| f.write(YAML.dump(config)) }\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end", "def email_required?\n false\n end" ]
[ "0.69213814", "0.67452615", "0.66358894", "0.6617869", "0.65583605", "0.646061", "0.64445436", "0.64273053", "0.6423062", "0.6405001", "0.63947415", "0.63922286", "0.6389937", "0.6292412", "0.6246895", "0.6164089", "0.6141088", "0.613552", "0.61322415", "0.61321324", "0.61172146", "0.6109894", "0.61083025", "0.6097319", "0.60789347", "0.6045781", "0.60355407", "0.6020986", "0.6017818", "0.6015671", "0.6006828", "0.60042065", "0.6002514", "0.5999612", "0.59976196", "0.5996339", "0.5960178", "0.59575856", "0.59549814", "0.5937816", "0.5934527", "0.5934527", "0.5913504", "0.591092", "0.591092", "0.59043944", "0.5897616", "0.5890202", "0.5886651", "0.58827394", "0.5878479", "0.5862963", "0.58590126", "0.585696", "0.5847579", "0.5841338", "0.58404994", "0.58404994", "0.58404994", "0.58404994", "0.58343977", "0.58338624", "0.5832113", "0.58272916", "0.5826988", "0.5817281", "0.58161736", "0.5804769", "0.58038604", "0.57922333", "0.57890594", "0.5788922", "0.5787129", "0.5786519", "0.57829344", "0.57812434", "0.5780123", "0.57768184", "0.57674795", "0.5760197", "0.57572776", "0.574935", "0.57451123", "0.57420933", "0.5741496", "0.5740802", "0.57393694", "0.57380617", "0.57355386", "0.5733767", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384", "0.57261384" ]
0.64684486
5
Returns the value of attribute resource. source://devise//lib/devise/mailers/helpers.rb14
def resource; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email\n @attributes[:email]\n end", "def email\n @attributes[:email]\n end", "def email\n @attributes[:email]\n end", "def email\n @attributes[:email]\n end", "def email\n attributes['email']\n end", "def get_attribute_value(attribute)\n data[attribute]\n end", "def email\n get_attribute('Email')\n end", "def get attribute\n attributes[attribute]\n end", "def localized_attribute_string(resource, attr_name)\n model_name = resource.class.name.underscore\n action_name = template.params[:action].to_s rescue ''\n attribute_name = attr_name.to_s\n\n i18n_scopes = ['{{model}}.{{action}}.{{attribute}}', '{{model}}.{{attribute}}', '{{attribute}}']\n defaults = i18n_scopes.collect do |i18n_scope|\n i18n_path = i18n_scope.dup\n i18n_path.gsub!('{{action}}', action_name)\n i18n_path.gsub!('{{model}}', model_name)\n i18n_path.gsub!('{{attribute}}', attribute_name)\n i18n_path.gsub!('..', '.')\n i18n_path.to_sym\n end\n defaults << ''\n\n i18n_value = ::I18n.t(defaults.shift, :default => defaults, :scope => \"formtastic.labels\")\n i18n_value.blank? ? nil : i18n_value\n end", "def attribute_value_for(resource, attribute_name, truncation = 50)\n value = resource.send(attribute_name).to_s.truncate(truncation)\n if attribute_name.to_s.match(/_id$/)\n model_name = attribute_name.gsub(/_id$/, '').classify\n begin\n value = eval(model_name).find(value).to_s\n rescue ActiveRecord::RecordNotFound\n value = \"\"\n end\n end\n value\n end", "def value_for(resource)\n resource.send(key)\n end", "def display_resource(user)\n user.email\n end", "def get_user_email\n useremail[:value]\n end", "def resource_attribute(name, resource)\n resource_attributes(resource)[name]\n end", "def resource_attribute(name, resource)\n resource_attributes(resource)[name]\n end", "def attribute(field)\n ->(resource) { resource.send(field) }\n end", "def get_attribute(name); end", "def get_attribute(name); end", "def raw_getter field\n val = self.instance_variable_get(\"@#{field}\")\n return nil if val.nil? == true || val == false\n\n if BOOL_ATTRIBUTES.include? field\n return field.to_s.gsub '_', '-' \n end\n\n if STR_ATTRIBUTES.include? field \n return val \n end\n\n if ARR_STR_ATTRIBUTES.include? field && val.empty? == false \n return val.join ' '\n end\n\n if SUB_STR_ATTRIBUTES.include? field \n return SUB_STR_ATTRIBUTES[field].sub '%sub%', val \n end \n end", "def attribute_value\n @attributes.each { | id, value | return value }\n end", "def contact_email\n self.contact[:contact_email]\n end", "def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end", "def attribute_get(attribute)\n check_attribute!(attribute)\n send(attribute.to_s)\n end", "def render_attribute(resource, attribute, options = {})\n attribute_value = resource.send(attribute[:name])\n if attribute[:relation]\n record = resource.send(attribute[:relation][:name])\n value = record.present? ? record.send(attribute[:relation][:attr_method]) : Alchemy.t(:not_found)\n elsif attribute_value && attribute[:type].to_s =~ /(date|time)/\n localization_format = if attribute[:type] == :datetime\n options[:datetime_format] || :\"alchemy.default\"\n elsif attribute[:type] == :date\n options[:date_format] || :\"alchemy.default\"\n else\n options[:time_format] || :\"alchemy.time\"\n end\n value = l(attribute_value, format: localization_format)\n else\n value = attribute_value\n end\n\n options.reverse_merge!(truncate: 50)\n if options[:truncate]\n value.to_s.truncate(options.fetch(:truncate, 50))\n else\n value\n end\n end", "def value\n attributes.fetch(:value)\n end", "def resource_attribute(resource, name)\n raise ArgumentError, \"Attribute name cannot be empty\" if name.empty?\n resource_attributes(resource)[name.to_s]\n end", "def attribute(show_attribute)\n case show_attribute\n when 'deadline'\n return self.deadline\n when 'renter_id'\n return self.renter.surname if self.renter_id > 0\n when 'property_id'\n return self.property.name if self.property_id > 0\n when 'object'\n return self.object.downcase\n when 'price'\n return self.price\n when 'category'\n return self.category\n when 'groupp'\n return self.groupp\n when 'paid'\n return self.paid\n else \n return ''\n end\n end", "def original_email\n read_attribute(:email)\n end", "def original_email\n read_attribute(:email)\n end", "def get_string(attr); end", "def get_value\n read_attribute('text_value')\n end", "def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end", "def display_resource(user)\n \"#{user.email}\"\n end", "def field_value\n if check_version_of(\"mail\", \"> 2.7.0\")\n %w(unparsed_value)\n elsif check_version_of(\"mail\", \"= 2.7.0\")\n %w(instance_variable_get @unparsed_value)\n elsif check_version_of(\"mail\", \"< 2.7.0\")\n %w(instance_variable_get @value)\n end\n end", "def value\n @attributes[:value]\n end", "def read_attribute_for_validation(attr)\r\n send(attr)\r\n end", "def read_attribute_for_validation(attr)\n send(attr)\n end", "def read_attribute_for_validation(attr)\n send(attr)\n end", "def read_attribute_for_validation(attr)\n send(attr)\n end", "def contact_email\n contact['email_address']\n end", "def localized_dynamic_attribute_value(field)\n if field.is_a?(String)\n field = self.content_type.find_field(field)\n end\n\n return nil if field.nil?\n\n value = (self.dynamic_attributes || {})[field.name.to_sym]\n\n # DEBUG puts \"[#{field.name.inspect}] #{value.inspect} / #{field.localized.inspect} / #{value.is_a?(Hash).inspect}\"\n\n if !field.is_relationship? && field.localized && value.is_a?(Hash)\n # get the localized value for the current locale\n _value = value[Locomotive::Mounter.locale]\n\n # no value for the current locale, give a try to the main one\n if _value.nil? && Locomotive::Mounter.locale != self.main_locale\n _value = value[self.main_locale]\n end\n\n value = _value\n end\n\n value # DEBUG .tap { |v| puts \"[#{field.name}] returning #{v.inspect}\" }\n end", "def attribute attr\n @ref.attribute(TRANSLATOR.cocoaify(attr)).to_ruby\n end", "def get_attribute_or_element_value(xml, attr, default = nil, &f)\n val = default\n begin\n snip = xml.elements[attr]\n if snip.elements.size > 0\n if snip.elements.size == 1 && snip.elements['object']\n # must be an otml reference to a different OTObject\n # return the refid\n val = snip.elements['object'].attributes['refid'].to_s\n else\n # otherwise just return the whole snippet\n val = snip.to_s\n end\n else\n val = snip.get_text.to_s\n end\n rescue\n begin\n val = xml.attributes[attr].to_s\n rescue\n # logger.warn(\"Couldn't find attribute or element: #{attr}\")\n end\n end\n begin\n if f\n val = yield(val)\n end\n rescue\n val = default\n end\n return val\n end", "def my_attribute\n @my_attribute\n end", "def contact_email\n return @contact_email\n end", "def new_email\n e = read_attribute :new_email\n e.present? ? e : email\n end", "def ar_get_resource_value(resource, column)\n return \"Error: #{resource}, #{column}\" unless column && resource\n \n case column\n when String, Symbol\n \n if controller.ardata.foreing_models.include?(column.to_s)\n column.to_s.match(/^(.*)_id$/)\n record= resource.send($1)\n return record ? record.label : controller.ardata.labels[:nil_value_in_field]\n else\n return h(resource.send(column)) || controller.ardata.labels[:nil_value_in_field]\n end\n \n else\n ar_retrieve_field_value column, resource\n end\n end", "def email\n\t\treturn @email\n\tend", "def custom_smtp\n @attributes[:custom_smtp]\n end", "def attribute_name\n notifier.attribute_name if notifier.respond_to?(:attribute_name)\n end", "def get_attribute(object, attribute)\n attribute = attribute.to_sym\n object = localize(object) unless object.respond_to? :nii_attribute?\n return object.nii_attribute(attribute) if object.nii_attribute? attribute\n raise Errors::UnknownAttribute, \"unknown attribute\"\n end", "def email\n return @email\n end", "def email\n return @email\n end", "def email\n self[:emailAddress]\n end", "def get_value(attribute,xml)\n xml.xpath(\".//#{attribute}\").first.content\n end", "def value_for(field)\n value = instance_variable_get(:\"@#{field}\")\n value.nil? ? nil : value.to_s\n end", "def email_address\n @data['emailAddress']\n end", "def _read_attribute(attr)\n @attributes[attr]\n end", "def email; @email; end", "def lookup_attribute (attname, workitem)\n\n attname\n end", "def value\n if meta_key.is_dynamic?\n case meta_key.label\n when \"uploaded by\"\n return media_resource.user\n when \"uploaded at\"\n return media_resource.created_at #old# .to_formatted_s(:date_time) # TODO media_resource.upload_session.created_at ??\n when \"copyright usage\"\n copyright = media_resource.meta_data.get(\"copyright status\").value.first || Meta::Copyright.default # OPTIMIZE array or single element\n return copyright.usage(read_attribute(:value))\n when \"copyright url\"\n copyright = media_resource.meta_data.get(\"copyright status\").value.first || Meta::Copyright.default # OPTIMIZE array or single element\n return copyright.url(read_attribute(:value))\n #when \"public access\"\n # return media_resource.acl?(:view, :all)\n #when \"media type\"\n # return media_resource.media_type\n #when \"gps\"\n # return media_resource.media_file.meta_data[\"GPS\"]\n end\n else\n case meta_key.object_type\n when \"Meta::Copyright\", \"Meta::Department\", \"Person\"\n meta_references.map(&:reference) #.map(&:to_s)\n when \"Meta::Term\", \"Meta::Keyword\"\n meta_keywords.map(&:meta_term) #.map(&:to_s)\n when \"Meta::Date\"\n meta_dates.map(&:to_s).join(' - ')\n when \"Meta::Country\"\n text\n else\n text\n end\n end\n end", "def device_account_email\n return @device_account_email\n end", "def read_attribute\n record.public_send(attribute)\n end", "def display_resource(user)\n \"User #{user.email}\"\n end", "def get(attribute)\n @attributes[attribute.to_s]\n end", "def u_email\n (self.user).email\n end", "def attribute(name)\n return attributes[name]\n end", "def resource_attribute_value(attribute, value)\n linked_attributes = [:member_of_collections, :decorated_numismatic_monograms]\n return link_to(value.title, solr_document_path(id: value.id)) if linked_attributes.include?(attribute)\n return catalog_link(attribute, value) if attribute == :source_metadata_identifier\n\n value\n end", "def value\n attributes['FieldValue']\n end", "def raw(attribute)\r\n instance_variable_get(\"@#{attribute}\")\r\n end", "def get_attribute(name)\n @attributes[name.to_s]\n end", "def get_attribute(name)\n @attributes[name]\n end", "def cfn_getatt(k,v)\n\t\t\treturn cfn_raw({ \"Fn::GetAtt\" => [k, v]})\n\t\tend", "def email\n if @data.attribute_names.include?(:cmupreferredmail)\n @email ||= @data[:cmupreferredmail].last\n else\n @email ||= @data[:mail].last\n end\n end", "def get_attribute_value(attribute)\n values = read_attr_val(attribute.id)\n return nil unless values\n if attribute.atype == ProductAttribute::Atype_String\n return values[0]\n elsif attribute.atype == ProductAttribute::Atype_Currency\n MoneyUtils.format(values[1])\n else\n return Integer(values[1])\n end\n end", "def value_for_file_name\n @value_for_file_name ||= begin\n ip_addr = ip_address_given? ? ip_address_given.gsub('.','-') : ip_address_given\n mac_addr = mac_address_given\n mac_addr_to_mac = mac_addr ? mac_addr.to_mac : false\n ret_val = ( ip_addr || mac_addr_to_mac || new_resource.name)\n ret_val\n end\n end", "def attribute_value(key, node = @current_node)\n\t\tif is_valid(node) && node.key?(key) then\n\t\t\treturn node.attribute(key).to_s\n\t\telse\n\t\t\treturn ''\n\t\tend\n\tend", "def attr_val(xpath)\n Utilities::attr_val(@entry, xpath)\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def attribute_value(element,attribute_name)\n element.attribute_value(element,attribute_name)\n end", "def get_user_email\n user = User.find(self.user_id)\n user.email\n end", "def email_address\n return @email_address\n end", "def email_address\n return @email_address\n end", "def get_mail\n \n end", "def resource_attribute_human_name_for(attribute_name)\n attribute_name = attribute_name.to_s\n I18n.t(\"activerecord.attributes.#{resource_name}.#{attribute_name}\",\n default: attribute_name.humanize)\n end", "def message\n @attributes[:message]\n end", "def attribute(name)\n attributes[name]\n end", "def attribute(name)\n read_attribute(name)\n end", "def read_attribute(key)\n @attributes[key]\n end", "def read_attribute(key)\n @attributes[key]\n end", "def message\n attributes.fetch(:message)\n end", "def getter(attribute)\n willAccessValueForKey(attribute)\n value = send(\"primitive#{attribute.sub(/\\S/, &:upcase)}\")\n didAccessValueForKey(attribute)\n return value\n end", "def message\n attributes[:message]\n end", "def get_question_attribute(question_id)\n question_attribute = QuestionAttribute.find_by_question_id(question_id)\n return question_attribute\n end", "def to_s\n self.email\n end", "def email\n connect\n user = self.class.query('CMD_API_SHOW_USER_CONFIG',\n :user => resource[:username]\n )\n return user[\"email\"]\n end", "def get_resource\n\t\t\t\tinstance_variable_get(\"@#{resource_name}\")\n\t\t\tend", "def email\n @email \n end", "def email\n @net_ldap_entry[:mail].first\n end", "def name\n if resource_class.respond_to?(:human_attribute_name)\n resource_class.human_attribute_name(attribute)\n else\n attribute.to_s.titleize\n end\n end", "def restapi_permission\n @attributes[:restapi_permission]\n end" ]
[ "0.6478127", "0.6478127", "0.6478127", "0.6478127", "0.6473853", "0.64274484", "0.6350629", "0.6341981", "0.6279336", "0.6269862", "0.62616223", "0.62408113", "0.6235014", "0.62102956", "0.62102956", "0.6189949", "0.61249775", "0.61249775", "0.60926557", "0.60665464", "0.6061356", "0.6048948", "0.6048948", "0.6026424", "0.5990562", "0.5945826", "0.594065", "0.5932199", "0.5932199", "0.59278774", "0.5923035", "0.5911532", "0.58665913", "0.5854323", "0.5844021", "0.58403534", "0.58384895", "0.58384895", "0.58384895", "0.58193666", "0.57996666", "0.57961124", "0.57959765", "0.57670957", "0.57604605", "0.575754", "0.5754644", "0.574757", "0.57228714", "0.571259", "0.5689733", "0.5671916", "0.5671916", "0.5664674", "0.56574327", "0.56504637", "0.563618", "0.56353843", "0.5630557", "0.56264764", "0.56252974", "0.5615213", "0.56110513", "0.56100386", "0.56083274", "0.55952406", "0.55890566", "0.5558261", "0.554436", "0.5538497", "0.5536354", "0.5530762", "0.5518472", "0.5514969", "0.5513549", "0.55081236", "0.5493601", "0.5478009", "0.5462285", "0.54465055", "0.544612", "0.54433626", "0.54433626", "0.54287696", "0.5415993", "0.54145986", "0.54133755", "0.53974074", "0.53963786", "0.53963786", "0.5388322", "0.5384965", "0.5382944", "0.5381862", "0.53789", "0.5374425", "0.53710455", "0.5368919", "0.5365593", "0.5360231", "0.53569365" ]
0.0
-1
Returns the value of attribute scope_name. source://devise//lib/devise/mailers/helpers.rb14
def scope_name; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope_name scope\n\t\traise \"No data-source set\" unless data_source\n\t\tdata_source.scopes.get(scope).human_name\n\tend", "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend", "def scope\n @attributes[:scope]\n end", "def scope\n read_attr :scope, :to_sym\n end", "def scope_name name\n name.to_s.pluralize.to_sym\n end", "def scope_name(scope, task_name)\n (scope + [task_name]).join(':')\n end", "def i18n_scope\n return event_name if user_role.blank? || !event_has_roles?\n\n \"#{event_name}.#{user_role}\"\n end", "def scope\n field[:scope]\n end", "def scope\n parameter[:scope]\n end", "def scope_value\n return unless position_scope_attr\n send(position_scope_attr)\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def notification_recipient_scope=(value)\n @notification_recipient_scope = value\n end", "def attribute_name\n notifier.attribute_name if notifier.respond_to?(:attribute_name)\n end", "def translation_scope\n \"mailers.#{mailer_name.tr(\"/\", \".\").sub(\"_mailer\", \"\")}.#{action_name}\"\n end", "def notification_recipient_scope\n return @notification_recipient_scope\n end", "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end", "def group_name\n @attributes[:group_name]\n end", "def group_name\n @attributes[:group_name]\n end", "def scopeName _args\n \"scopeName _args;\" \n end", "def recipient_name\n recipient.name if recipient\n end", "def name\n\t return self.email\n\tend", "def name\n\t\tif name_source.present?\n\t\t\tproviders = [\"twitter\",\"facebook\",\"google_oauth2\",\"lastfm\",\"vimeo\"]\n\t\t\tp,v = name_source.split(\"::\",2)\n\t\t\treturn name_source unless p.in? providers\n\t\t\tl = self.links.find_by(provider: p)\n\t\t\tif l\n\t\t\t\tnames = l.names\n\t\t\t\treturn names[v.to_sym] if names.is_a? Hash and v and names[v.to_sym]\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn custom_name if custom_name.present?\n\t\treturn email.split('@')[0].titleize if email.present?\n\t\tUser.default_name\n\tend", "def scope\n @scope\n end", "def scope\n @scope\n end", "def scope_names\n keys.map { |k| k.to_s }\n end", "def name\n if self[:name].blank?\n (self[:email] || \"\").split('@')[0].split('.').map(&:capitalize).join(' ')\n else\n self[:name]\n end\n end", "def selected_scope\n (params[:scope] || :default).to_sym\n end", "def name\n \temail.split('@')[0]\n end", "def app_scope_id\n return @app_scope_id\n end", "def name\n recipient.name.nil? ? \"NA\" : recipient.name\n end", "def personal_name\n data[:personal_name]\n end", "def scope_info\n if is_scoped? && scoped_manual.present?\n {\n \"scope\" => {\n \"title\" => scoped_manual.to_hash.fetch(\"title\", \"\"),\n },\n \"unscoped_results\" => unscoped_results,\n }\n else\n {}\n end\n end", "def display_name\n email\n end", "def name\n object.translated_name(scope[:locale] || I18n.default_locale)\n end", "def mail_nickname\n return @mail_nickname\n end", "def ancestor_scope_name(scope)\n return_scope = scope\n while (return_scope = return_scope.parent)\n return return_scope.name unless return_scope.name.nil? || return_scope.block_scope?\n end\n end", "def name_and_email\n email_address = Notifier.unprettify(self.email)\n self.name.blank? ? email_address : \"\\\"#{self.name}\\\" <#{email_address}>\"\n end", "def email_name\n @email_name || if self[:email]\n split_host = URI.parse(\"#{self[:email]}\").path.split('@')\n \"#{split_host.first}\" if 2 == split_host.size\n end\n rescue URI::InvalidURIError\n nil\n end", "def devise_scope(scope); end", "def name\n \"#{role_name} #{user&.email}\"\n end", "def group_name\n data[:group_name]\n end", "def mailboxer_name\n return \"#{name}\"\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def get_name\n return @m_name\n end", "def formatted_email\n\t\t# because @name and @email are both instance variables, they are available in formatted_email\n\t\t\"#{@name} <#{@email}>\"\n\tend", "def identifier\n name.presence || email.split('@').join(' from ')\n end", "def notice_scope_name\n 'notices.' + controller_scope_name\n end", "def provider_name(provider)\n I18n.t(provider, scope: 'account.provider_name')\n end", "def subject_name\n return @subject_name\n end", "def scope_link(scope = nil)\n if scope\n as = scope[:as]\n name = as.to_s.humanize\n else\n as = nil\n name = \"All\"\n end\n \n link = current_filter_scopes.dup\n \n if as\n unless scope[:default]\n link[as] = true \n default_scopes.each { |dn, ds| link[ds[:as]] = false }\n end\n\n active = current_boolean_scopes.keys.include?(as)\n else\n active = current_boolean_scopes.empty?\n end\n \n# name = \"#{name}: #{scope_count(scope)}\"\n \n content_tag(:li, link_to(name, link), :class => active ? 'active' : nil)\n end", "def name_str\n self.anon ? \"Anonymous\" : self.user.name\n end", "def scope\n @options[:scope]\n end", "def name\n\t\temail\n\tend", "def iname\n attributes['name']\n end", "def iname\n attributes['name']\n end", "def iname\n attributes['name']\n end", "def formatted_email\n \"#{@name} <#{@email}>\"\n end", "def provider_name\n return @provider_name\n end", "def account_name\n return @account_name\n end", "def account_name\n return @account_name\n end", "def name\n email\n end", "def name\n email\n end", "def scope\n\t\treturn @scopes.last\n\tend", "def variables_scope_id\n current_variables_scope.guid\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def name\n @provider_name\n end", "def name\n attrs[:name]\n end", "def name\n @provider[:name]\n end", "def get_fqdn\n return @resource[:name]\n end", "def assigned_to_name\n if self.assigned_to_user_id\n assigned_to_user.full_name\n elsif self.assigned_to_matter_people_id\n assigned_to_matter_people.get_name\n end\n end", "def get_audit_label\n self.mail\n end", "def current_scope\n @scope\n end", "def assigned_to_name\n unless self.assigned_to_matter_people_id.nil?\n MatterPeople.find_with_deleted(self.assigned_to_matter_people_id).get_name\n end\n end", "def scopes\n scopes = scope ? scope.split(/\\s+/) : []\n scopes = attributes[:scope]\n Set.new(scopes).to_s\n end", "def scope\n if @scope.kind_of? String\n @scope = @scope.split \",\"\n else\n @scope || []\n end\n end", "def org_name\n self.org.try(:name).to_s\n end", "def readable_context_name\r\n self.name\r\n end", "def subject_name\n subject_full_name\n end", "def name\n @attributes[:name]\n end", "def name\n @attributes[:name]\n end", "def name\n @attributes[:name]\n end", "def name\n @attributes[:name]\n end", "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "def user_name\n read_attribute('user_name') || \"anonymous\"\n end", "def name\n NameMailer.name\n end", "def human_name\n I18n.t(@name, :scope => [:role], :default => @name.to_s.humanize)\n end", "def get_attribute(name)\n rule_properties_scope = self.attr_grammar_type_to_rule_properties_scope[self.attr_grammar.attr_type]\n if (!(rule_properties_scope.get_attribute(name)).nil?)\n return rule_properties_scope.get_attribute(name)\n end\n if (!(@referenced_rule.attr_return_scope).nil?)\n return @referenced_rule.attr_return_scope.get_attribute(name)\n end\n return nil\n end", "def name_no_group\n has_attribute?(\"name_no_group\") ? self[\"name_no_group\"] : nickname || name\n end", "def scope_context\n @sssn\n end", "def controller_scope_name\n @controller_scope_name ||= 'admin.' + self.class.name.sub(/Controller$/, '').underscore.tr('/', '_')\n end", "def email_with_name\n \"#{full_name} <#{email.to_s}>\"\n end" ]
[ "0.71403575", "0.6985256", "0.6725555", "0.6455613", "0.6292053", "0.6225085", "0.6125949", "0.6055242", "0.6022772", "0.5911797", "0.5854771", "0.5854771", "0.5854771", "0.5854771", "0.5854771", "0.5854771", "0.58524966", "0.5837939", "0.583108", "0.5815935", "0.5790303", "0.5787153", "0.5787153", "0.57854867", "0.5762988", "0.56945705", "0.56910676", "0.5681675", "0.5681675", "0.5586969", "0.5582702", "0.5562922", "0.55482596", "0.5543153", "0.5504697", "0.549347", "0.5477808", "0.54744047", "0.54701245", "0.5453329", "0.54529566", "0.54512197", "0.54434675", "0.54187745", "0.5415919", "0.5407343", "0.5363484", "0.536159", "0.536159", "0.536159", "0.536159", "0.5347544", "0.53383374", "0.53381735", "0.53286886", "0.5324044", "0.53155196", "0.5314577", "0.5312516", "0.53057003", "0.53027844", "0.53027844", "0.53027844", "0.5300696", "0.5300609", "0.5299008", "0.5299008", "0.5292186", "0.5292186", "0.52882606", "0.528348", "0.5282709", "0.5282709", "0.5282709", "0.52798605", "0.52703017", "0.5261728", "0.5257318", "0.5253994", "0.5251219", "0.5245884", "0.5241498", "0.5240148", "0.5238649", "0.5224086", "0.52234477", "0.5221679", "0.52131176", "0.52131176", "0.52131176", "0.52131176", "0.5212234", "0.5209128", "0.5207935", "0.52074766", "0.5204383", "0.5202763", "0.5198541", "0.5198112", "0.51965857" ]
0.69244945
2
Set up a subject doing an I18n lookup. At first, it attempts to set a subject based on the current mapping: en: devise: mailer: confirmation_instructions: user_subject: '...' If one does not exist, it fallbacks to ActionMailer default: en: devise: mailer: confirmation_instructions: subject: '...' source://devise//lib/devise/mailers/helpers.rb87
def subject_for(key); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def subject\n self['subject'] || msg['subject']\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def default_i18n_subject(interpolations = {})\n ''\n end", "def set_subject(subject)\n\t\tend", "def message_subject=(value)\n @message_subject = value\n end", "def set_subject\n @subject = Subject.friendly.find(params[:id])\n end", "def subject=(string)\n set('Subject', string)\n end", "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "def subject_name\n subject_full_name\n end", "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "def get_subject\n\t\tend", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def adhoc_test_subj_call\n ->(candidate) { I18n.t('email.test_adhoc_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject_names\n @subject_names ||= sw_subject_names\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject\n @mail.subject\n end", "def email_welcome_and_pass\r\nold_gt = I18n.locale\r\nI18n.locale = self.language unless self.language.blank?\r\nUserMailer.deliver_account_infos(self, @password) # Uniq time with decoded password\r\nI18n.locale = old_gt\r\nend", "def subject(options)\n case [options[:person], options[:plurality]]\n when %i[first singular]\n 'I'\n when %i[first plural]\n 'we'\n when %i[second singular], %i[second plural]\n 'you'\n when %i[third singular]\n 'he'\n when %i[third plural]\n 'they'\n end\n end", "def subject\n self['subject']\n end", "def subject; @message_impl.getSubject; end", "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "def subject_name=(value)\n @subject_name = value\n end", "def set_subject\n @subject = params[:id] ? Subject.find(params[:id]) : Subject.new(subject_params)\n end", "def set_subject\n @subject = params[:id] ? Subject.find(params[:id]) : Subject.new(subject_params)\n end", "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}.#{key}\", :scope => [:devise, :mailer], :default => key)\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def subject(instructor, upsubj, schoolvar)\n\tschoolvar[:instructors].each do |instructors|\n\t\tif instructors[:name] == instructor\n\t\t\tinstructors[:subject] = upsubj \n\t\tend\n\tend\t\nend", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def subject_sym\n subject_class.to_s.underscore.downcase.to_sym\n end", "def set_subject\n begin\n @subject = Subject.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid subject #{params[:id]}\"\n @subject_not_found = true\n render json: {message: \"Illegal subject access request\"}, status: :unauthorized\n return\n else\n @subject_not_found = false\n end\n end", "def subject_alternative_name\n extensions[R509::Cert::Extensions::SubjectAlternativeName]\n end", "def assign_canned_subject\n self.subject = canned_subject\n end", "def subject_name\n return @subject_name\n end", "def set_subject\n\t\t\t@subject = Subject.find(params[:id])\n\t\tend", "def set_subject\n @subject = Subject.find(params[:subject_id])\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def set_subject\n url = Settings.hqva_mobile.url\n icn = user.icn\n appointment_id = data[:appointment_id]\n\n {\n use: SUBJECT_USE,\n value: \"#{url}/appointments/v1/patients/#{icn}/Appointment/#{appointment_id}\"\n }\n end", "def subject_topic\n map_field(:subject_topic)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def set_subject\n @subject = Subject.find params[:subject_id]\n end", "def named_subject\n map_field(:named_subject)&.map { |a| a.gsub(/ \\$[a-z] /, ' ') }\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def subject\n message.subject\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = User.find(params[:id])\n end", "def message_subject\n return @message_subject\n end", "def subjectify(options = {})\n SubjectifyService.new(options[:value]).content\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def set_subject\n @subject = Subject.find(params[:id])\n end", "def subject_name\n subject&.name\n end", "def set_subject\r\n @subject = Subject.find(params[:id])\r\n end" ]
[ "0.7426734", "0.6856491", "0.6850956", "0.6568645", "0.65188795", "0.64162135", "0.640823", "0.638278", "0.63644606", "0.63545245", "0.62847954", "0.62332064", "0.61330783", "0.6098012", "0.6063572", "0.60506034", "0.60495657", "0.60414004", "0.6015685", "0.6005518", "0.59830713", "0.5960799", "0.5933283", "0.5900136", "0.5864015", "0.58634025", "0.5848698", "0.5804315", "0.57808983", "0.57659525", "0.5764142", "0.57639587", "0.5762603", "0.5762603", "0.5762603", "0.5762603", "0.5762603", "0.5762603", "0.5759271", "0.5757576", "0.57505685", "0.5750319", "0.57418513", "0.5725454", "0.57116276", "0.5692341", "0.5692341", "0.5692205", "0.567062", "0.5648111", "0.5635507", "0.5635507", "0.5635507", "0.5635507", "0.5635507", "0.5635507", "0.5635507", "0.5635507", "0.5634449", "0.56237054", "0.5621836", "0.5617351", "0.5611366", "0.5600231", "0.55932504", "0.55847234", "0.55812156", "0.55590224", "0.554622", "0.55356187", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55070907", "0.55063635", "0.55015385", "0.55015385", "0.55015385", "0.55015385", "0.54622257", "0.5462132", "0.544407", "0.54248476", "0.54078466", "0.5392909", "0.5384657", "0.5384657", "0.53802866", "0.53800535" ]
0.5632213
59
Return modules for the mapping. source://devise//lib/devise/mapping.rb77
def modules; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def devise_mappings; end", "def modules\n @modules.values\n end", "def modules\n @modules.values\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def mappers\n configuration.mappers\n end", "def mappings\n @mappings ||= []\n end", "def devise_mapping\n @devise_mapping ||= request.env[\"devise.mapping\"]\n end", "def mappings\n @mappings ||= []\n end", "def mapping; end", "def mapping; end", "def modules_hash\n @modules\n end", "def modules_hash\n @modules\n end", "def list_modules\n pal.list_modules\n end", "def modules\n Rails.cache.fetch(\"user_modules_#{self.id}\", expire_in: 1.month) do\n self.roles.map(&:parent_modules).flatten.uniq\n end\n end", "def devise_modules_hook!; end", "def modules\n @modules = @modules.call if @modules.is_a?(Proc)\n @modules\n end", "def routes_map; end", "def modules\n raise CapabilitiesExceeded\n end", "def mapped_columns\n @columns.map do |column|\n @mappings[column] || column.to_s.send(@inflector)\n end\n end", "def permission_mapping\n super.merge(\n {\n 'index_role_screen' => 'index',\n 'index_role_field' => 'index',\n 'index_user_screen' => 'index',\n 'index_user_field' => 'index',\n 'fetch_row' => 'index'\n }\n )\n end", "def modules_hash\n @modules_hash\n end", "def mappings\n @mappings ||= mappings_from_files.merge!(mappings_from_dirs)\n end", "def app_modules\n @app_modules ||= []\n end", "def module_names\n @cache[:modules]\n end", "def all_modules\n modules_hash.values\n end", "def modules\n yield self\n end", "def defined_modules\n # TODO: check content type before scanning\n content.scan(/\\s*module\\s+([A-Za-z0-9_\\.]*)/).flatten\n end", "def modules\n modules = {}\n\n begin\n mods = Pathname.new(@conf['mod_dir']).children.select(&:directory?)\n\n mods.each do |m|\n modules[m.basename.to_s] = mod_versions(m)\n end\n rescue StandardError => err\n Pem.log_error(err, @logger)\n raise(err)\n end\n\n modules\n end", "def module_types\n\t\tmodule_sets.keys.dup\n\tend", "def extended_modules; end", "def orm_modules\n if Merb.const_defined?('Orms')\n Merb::Orms.constants.map { |c| Merb::Orms::const_get(c) }\n else\n []\n end\n end", "def mapping\n @mapping ||= map(@current_theme)\n end", "def access_packages\n return @access_packages\n end", "def access_packages\n return @access_packages\n end", "def get_mapping\n request :get, \"_mapping\"\n end", "def get_mapping\n request :get, \"_mapping\"\n end", "def modules\n @modules ||= Array.new\n @modules\nend", "def modules(&block)\r\n if block_given?\r\n Ragweed::Wrap32::list_modules(@pid, &block)\r\n else\r\n ret = []\r\n Ragweed::Wrap32::list_modules(@pid) {|x| ret << x}\r\n return ret\r\n end\r\n end", "def sites_to_load\n @appl_settings[:registered_config_modules]\n end", "def module_config\r\n []\r\n end", "def mappings(key)\n return unless supported_key?(key)\n\n Primer::Classify::UTILITIES[key].keys\n end", "def module_definition\n {\n \"name\" => \"party_list\",\n \"engine_name\" => \"party_engine\",\n \"navigation\" => {\n \"name\" => \"modules.party_list\",\n \"controller\" => \"/admin/parties\",\n \"action\" => \"index\",\n \"image\" => \"/assets/party_list_module.png\"\n }\n }\nend", "def visibility_mapping\n {\n 'private' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE,\n 'restricted' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE,\n 'discovery' => ::Work::VISIBILITY_TEXT_VALUE_SINAI,\n 'sinai' => ::Work::VISIBILITY_TEXT_VALUE_SINAI,\n 'authenticated' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED,\n 'registered' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED,\n 'ucla' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED,\n 'open' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC,\n 'public' => Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC\n }.freeze\n end", "def map_available_roles\n roles.each.map &:name\n end", "def included_modules\n end", "def modules\n @module_ids.collect { |idx| BModule.store[idx] }\n end", "def function_map\n unless @functions\n do_initialize\n @functions = {}\n function_files.each do |file|\n obj = {}\n name = File.basename(file, '.rb')\n obj[:name] = name\n obj[:parent] = mod_finder.match(file)[1]\n @functions[\"#{obj[:parent]}::#{name}\"] = obj\n end\n end\n @functions\n end", "def included_modules; end", "def modules_paths\n puppet_environment.full_modulepath\n end", "def served_from(trait_module, *methods)\n methods.each { |method_name| dict << [trait_module, method_name] }\n end", "def folder_modules\n @folder_modules ||= (folder_lib + 'module')\n end", "def mappings\n @mappings ||= self.class.mappings.map{ |factory| factory.create(self) }\n end", "def model_to_registration_mapping\n #{:model => 'server'}\n {:name => 'fullname', :email => 'email'}\n end", "def modules_path\n 'modules'\nend", "def map\n mappings = {}\n\n mappings = mappings\n .merge(self.system_information)\n .merge(self.json_fields)\n .merge(self.record_fields)\n .merge(self.user_defined_fields)\n\n mappings\n end", "def submodules\n self.constants\n .map { |name| const_get(name) }\n .select { |const| const.class == Module }\n end", "def all_user_modules\n @all_user_modules ||= self.roles.map(&:modules).flatten.uniq\n end", "def include_modules\n @mods = Devium::PageBuilder.new(page, details).parse_page_modules\n mods.map do |mod|\n extend Object.const_get(\"#{self.class}::#{mod}\")\n end\n end", "def site_maps\n if current_user && current_user.admin?\n Map.all\n else\n Map.active\n end\n end", "def id_mapping_types\n @id_mapping_types ||= extract_classes_with_true(:track_imported_ids, configuration)\n end", "def block_device_mappings\n data[:block_device_mappings]\n end", "def modules_paths\n puppet_environment.full_modulepath\n end", "def puppet_modules(id)\n criteria = {:type_ids => [Runcible::Extensions::PuppetModule.content_type]}\n unit_search(id, criteria).map { |i| i['metadata'].with_indifferent_access }\n end", "def getAllFieldsMap\n @customFieldMap = self.class.get(\"/rest/api/2/field\", :verify => false)\n end", "def modules\n @modules= GmaModule.all :order=>\"seq\"\n render :layout => false\n end", "def mapping #:nodoc:\n @mapper.config\n end", "def fields\n return @fields if fields_registered?\n all_fields = @session.connection.get_fields(@name)\n @fields = all_fields[\"module_fields\"].with_indifferent_access\n @link_fields= all_fields[\"link_fields\"]\n handle_empty_arrays\n @fields_registered = true\n @fields\n end", "def extract_modules(name) #:nodoc:\n modules = name.include?('/') ? name.split('/') : name.split('::')\n name = modules.pop\n path = modules.map { |m| m.underscore }\n\n file_path = (path + [name.underscore]).join('/')\n nesting = modules.map { |m| m.camelize }.join('::')\n\n [name, path, file_path, nesting, modules.size]\n end", "def define_mapping\n # no additional parameters\n nil\n end", "def devise_ip_authentications(mapping, controllers)\n resource :ip_authentications, only: [:new], path: mapping.path_names[:ip_authentications],\n controller: controllers[:ip_authentications]\n end", "def column_mappings\n raise SolidusImportProducts::AbstractMthodCall\n end", "def extract_modules\n i = 0\n path = \"//foxml:datastream[@ID='DC']/foxml:datastreamVersion\"\\\n \"[@ID='#{@current_dc_version}']/foxml:xmlContent/oai_dc:dc\"\\\n \"/dc:identifier/text()[not(starts-with(.,'york')) ]\"\n @doc.xpath(path, @ns).each do |s|\n keyname = 'module'\n i += 1\n keyname += i.to_s\n @key_metadata[keyname.to_sym] = s.to_s\n end\n end", "def resource_class\n devise_mapping.to\n end", "def map\n raise \"Do not call me when inspecting!\"\n end", "def providers\n authentication_strategies.pluck :provider\n end", "def authentication_methods\n return @authentication_methods\n end", "def map_nested_models\n end", "def map_nested_models\n end", "def index\n @user_mappings = UserMapping.all\n end", "def devise_verification_code(mapping, controllers)\n resource :paranoid_verification_code, :only => [:show, :update], :path => mapping.path_names[:verification_code], :controller => controllers[:paranoid_verification_code]\n end", "def included_modules() end", "def _response_mapping\n request_mapping.invert\n end", "def map\n mappings = {}\n\n mappings = mappings\n .merge(self.system_information)\n .merge(self.json_fields)\n .merge(self.record_fields)\n\n return mappings\n end", "def get_module_dirs(method='tracking')\n load_puppetfile(method)\n module_paths.select{|x| File.basename(File.dirname(x)) == 'modules'}.sort\n end", "def included_methods\n included_modules.map(&:instance_methods).flatten\n end", "def possible_uni_modules_for_new_group(calling_user = current_user)\r\n if (calling_user.department_admin?)\r\n calling_user.department.uni_modules\r\n else\r\n UniModule.all\r\n end\r\n end", "def exports\n ActiveFedora::Base.where(read_access_group_ssim: \"public\").all.collect { |o| o.pid } + ActiveFedora::Base.where(discover_access_group_ssim: \"public\").all.collect { |o| o.pid }\n end", "def polymorphic_mappings; end", "def attributes_from_module_fields\n self.class.register_module_fields unless module_fields_registered?\n fields = {}\n self.class.module_fields.keys.sort.each do |k|\n fields[k.to_s] = nil\n end\n fields\n end", "def index\n @dispatch_utensils_mappings = DispatchUtensilsMapping.all\n end", "def to_package\n self.map do |type, members|\n { :members => members, :name => type.to_s.camelize }\n end\n end", "def client_modules\n get 'client/modules'\n end", "def load_plugin_map; end", "def mappings_hash\n root.mappings_hash\n end", "def password_methods\n return @password_methods\n end", "def index\n @cfg_modules = CfgModule.all\n end" ]
[ "0.6509379", "0.629098", "0.629098", "0.6067614", "0.6067614", "0.6067614", "0.6058913", "0.5953872", "0.58995605", "0.5882232", "0.5798544", "0.5798544", "0.5781803", "0.5781803", "0.57060444", "0.5700608", "0.56508994", "0.5588073", "0.55850405", "0.5584763", "0.55419385", "0.5531381", "0.5530451", "0.55146", "0.54965943", "0.54912657", "0.5489277", "0.5444467", "0.5436555", "0.54192626", "0.54163456", "0.5410674", "0.5382724", "0.5353905", "0.5316162", "0.5316162", "0.53098947", "0.53098947", "0.52780414", "0.5271596", "0.5267095", "0.52567416", "0.525361", "0.52513194", "0.5251192", "0.52496696", "0.52405065", "0.5193684", "0.5188875", "0.5175532", "0.516806", "0.5166717", "0.5158614", "0.5147867", "0.51477295", "0.51374185", "0.51226735", "0.5120889", "0.51172775", "0.51015747", "0.50983065", "0.5093473", "0.5070094", "0.5067756", "0.50573397", "0.50554514", "0.5051253", "0.50470334", "0.5041683", "0.50290906", "0.50220966", "0.50191456", "0.5009219", "0.500852", "0.50083107", "0.50067794", "0.5002327", "0.4998096", "0.49924266", "0.49924266", "0.49888757", "0.49857178", "0.49821466", "0.49785593", "0.49778667", "0.49762788", "0.49762604", "0.4975572", "0.49744946", "0.4972388", "0.49642614", "0.4962212", "0.4954775", "0.49521017", "0.49515134", "0.49494478", "0.49432448", "0.49421656" ]
0.58980703
11
Gives the class the mapping points to. source://devise//lib/devise/mapping.rb82
def to; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_class\n devise_mapping.to\n end", "def mapping_class=(mapping_class)\n @mapping_class = mapping_class \n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def set_class_mapping\n @class_mapping = ClassMapping.find(params[:id])\n end", "def set_class_mapping\n @class_mapping = ClassMapping.find(params[:id])\n end", "def devise_mappings; end", "def mapper\n self.class.representer_class\n end", "def entity_class\n self.class.name.sub(/Mapper$/, '').constantize\n end", "def devise_mapping\n @devise_mapping ||= request.env[\"devise.mapping\"]\n end", "def model_class\n @model_class ||= mapping.to\n end", "def resource_name\n devise_mapping.name\n end", "def mapping; end", "def mapping; end", "def get_as_class_name ruby_class_name\n mapping = @ruby_mappings[ruby_class_name]\n return mapping.nil? ? nil : mapping.as\n end", "def class_for assoc_name\n raise NotImplementedError\n end", "def class_for assoc_name\n raise NotImplementedError\n end", "def mapping\n if @mapping.nil?\n mapping_class = if self.association && self.association.macro == :one\n self.parent.dbi.klass\n else\n dbi.klass\n end\n @mapping = Lolita::Mapping.new(:\"#{mapping_class.to_s.downcase.pluralize}\") || false\n end\n @mapping\n end", "def mapper #:nodoc:\n @mapper.mapper_type\n end", "def mapping_for(target_type)\n @mappings.find do |mapping|\n mapping.type >= target_type\n end\n end", "def field_map_class\n ActiveFedora::RDF::FieldMap\n end", "def klass\n reflection.klass\n end", "def klass\n reflection.klass\n end", "def _map_identify_mapping_handler(object_type)\n proc_name = PrcLib.model.meta_obj.rh_get(object_type,\n :lambdas, :get_attr_e)\n\n is_controller = PrcLib.model.meta_obj.rh_get(object_type,\n :options, :controller)\n\n return nil if !proc_name && !is_controller\n\n if proc_name\n map_handler = [@process.method(proc_name), proc_name, false]\n map_handler << @process.class\n return map_handler\n end\n\n [@controller.method(:get_attr), :get_attr, true, @controller.class]\n end", "def klass\n info.klass\n end", "def polymorphic_mappings; end", "def record_klass\n @record_klass ||= self.class.name.gsub(/Mapper/, '').constantize\n @record_klass\n end", "def map_type\n return \"generic-map\"\n end", "def klass\n self.class\n end", "def entity_class\n @entity_class ||= (\"::\" + self.class.name.split('::').last.gsub(/Mapper/, '')).constantize\n @entity_class\n end", "def map_name; end", "def model_to_registration_mapping\n #{:model => 'server'}\n {:name => 'fullname', :email => 'email'}\n end", "def mapping\n {\n type.to_sym => {\n properties: self.type_mapping\n }\n }\n end", "def map name, &block\n mapped_name, mapped_class = name.first\n mappings[mapped_name] =\n HotCocoa::Mappings::Mapper.map_instances_of mapped_class, mapped_name, &block\n end", "def user_class\n \"#{params[:user_type]}\".classify.constantize\n end", "def mappings\n @mappings ||= self.class.mappings.map{ |factory| factory.create(self) }\n end", "def map\n self\n end", "def index\n @class_mappings = ClassMapping.all\n end", "def mapping\n @mapping ||= map(@current_theme)\n end", "def encryptor_class\n @encryptor_class ||= ::Devise::Encryptors.const_get(encryptor.to_s.classify)\n end", "def associated_class\n self[:class] ||= self[:class_name].constantize\n end", "def _class\n special_attribute('@class'.freeze) || self.class.name.demodulize\n end", "def destination_class\n @destination_class ||= dummy_class_for(dest_table)\n end", "def input_type_to_class(input_type)\n class_mappings = { :text_field => 'text', :password_field => 'text' }\n class_mappings[input_type.to_sym] || nil\n end", "def map_to(klass)\n clone.map_to klass\n end", "def controlled_model_class\n controller_path.classify.constantize\n end", "def current_class( class_code )\n self.classes.select{|c| c.class_code == class_code }.first\n end", "def get_as_class_name obj\n # Get class name\n if obj.is_a?(String)\n ruby_class_name = obj\n elsif obj.is_a?(RocketAMF::Values::TypedHash)\n ruby_class_name = obj.type\n elsif obj.is_a?(Hash)\n return nil\n elsif obj.is_a?(RubyAMF::IntermediateObject)\n ruby_class_name = obj.object.class.name\n else\n ruby_class_name = obj.class.name\n end\n\n # Get AS class name\n as_class_name = @mappings.get_as_class_name ruby_class_name\n\n # Auto-map if necessary, removing namespacing to create mapped class name\n if RubyAMF.configuration.auto_class_mapping && ruby_class_name && as_class_name.nil?\n as_class_name = ruby_class_name.split('::').pop\n @mappings.map :as => as_class_name, :ruby => ruby_class_name\n end\n\n as_class_name\n end", "def associated_class_string\n controller_name.classify\n end", "def atk_class\n return data.atk_class\n end", "def resource_sym\n mapping.singular\n end", "def associated_class\n self[:class] ||= self[:class_name].constantize\n end", "def klass; end", "def klass; end", "def klass; end", "def klass; end", "def klass; end", "def klass; end", "def klass; end", "def klass; end", "def mapping #:nodoc:\n @mapper.config\n end", "def define_mapping\n # no additional parameters\n nil\n end", "def class_for(index)\n if polymorphic?\n if direct_index = @map[index]\n @added[direct_index][1]\n else\n Model.get_class(@database.polymorphic_join_class(@offset,lazy_index(index)))\n end\n else\n @klass\n end\n end", "def menu_to_class_name\n {\"user\" => User, \"collaborator\" => Collaborator, \"assignment\" => Assignment, \"link\" => Link}\n end", "def user_class\n Merb::Authentication.user_class\n end", "def do_target_class_map\r\n (tc = self[:cls]) && tc.map_foorth_shared(@symbol)\r\n end", "def mapping\n enumerations.dig(type, :mapping)\n end", "def class_obj\n self.class\n end", "def affiliate_class\n self.class.affiliate_class\n end", "def className\r\n self.class.to_s\r\n end", "def target_klass_slug\n self.content_type.try(:slug)\n end", "def sfa_class()\n self.class.sfa_class()\n end", "def class_for assoc_name\n @model_class.reflect_on_association(assoc_name.to_sym).klass\n end", "def class_for(n)\n class_mapping = {\n \"#{schema_namespace_prefix}schema\" => Schema,\n \"#{schema_namespace_prefix}element\" => Element,\n \"#{schema_namespace_prefix}attribute\" => Attribute,\n \"#{schema_namespace_prefix}choice\" => Choice,\n \"#{schema_namespace_prefix}complexType\" => ComplexType,\n \"#{schema_namespace_prefix}sequence\" => Sequence,\n \"#{schema_namespace_prefix}simpleContent\" => SimpleContent,\n \"#{schema_namespace_prefix}complexContent\" => ComplexContent,\n \"#{schema_namespace_prefix}extension\" => Extension,\n \"#{schema_namespace_prefix}import\" => Import,\n \"#{schema_namespace_prefix}simpleType\" => SimpleType,\n \"#{schema_namespace_prefix}all\" => SimpleType\n }\n\n return class_mapping[n.is_a?(Nokogiri::XML::Node) ? n.name : n]\n end", "def class_name; end", "def class_name; end", "def identifier_type_mapping_obj\n return nil if identifier_type.blank?\n\n IdentifierTypesToMapping[identifier_type]\n end", "def authorizer_map(model_class, application_authorizer = nil)\n application_authorizer ||= mapping.model_authorizer\n map_of :@authorizer_map, model_class, application_authorizer\n end", "def user_class()\n @user\n end", "def user_model\n self.class.user_model \n end", "def to_class_name\n self.to_method_name.gsub(/\\/(.?)/) { \"#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def map\n self\n end", "def klass(class_name)\n Atlas.const_get(class_name)\n end", "def case_mapping\n self['CASEMAPPING']\n end", "def provider_class\n self.class\n end", "def provider_class\n self.class\n end", "def class_name\n self.class.to_s\n end", "def class_name\n self.class.to_s\n end", "def type_klass; end", "def pearified_classname\n self\n end", "def class_for_controller_name\n controller_model\n end", "def klass\n @options[:class].presence\n end", "def mapping_from_name(name)\n const_get(\"#{name}_mapping\".upcase)\n end", "def klass\n class_name = self[\"_type\"]\n class_name ? class_name.constantize : nil\n end", "def page_class\n current_template.classify.constantize\n end", "def classes\n [self]\n end", "def convert_class(klass)\n ::ActiveSupport::Inflector.underscore(klass.name).gsub(\"/\", \"_\")\n end", "def get_ruby_class_name as_class_name\n mapping = @as_mappings[as_class_name]\n return mapping.nil? ? nil : mapping.ruby\n end", "def entry_class\n @entry_class ||= settings(\"components.#{params[:component]}.klass\", fatal_exception: true).classify.constantize\n end", "def resource_class\n class_name\n end" ]
[ "0.7469814", "0.70252424", "0.6457786", "0.6457786", "0.6457786", "0.6288632", "0.6288632", "0.62339735", "0.6174149", "0.61511195", "0.6061646", "0.6051679", "0.58797985", "0.583527", "0.583527", "0.58018005", "0.57868457", "0.57868457", "0.57754934", "0.5659182", "0.5646276", "0.5646064", "0.5645064", "0.5645064", "0.56012607", "0.55921286", "0.5557018", "0.5552668", "0.55401504", "0.55377656", "0.5535561", "0.55234164", "0.55128956", "0.5508865", "0.55068743", "0.55059373", "0.5497339", "0.5485982", "0.5472076", "0.5454666", "0.545332", "0.54492927", "0.544424", "0.5439153", "0.54308504", "0.5430056", "0.54234964", "0.5416948", "0.54120475", "0.5409925", "0.5407524", "0.5399301", "0.5378168", "0.5375375", "0.5375375", "0.5375375", "0.5375375", "0.5375375", "0.5375375", "0.53751296", "0.53751296", "0.5373234", "0.53720826", "0.5366924", "0.53565514", "0.5348538", "0.53408295", "0.53270656", "0.5320477", "0.5310528", "0.5300525", "0.5289485", "0.5286562", "0.5285919", "0.52823347", "0.5281457", "0.5281457", "0.5280694", "0.5278913", "0.5271677", "0.5270424", "0.526512", "0.52619547", "0.5247388", "0.52472275", "0.5245385", "0.5245385", "0.5243371", "0.5243371", "0.5242759", "0.5241532", "0.5239137", "0.5232835", "0.52319425", "0.5231563", "0.52249134", "0.52165216", "0.52150106", "0.52099717", "0.5208089", "0.5205427" ]
0.0
-1
Receives an object and find a scope for it. If a scope cannot be found, raises an error. If a symbol is given, it's considered to be the scope. source://devise//lib/devise/mapping.rb35
def find_scope!(obj); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auto_detect_scope(*args)\n options = args.extract_options!\n\n if options.key?(:for)\n options[:scope] = options[:for]\n ::ActiveSupport::Deprecation.warn(\"DEPRECATION: \" <<\n \"Devise scope :for option is deprecated. \" <<\n \"Use: facebook_*_link(:some_scope), or facebook_*_link(:scope => :some_scope)\")\n end\n\n scope = args.detect { |arg| arg.is_a?(Symbol) } || options[:scope] || ::Devise.default_scope\n mapping = ::Devise.mappings[scope]\n\n if mapping.for.include?(:facebook)\n scope\n else\n error_message =\n \"%s\" <<\n \" Did you forget to devise facebook_connect in your model? Like this: devise :facebook_connectable.\" <<\n \" You can also specify scope explicitly, e.g.: facebook_*link :for => :customer.\"\n error_message %=\n if scope.present?\n \"#{scope.inspect} is not a valid facebook devise scope. \" <<\n \"Loaded modules for this scope: #{mapping.for.inspect}.\"\n else\n \"Could not auto-detect any facebook_connectable devise scope.\"\n end\n raise error_message\n end\n end", "def resolved_scope(scope)\n scoper_object(scope).resolve\n end", "def find_in_scope scope, element\n scope.select do |struct|\n struct.keys.include?(element.to_sym)\n end.first\n end", "def scope\n finder_or_run(:scope)\n end", "def scope(object = nil)\n configure(:scope, object)\n end", "def look_for(symbol)\n env = self.find {|e| e.symbol.equal? symbol}\n return env unless env.nil?\n raise NameError.new(\"#{symbol} not found\", symbol)\n end", "def find_symbol(sym, ctx)\n ctx.each do |h|\n if val = resolve_in(h, sym)\n return val\n end\n end\n\n nil\n end", "def resolve(scope)\n scope\n end", "def scope\n read_attr :scope, :to_sym\n end", "def scope_for(finder, options = {})\n return finder unless options.keys.include? @named_scope\n value = options.delete(@named_scope)\n finder.send(@named_scope, value)\n end", "def verify_scope(scope)\n self.user_scope.each do |sym|\n raise RuntimeError, \"Expected to be passed a scope containing the key '#{sym.to_s}'\" unless scope.has_key? sym\n end\n scope\n end", "def devise_scope(scope)\n constraint = lambda do |request|\n request.env[\"devise.mapping\"] = Devise.mappings[scope]\n true\n end\n\n constraints(constraint) do\n yield\n end\n end", "def find_local_symbol(symbol)\n find_class_or_module_named(symbol) || super\n end", "def find_local_symbol(symbol)\n find_class_or_module(symbol) || super\n end", "def search_for(options = {})\n @scopes.values.inject(@model) { |finder, scope| scope.scope_for(finder, options) }\n end", "def find_single(scope, options)\n return nil if scope.nil?\n old_find_single(scope, options)\n end", "def set_object\n @object = scope.find(allow_params[:id])\n end", "def from_symbol(sym)\n self.binders.each do |binder|\n if bound_object = binder.call(sym)\n p \"handling symbol #{sym.inspect} as bound match #{bound_object.to_s}\" if self.class.debug\n return bound_object\n end\n end\n p \"handling symbol #{sym.inspect} as itself\" if self.class.debug\n SymbolEntity.new(sym)\n end", "def select_scope(scope)\n if [Scopes::SCOPE_PRIVATE, Scopes::SCOPE_PUBLIC, nil].include?(scope)\n Scopes::SCOPE_PRIVATE\n else\n scope\n end\n end", "def lookup_global_silent(param)\n @context.find_global_scope.to_hash[param]\nend", "def get_symbol(sym)\n\t\t\tif @parameters.key?(sym)\n\t\t\t\treturn @parameters[sym]\n\t\t\telsif @species[sym]\n\t\t\t\treturn @species[sym]\n\t\t\telse\n\t\t\t\traise \"Symbol #{sym} not found in model\"\n\t\t\tend\n\t\tend", "def selected_scope\n (params[:scope] || :default).to_sym\n end", "def scoped_by(name, options = {})\n options[:scope] ||= :reference\n if scope_class = self.class.scope_types[options[:scope]]\n @scopes[name] = scope_class.new(@model, name, options)\n end\n end", "def apply_function_lookup(scope, cast, ast)\n relationship_arg, property_arg = ast.children\n\n if !relationship_arg.is_a?(Keisan::AST::Literal)\n raise Kaprella::Errors::GeneratorFunctionArgumentError.new(\"Argument at index 0 for #{ast.name}() must be a string literal\")\n else\n if !scope.model.reflections.include?(relationship_arg.value)\n raise Kaprella::Errors::GeneratorFunctionArgumentError.new(\"#{scope.model.to_s} has no '#{relationship_arg.value}' relationship\")\n end\n\n relationship = scope.model.reflections[relationship_arg.value]\n end\n\n if !property_arg.is_a?(Keisan::AST::Literal)\n scope, property = apply_ast(scope, property_arg)\n else\n if !property_arg.value.match(/^[a-zA-Z0-9]+$/)\n raise Kaprella::Errors::GeneratorFunctionArgumentError.new(\"Argument at index 1 for #{ast.name}() is a literal with disallowed characters\")\n end\n property = property_arg.value\n if !property.is_a?(String)\n raise Kaprella::Errors::GeneratorFunctionArgumentError.new(\"Argument at index 1 for #{ast.name}() must be a string\")\n end\n end\n\n apply_lookup(scope, cast, relationship, property)\n end", "def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end", "def resolve_object obj\n case obj\n when Shark::Object\n obj\n when String\n obj.identifier? ? @storage.find(obj) : nil\n else\n nil\n end\n end", "def scope_handler(scope_string)\n str = scope_string.split(\":\", 3)\n raise ScopeNotHandled, \"Wrong format for scope string\" if str.length != 3\n\n case str[0]\n when \"repository\"\n auth_scope = Namespace::AuthScope.new(scope_string)\n when \"registry\"\n auth_scope = Registry::AuthScope.new(scope_string)\n else\n raise ScopeNotHandled, \"Scope not handled: #{str[0]}\"\n end\n\n [auth_scope, auth_scope.scopes.dup]\n end", "def lookup(locale, key, scope = [], options = {})\n\n init_translations unless initialized?\n result = nil\n _locale = ::Locale.first(:code => locale)\n key = pluralizer(_locale, key, options[:count])\n value = _locale.translations.first(:code => key)\n result = value.value unless value.nil?\n result = options[:default] if !value.nil? && value.value == key && options[:default]\n return result unless value.nil? || value.value == key\n \n # check devise messages for remaining keys\n result = _locale.translations.first(:code => \"devise.sessions.#{key}\")\n return result.value unless result.nil?\n\n # fall back on yaml file if no object is found in db\n keys = I18n.normalize_keys(locale, key, scope, options[:separator])\n keys.inject(translations) do |result, _key|\n return nil unless result.is_a?(Hash) && result.has_key?(_key)\n result = result[_key]\n result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)\n result = options[:default] if options[:default] && result.nil?\n result\n end\n \n end", "def resolve(param)\n return param unless param.is_a?(Symbol)\n return (@resolver || DEFAULT_RESOLVER).call(param)\n end", "def method_missing(sym, *args)\n lookup(sym.to_sym)\n end", "def scope_handler(registry, scope_string)\n str = scope_string.split(\":\", 3)\n raise ScopeNotHandled, \"Wrong format for scope string\" if str.length != 3\n\n case str[0]\n when \"repository\"\n auth_scope = Namespace::AuthScope.new(registry, scope_string)\n when \"registry\"\n auth_scope = Registry::AuthScope.new(registry, scope_string)\n else\n logger.error \"Scope not handled: #{str[0]}\"\n raise ScopeNotHandled\n end\n\n [auth_scope, auth_scope.scopes]\n end", "def find_by_symbol(symbol)\n fetch([name, symbol.to_s]) do\n where(symbol: symbol).first\n end\n end", "def stradivari_scope(name, *args, &block)\n callable, options = stradivari_scope_options(*args, &block)\n\n scope(name, callable)\n options[:type] ||= :string\n stradivari_scopes.store(name.to_sym, options)\n end", "def nil_in_scope?(scope, key)\n if scope.is_a?(Hash)\n scope.include?(key)\n else\n scope.exist?(key)\n end\n end", "def lookup\n InternalId.find_by(**scope, usage: usage_value)\n end", "def resolve_symbol(resolver, sym, ctx)\n if found = find_symbol(sym.to_sym, ctx)\n resolve_lexically(resolver, found, ctx)\n found\n elsif dynamic = resolver.resolve_symbol(sym)\n dynamic\n else\n fail(\"Unknown symbol in manifest: #{sym}\")\n end\n end", "def scoped_search(scope, *args, &block)\n # extract the original query\n query = args[1] || \"*:*\"\n\n # prepend the environment to the query based on scope\n case scope\n when /domain/i,/dc/i\n args[1] = \"domain:#{node[:domain]} AND (#{query})\"\n when /environment/, /env/i\n args[1] = \"chef_environment:#{node[:chef_environment]} AND (#{query})\"\n else\n rasie ArgumentError \"restricted search does not know how to handle scope: #{scope} \"\n end\n\n # call the original search method\n search(*args, &block)\n end", "def method_missing(method_id, *arguments, &block)\n if match = ActiveRecord::DynamicFinderMatch.match(method_id)\n attribute_names = match.attribute_names\n super unless all_attributes_exist?(attribute_names)\n if !arguments.first.is_a?(Hash) && arguments.size < attribute_names.size\n ActiveSupport::Deprecation.warn(\n \"Calling dynamic finder with less number of arguments than the number of attributes in \" \\\n \"method name is deprecated and will raise an ArguementError in the next version of Rails. \" \\\n \"Please passing `nil' to the argument you want it to be nil.\"\n )\n end\n if match.finder?\n options = arguments.extract_options!\n relation = options.any? ? scoped(options) : scoped\n relation.send :find_by_attributes, match, attribute_names, *arguments\n elsif match.instantiator?\n scoped.send :find_or_instantiator_by_attributes, match, attribute_names, *arguments, &block\n end\n elsif match = ActiveRecord::DynamicScopeMatch.match(method_id)\n attribute_names = match.attribute_names\n super unless all_attributes_exist?(attribute_names)\n if arguments.size < attribute_names.size\n ActiveSupport::Deprecation.warn(\n \"Calling dynamic scope with less number of arguments than the number of attributes in \" \\\n \"method name is deprecated and will raise an ArguementError in the next version of Rails. \" \\\n \"Please passing `nil' to the argument you want it to be nil.\"\n )\n end\n if match.scope?\n self.class_eval <<-METHOD, __FILE__, __LINE__ + 1\n def self.#{method_id}(*args) # def self.scoped_by_user_name_and_password(*args)\n attributes = Hash[[:#{attribute_names.join(',:')}].zip(args)] # attributes = Hash[[:user_name, :password].zip(args)]\n scoped(:conditions => attributes) # scoped(:conditions => attributes)\n end # end\n METHOD\n send(method_id, *arguments)\n end\n else\n super\n end\n end", "def scope\n parameter[:scope]\n end", "def set_scope\n if (scope = params[:scope])\n if @resource.respond_to?(scope)\n @resource = @resource.send(scope)\n else\n not_allowed\n end\n end\n end", "def find_symbol(symbol)\n find_symbol_module(symbol) || find_local_symbol(symbol)\n end", "def devise_scope(scope); end", "def resolve_trackable(owner, trackable)\n case trackable.to_s\n when /^@/ then owner.instance_variable_get(trackable.to_sym)\n else owner.send(trackable.to_sym)\n end\n end", "def scope(parameters)\n scope_proxy.ad_hoc(parameters)\n end", "def try_to_set_scope\n #this is a commodity method\n if self.featurable.is_a?(Account)\n self.scope = \"AccountPlan\"\n end\n end", "def scope_from_params(params)\n return default_scope if params[:scope].blank?\n scope = params[:scope].is_a?(Array) ? params[:scope] : params[:scope].split(',')\n scope = scope.map(&:downcase).map(&:strip)\n return scope & default_scope\n end", "def find_scope(filter_name)\n @model_decorator.filters[filter_name].try(:[], :scope) || filter_name\n end", "def scope\n @scope ||= {}\n end", "def scope\n @scope ||= {}\n end", "def search(scope, _criteria)\n scope\n end", "def scope_model\n @scope_association ||= scoping_object.send(model_name_to_method_sym)\n end", "def method_missing(method_name, *args, &block)\r\n if model\r\n scopes = ActiveRecord::Base.scopes.merge(model.scopes).keys\r\n\r\n if scopes.include? method_name\r\n return Restful::Resource::Scope.new self, method_name, model, args,\r\n block\r\n elsif method_name.to_s =~ /^(?:find(?:_all)?|first|last)_by_/\r\n finder method_name\r\n return send method_name, *args, &block\r\n end\r\n end\r\n\r\n super\r\n end", "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end", "def resolve\n pass_id = Pass.where(phrase: pass&.phrase).pluck(:id)\n scope.where(pass_id: pass_id)\n end", "def search_for(model, symbol, &blk)\n @search_helpers ||= Hash.new\n model_specific = @search_helpers[model.to_s] ||= Hash.new\n\n model_specific[symbol] = blk if blk\n\n model_specific[symbol]\n end", "def set_scope\n @scope = Scope.find(params[:id])\n end", "def set_scope\n @scope = Scope.find(params[:id])\n end", "def get_scope_by_id(id)\n id = id.to_s\n scopes.find{|s| s.id == id }\n end", "def context_object( *finder_options )\n params[:context_type].classify.constantize.find(\n context_id, *finder_options )\n end", "def scope\n @attributes[:scope]\n end", "def resolve(symbol)\n instance = @created[symbol] || construct(symbol)\n end", "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend", "def search_for(model, symbol, &blk)\n @search_helpers ||= Hash.new\n model_specific = @search_helpers[model.to_s] ||= Hash.new\n\n model_specific[symbol] = blk if blk\n model_specific[symbol]\n end", "def find\n klass = @object\n return klass if @object.nil?\n\n if @object.respond_to?(:sand_policy)\n @object.sand_policy\n elsif @object.class.respond_to?(:sand_policy)\n @object.sand_policy\n else\n klass = if @object.is_a?(Symbol)\n @object.to_s.camelize\n elsif @object.respond_to?(:model)\n @object.model\n elsif @object.respond_to?(:model_class)\n @object.model_class\n else\n @object.to_s\n end\n \"#{klass}#{POLICY_SUFFIX}\"\n end\n end", "def slug_scope_key\n return nil unless slug_scope\n reflect_on_association(slug_scope).try(:key) || slug_scope\n end", "def scope\n klass\n end", "def has_scope(scope_group, *scopes)\n options = scopes.extract_options!\n options.symbolize_keys!\n options.assert_valid_keys(:type, :if, :unless, :default, :as, :using, :allow_blank)\n\n if options.key?(:using)\n if options.key?(:type) && options[:type] != :hash\n raise \"You cannot use :using with another :type different than :hash\"\n else\n options[:type] = :hash\n end\n\n options[:using] = [*options[:using]]\n end\n\n self.scopes_configuration ||= {}\n self.scopes_configuration[scope_group] ||= {}\n\n scopes.each do |scope|\n self.scopes_configuration[scope_group][scope] ||= {\n :as => scope,\n :type => :default\n }\n self.scopes_configuration[scope_group][scope].merge!(options)\n end\n end", "def scope_name; end", "def find_local_symbol(symbol)\n find_method_named(symbol) or\n find_constant_named(symbol) or\n find_attribute_named(symbol) or\n find_external_alias_named(symbol) or\n find_module_named(symbol) or\n find_file_named(symbol)\n end", "def apply_to_scope(scope)\n scope\n end", "def ident_check sym\n valid, scope = @stack.search sym, true\n NamingError.log(\"Line #{sym.line_number}: No identifier '#{sym.text}' in current scope '#{@current_level}'\") if !valid\n \n scope\n end", "def scope_to(*args, &block)\n config.scope_to(*args, &block)\n end", "def scope_info\n if is_scoped? && scoped_manual.present?\n {\n \"scope\" => {\n \"title\" => scoped_manual.to_hash.fetch(\"title\", \"\"),\n },\n \"unscoped_results\" => unscoped_results,\n }\n else\n {}\n end\n end", "def authorization_scope_type_for(policy, target)\n policy.resolve_scope_type(target)\n end", "def scope scope = nil, &proc\n @scope = (proc || scope) if (scope || proc) && configurable?\n @setup[:scope] ||= @scope ||\n (@controller.ctrl.slice.view.scope if @controller)\n end", "def valid_scope(valid_scopes, scope)\n\t\tend", "def lookup_in_scope(name, scope)\n loop do\n tn = scope.path_with_task_name(name)\n task = @tasks[tn]\n return task if task\n break if scope.empty?\n scope = scope.tail\n end\n nil\n end", "def has_scope?( scope )\n scope_names.include?( scope )\n end", "def find_property\n @property ||= scope.find(params[:id])\n end", "def find_first(options = {})\n construct_scope(options).first\n end", "def scope(name, scope=nil, &block)\n raise ArgumentError, \"Dangerous scope name: a :#{name} method is already defined. Please, use another one.\" \\\n if respond_to?(name)\n proc = case\n when block_given?\n block\n when scope.is_a?(Flex::Scope)\n lambda {scope}\n when scope.is_a?(Proc)\n scope\n else\n raise ArgumentError, \"Scope object or Proc expected (got #{scope.inspect})\"\n end\n metaclass = class << self; self end\n metaclass.send(:define_method, name) do |*args|\n scope = proc.call(*args)\n raise Scope::Error, \"The scope :#{name} does not return a Flex::Scope object (got #{scope.inspect})\" \\\n unless scope.is_a?(Flex::Scope)\n scope\n end\n scope_methods << name\n end", "def scope\n @options[:scope]\n end", "def scope(scope_name, &block)\n scope_obj = LocatorScope.new(self)\n scope_obj.scoped_locator = send \"#{scope_name}_locator\"\n scope_obj.run(&block)\n end", "def resolve_sym arg\n value = resolve_value arg\n arg = arg.to_s.sub(/^_/, '')\n if value.to_s == arg.to_s\n Partializer::Collection.new 'sym', arg\n else\n Partializer::Collection.new 'sym', arg, {arg.to_sym => value}\n end\n end", "def assign_access_scope(scope)\n ACCESS_SCOPES.include?(scope.to_s) or raise \"'#{ scope }' is not a valid scope.\"\n self.access_scope = scope.to_s\n end", "def dynamic_scopes\n self.scopes.select { |name, args| args.present? }\n end", "def scope\n @scope ||= Array(@root_scope) + [Inflector.underscore(name)]\n end", "def stored_location_for(resource_or_scope); end", "def stored_location_for(resource_or_scope)\n scope = Devise::Mapping.find_scope!(resource_or_scope)\n session.key?(:\"#{scope}_return_to\") ? session.delete(:\"#{scope}_return_to\") + format_suffix : nil\n end", "def stats_scope\n redirect_to admin_dashboard_path, alert: \"Scope not available\" unless\n params[:scope].present? && %w(catalogs).include?(params[:scope])\n\n params[:scope]\n end", "def lookup(locale, key, scope = [], options = {})\n init_translations unless initialized?\n \n # only formal address: [:de, :de_formal]\n # only multi tenancy: [:de, :tenant_name_de]\n # formal address & multi tenancy: [:de, :tenant_name_de, :de_formal, :tenant_name_de_formal]\n \n locales = []\n \n base_locale = locale.to_s.gsub(FORMAL_LOCALE_PATTERN, '')\n \n tenant = tenant_from_locale?(locale)\n base_locale.gsub!(/^#{tenant}_/, '') if tenant\n \n locales << base_locale.to_sym \n \n if locale.to_s.match(FORMAL_LOCALE_PATTERN) && tenant && locale.to_s.match(/^#{tenant}_/)\n locales << locale.to_s.gsub(FORMAL_LOCALE_PATTERN, '').to_sym\n locales << locale.to_s.gsub(/^#{tenant}_/, '').to_sym\n end\n \n locales << locale unless locales.include?(locale)\n \n entry, last_entry = nil, nil\n \n locales.each do |locale|\n keys = I18n.normalize_keys(locale, key, scope, options[:separator])\n \n entry = keys.inject(translations) do |result, _key|\n _key = _key.to_sym\n \n unless result.is_a?(Hash) && result.has_key?(_key)\n nil\n else\n result = result[_key]\n result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)\n result\n end\n end\n \n if entry.nil?\n entry = last_entry\n else\n last_entry = entry\n end\n end\n \n entry\n end", "def scope_path\n opts = {}\n route = :\"new_#{scope}_session_path\"\n alt_route = :\"new_#{scope}_ichain_session_path\"\n opts[:format] = request_format unless skip_format?\n\n config = Rails.application.config\n opts[:script_name] = (config.relative_url_root if config.respond_to?(:relative_url_root))\n\n context = send(Devise.available_router_name)\n\n if context.respond_to?(route)\n context.send(route, opts)\n elsif context.respond_to?(alt_route)\n context.send(alt_route, opts)\n elsif respond_to?(:root_path)\n root_path(opts)\n else\n \"/\"\n end\n end", "def update_scope\n @scope = params[:scope] || params[:q] || {}\n end", "def scope_by(&block)\n raise 'Cannot define scope after scope has been called.' if @scope\n\n @scope_block = block\n end", "def scope_query(operand)\n @scope << operand.class\n end", "def find_local_symbol(symbol)\n find_method_named(symbol) or\n find_constant_named(symbol) or\n find_attribute_named(symbol) or\n find_module_named(symbol) or\n find_file_named(symbol)\n end", "def set_scope(val)\n @scope = val\n build_path_query\n @scope\n end", "def lookup(identifier)\n\t\tif @symbols.has_key?(identifier)\n\t\t\treturn @symbols[identifier]\n\t\telse\n\t\t\tprint \"Identificador: #{identifier}, no se encuentra en ningun alcance\"\n\t\tend\n\tend", "def method_missing(name, *args)\n value = fetch(name)\n if value == Scope::NOT_FOUND\n value = super.method_missing(name, *args)\n end\n return value\n end", "def scope\n field[:scope]\n end" ]
[ "0.59876454", "0.59150594", "0.58141863", "0.57870954", "0.5668741", "0.5598901", "0.5569699", "0.55146855", "0.54737335", "0.5379349", "0.5378796", "0.53617275", "0.5352487", "0.5322347", "0.52657807", "0.5257427", "0.52334386", "0.5212911", "0.5165321", "0.5164895", "0.5139336", "0.5122947", "0.5116915", "0.5109409", "0.51000696", "0.5087919", "0.5077007", "0.50407606", "0.50369275", "0.5002858", "0.49984547", "0.49984476", "0.49962527", "0.4988208", "0.49868578", "0.49768382", "0.49716046", "0.4955679", "0.49453363", "0.4941349", "0.49259332", "0.49244693", "0.4884139", "0.48654795", "0.485471", "0.48518312", "0.48482022", "0.4835232", "0.4835232", "0.48352268", "0.48326194", "0.48291185", "0.4799849", "0.47977766", "0.47926828", "0.47857895", "0.47857895", "0.4773902", "0.4768343", "0.47636703", "0.47613716", "0.4760771", "0.4746128", "0.47420138", "0.47394675", "0.47300908", "0.47287026", "0.47203287", "0.47199583", "0.4713989", "0.47084323", "0.47079894", "0.47069398", "0.46971667", "0.46911734", "0.46853456", "0.46811643", "0.46716034", "0.46620736", "0.46586826", "0.4651296", "0.46507016", "0.46504444", "0.46469197", "0.46461096", "0.46220824", "0.4615353", "0.46136782", "0.45986557", "0.45917872", "0.45849088", "0.45830712", "0.45790017", "0.45743364", "0.45713103", "0.45711252", "0.45667544", "0.45639226", "0.4550676", "0.45495987" ]
0.6314478
0
The hook which is called inside devise. So your ORM can include devise compatibility stuff. source://devise//lib/devise/models.rb116
def devise_modules_hook!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def devise_parameter_sanitizer; end", "def devise_controller?; end", "def devise_mappings; end", "def fetch_details_from_devise\n self.username = 'devise_user'\n self.save\n end", "def fetchable_fields\n super - [:password, :password_confirmation]\n # if (context[:current_user].guest)\n # super - [:email]\n # else\n # super\n # end\n end", "def devise_scope(scope); end", "def apply_devise_schema(name, type, options={})\n raise NotImplementedError\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def devise_mapping\n @devise_mapping ||= Devise.mappings[:user]\n end", "def trackable\n apply_devise_schema :sign_in_count, Integer, :default => 0\n apply_devise_schema :current_sign_in_at, DateTime\n apply_devise_schema :last_sign_in_at, DateTime\n apply_devise_schema :current_sign_in_ip, String\n apply_devise_schema :last_sign_in_ip, String\n end", "def after_database_authentication; end", "def current_user\n #super the main class of devise current_user\n super || guest_user\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def user_authentication\n end", "def after_custom_authentication; end", "def person_extra_methods\n include Domainify::InstanceMethods\n #confirm account id is correct on create of user\n after_create :update_user_account_id\n end", "def init_orm_hooks!\n sorcery_adapter.define_callback :before, :validation, :encrypt_password, if: proc { |record|\n record.send(sorcery_config.password_attribute_name).present?\n }\n\n sorcery_adapter.define_callback :after, :save, :clear_virtual_password, if: proc { |record|\n record.send(sorcery_config.password_attribute_name).present?\n }\n\n attr_accessor sorcery_config.password_attribute_name\n end", "def update_devise_user\n inject_into_file 'app/models/user.rb', after: \":validatable\" do <<-'RUBY'\n, :omniauthable\n validates_presence_of :email\n has_many :authorizations\n\n def self.new_with_session(params,session)\n if session[\"devise.user_attributes\"]\n new(session[\"devise.user_attributes\"],without_protection: true) do |user|\n user.attributes = params\n user.valid?\n end\n else\n super\n end\n end\n\n def self.from_omniauth(auth, current_user)\n authorization = Authorization.where(:provider => auth.provider, :uid => auth.uid.to_s, :token => auth.credentials.token, :secret => auth.credentials.secret).first_or_initialize\n if authorization.user.blank?\n user = current_user.nil? ? User.where('email = ?', auth[\"info\"][\"email\"]).first : current_user\n if user.blank?\n user = User.new\n user.password = Devise.friendly_token[0,10]\n user.name = auth.info.name\n user.email = auth.info.email\n auth.provider == \"twitter\" ? user.save(:validate => false) : user.save\n end\n authorization.username = auth.info.nickname\n authorization.user_id = user.id\n authorization.save\n end\n authorization.user\n end\n RUBY\n end\n end", "def capable_login_auth?; end", "def devise_mapping\n @devise_mapping ||= request.env[\"devise.mapping\"]\n end", "def after_custom_authentication\n\n end", "def current_user\n # if a user is logged in we just use devise's implementation.\n super || guest_user\n end", "def devise(*modules)\n # hack to get around Neo4j's requirement to index before uniqueness validation\n index :email, :type => :exact if modules.include?(:validatable)\n super\n end", "def subscribe_sql_active_record; end", "def send_devise_notification(notification, *args); end", "def configure_devise_permitted_parameters\n # We can't easily override here the internal Devise::RegistrionController used by the\n # Engine, because the engine is not namespaced.\n # So we have to resort to some tinkering right here:\n# DEBUG\n# logger.debug( \"\\r\\n\\r\\n!! =====[ #{self.class.name}: configure_devise_permitted_parameters ]====\" )\n# logger.debug( \"- resource...: \" << resource.inspect )\n# logger.debug( \"- PARAMS.....: \" << params.inspect )\n# logger.debug( \"- CTRL.......: \" << params[:controller] )\n# logger.debug( \"- ACTION.....: \" << params[:action] )\n\n # User new/create: do not allow any parameter if recaptcha fails:\n if (params[:controller].to_s == 'devise/registrations') &&\n ( (params[:action].to_s == 'new') || (params[:action].to_s == 'create') )\n# logger.debug( \"In devise/registrations...\" )\n\n if (params[:action].to_s == 'new') || (params[:action].to_s == 'create' && verify_recaptcha)\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(\n :email, :password, :password_confirmation,\n :name, :first_name, :last_name, :description, :year_of_birth\n )\n end\n flash[:error] = nil\n else\n flash[:error] = I18n.t('search_view.captcha_fail')\n end\n end\n\n # User edit/update:\n devise_parameter_sanitizer.permit(:account_update) do |user_params|\n user_params.permit(\n :email, :password, :password_confirmation,\n :name, :first_name, :last_name, :description, :year_of_birth\n )\n end\n end", "def user_app_data\n\t\t# assign devise user as instance variable\n\t\t@user = devise_current_user\n\tend", "def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:email, :password) }\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :password, :password_confirmation, :current_password) }\n end", "def user_provider; end", "def apply_devise_schema(name, type, options={})\n return unless Devise.apply_schema\n property name, :cast_as => type\n end", "def config_setup\n [\n Project,\n Affiliate,\n Employee,\n EmployeeSession,\n Ldaper,\n User,\n UserSession,\n Company,\n Admin\n ].each do |model|\n unless model.respond_to?(:original_acts_as_authentic_config)\n model.class_attribute :original_acts_as_authentic_config\n end\n model.original_acts_as_authentic_config = model.acts_as_authentic_config\n end\n end", "def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n # then call super treat everything normal, and ignore right hand side\n # if super == false, call right hand side\n\n # super comes from devise class\n # meanwhile the r.h.s comes from open struct class\n super || guest_user\n end", "def orm_patches_applied; end", "def login_attribute\n super\n end", "def ldap_before_save\n self.email = Devise::LDAP::Adapter.get_ldap_param(username, 'mail').first\n end", "def devise_parameter_sanitizer\n if resource_class == Host\n Host::ParameterSanitizer.new(Host, :host, params)\n else\n ParameterSanitizer.new(User, :user, params)\n # super # Use the default one\n end\n end", "def resource_class\n devise_mapping.to\n end", "def configure_permitted_parameters\n #devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :first_name, :last_name) }\n if resource_class == User\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :first_name, :last_name) }\n elsif resource_class == Company\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :name, :details) }\n else\n super\n end\n end", "def skip_pundit?\n devise_controller?\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u|\n u.permit(:uid, :email, :password, :password_confirmation, :remember_me)\n }\n devise_parameter_sanitizer.for(:sign_in) { |u|\n u.permit(:login, :uid, :email, :password, :remember_me)\n }\n devise_parameter_sanitizer.for(:account_update) { |u|\n u.permit(:uid, :email, :password, :password_confirmation, :current_password)\n }\n end", "def devise_install(&block)\n if block_given?\n Devise.setup do |config|\n block.call config\n end\n end\n end", "def before_import_save(record)\n puts \"I am calling the hook\"\n self.allow_blank_password = true\n end", "def apply_devise_schema(name, type, options={})\n eval \"#{type.entity_name}, #{name}, #{options.to_s}\"\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation, :remember_me, :user_level) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :username, :first_name, :last_name, :birthday, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :first_name, :last_name, :age, :country_code, :language_first, :language_second, :sex, :address, :birthday, :password, :password_confirmation, :current_password) }\n end", "def assign_current_user_to_models\n ActiveRecord::Base.current_user_proc = proc {send(DefaultCurrentUserMenthod)}\n end", "def get_field_deserializers()\n return super.merge({\n \"isUsableForSignIn\" => lambda {|n| @is_usable_for_sign_in = n.get_boolean_value() },\n })\n end", "def before_save(sender); end", "def auth_trap_state\n super\n end", "def migration_railties; end", "def migration_railties; end", "def apply_devise_schema(name, type, options={})\n # type = Time if type == DateTime\n # field name, { :type => type }.merge!(options)\n end", "def model_class\n User\n end", "def configure_permitted_parameters\n\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :phone_number, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:name, :email, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :password, :remember_me)}\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) do |u|\n u.permit(:username, :email, :password, :password_confirmation,\n :remember_me)\n end\n devise_parameter_sanitizer.permit(:sign_in) do |u|\n u.permit(:login, :username, :email, :password, :remember_me)\n end\n devise_parameter_sanitizer.permit(:account_update) do |u|\n u.permit(:username, :email, :password, :password_confirmation,\n :current_password)\n end\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :password, :password_confirmation]) \n devise_parameter_sanitizer.permit(:account_update, keys: [:name, :is_female, :date_of_birth, :email, :password, :password_confirmation, :current_password]) \n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:email, :password, :remember_me)\n end\n\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(:email, :password, :password_confirmation)\n end\n end", "def apply_devise_schema(name, type, options={})\n column name, type.to_s.downcase.to_sym, options\n end", "def after_create_account(user, auth)\n # not required\n end", "def extend_inherited_method\n ActiveRecord::Base.class_eval do\n class << self\n def inherited_with_valle_validators(subclass)\n inherited_without_valle_validators(subclass)\n if (Valle.can_process_model?(subclass.model_name) &&\n self == ActiveRecord::Base &&\n subclass != ActiveRecord::SchemaMigration)\n Valle::Hooks.extend_ar_validations_valid_method(subclass)\n end\n end\n\n alias_method_chain :inherited, :valle_validators\n end\n end\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:locale, :name, :username, :email, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n # @current_user.nil? ? I18n.default_locale : I18n.locale = @current_user.locale\n end", "def sign_in\n trait()\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :middle_initial, :last_name, :username, :type, :email, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:logon, :username, :email, :password, :remember_me) }\n end", "def instruct_user!\n end", "def devise_i18n_options(options)\n options[:scope] = \"devise.registrations\"\n options\n end", "def before_all\n super if defined?(super)\n end", "def get_field_deserializers()\n return super.merge({\n \"deviceThreatProtectionEnabled\" => lambda {|n| @device_threat_protection_enabled = n.get_boolean_value() },\n \"deviceThreatProtectionRequiredSecurityLevel\" => lambda {|n| @device_threat_protection_required_security_level = n.get_enum_value(MicrosoftGraph::Models::DeviceThreatProtectionLevel) },\n \"minAndroidSecurityPatchLevel\" => lambda {|n| @min_android_security_patch_level = n.get_string_value() },\n \"osMaximumVersion\" => lambda {|n| @os_maximum_version = n.get_string_value() },\n \"osMinimumVersion\" => lambda {|n| @os_minimum_version = n.get_string_value() },\n \"passwordExpirationDays\" => lambda {|n| @password_expiration_days = n.get_number_value() },\n \"passwordMinimumLength\" => lambda {|n| @password_minimum_length = n.get_number_value() },\n \"passwordMinutesOfInactivityBeforeLock\" => lambda {|n| @password_minutes_of_inactivity_before_lock = n.get_number_value() },\n \"passwordPreviousPasswordBlockCount\" => lambda {|n| @password_previous_password_block_count = n.get_number_value() },\n \"passwordRequired\" => lambda {|n| @password_required = n.get_boolean_value() },\n \"passwordRequiredType\" => lambda {|n| @password_required_type = n.get_enum_value(MicrosoftGraph::Models::AndroidRequiredPasswordType) },\n \"securityBlockJailbrokenDevices\" => lambda {|n| @security_block_jailbroken_devices = n.get_boolean_value() },\n \"securityDisableUsbDebugging\" => lambda {|n| @security_disable_usb_debugging = n.get_boolean_value() },\n \"securityPreventInstallAppsFromUnknownSources\" => lambda {|n| @security_prevent_install_apps_from_unknown_sources = n.get_boolean_value() },\n \"securityRequireCompanyPortalAppIntegrity\" => lambda {|n| @security_require_company_portal_app_integrity = n.get_boolean_value() },\n \"securityRequireGooglePlayServices\" => lambda {|n| @security_require_google_play_services = n.get_boolean_value() },\n \"securityRequireSafetyNetAttestationBasicIntegrity\" => lambda {|n| @security_require_safety_net_attestation_basic_integrity = n.get_boolean_value() },\n \"securityRequireSafetyNetAttestationCertifiedDevice\" => lambda {|n| @security_require_safety_net_attestation_certified_device = n.get_boolean_value() },\n \"securityRequireUpToDateSecurityProviders\" => lambda {|n| @security_require_up_to_date_security_providers = n.get_boolean_value() },\n \"securityRequireVerifyApps\" => lambda {|n| @security_require_verify_apps = n.get_boolean_value() },\n \"storageRequireEncryption\" => lambda {|n| @storage_require_encryption = n.get_boolean_value() },\n })\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :username, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :password, :password_confirmation, :role) }\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :password, :password_confirmation, :current_password, :role) }\n end", "def sign_in\n trait\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :surname, :email, :role_id, :job_grade, :line_manager, :admin, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:first_name, :surname, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :surname, :email, :role_id, :line_manager, :admin, :password, :password_confirmation, :current_password) }\n\tend", "def authenticated_with_devise?(current_resource)\n devise_resource = notification_devise_resource\n unless current_resource.blank? or current_resource.is_a? devise_resource.class\n raise TypeError,\n \"Different type of current resource #{current_resource.class} \"\\\n \"with devise resource #{devise_resource.class} has been passed to #{self.class}##{__method__}. \"\\\n \"You have to override #{self.class}##{__method__} method or set devise_resource in acts_as_target.\"\n end\n current_resource.present? && current_resource == devise_resource\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in, keys: %i[login username password])\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[username email password password_confirmation])\n devise_parameter_sanitizer.permit(:account_update, keys: %i[username email password password_confirmation])\n end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def get_field_deserializers()\n return super.merge({\n \"appUserModelId\" => lambda {|n| @app_user_model_id = n.get_string_value() },\n })\n end", "def enable_devise_user(view)\n without_partial_double_verification do\n allow(view).to receive(:resource) { User.new }\n allow(view).to receive(:resource_class) { User }\n allow(view).to receive(:resource_name) { :user }\n allow(view).to receive(:devise_mapping) { Devise.mappings[:user] }\n end\n end", "def ldap_before_save\n self.email = Devise::LDAP::Adapter.get_ldap_param(self.username, \"mail\").first\n self.encrypted_password = Devise::LDAP::Adapter.get_ldap_param(self.username, \"userPassword\").first\n display_name = Devise::LDAP::Adapter.get_ldap_param(self.username, \"displayName\" )\n if display_name.present?\n display_name = display_name.first.split(' ')\n self.firstname = display_name[1]\n self.lastname = display_name.shift\n end\n end", "def save\n id and ensure_authentication and super\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :profile_photo, :job_type, :username, :email])\n devise_parameter_sanitizer.permit(:sign_in, keys: [:login, :password,:password_confirmation])\n # devise_parameter_sanitizer.permit(:account_update, keys: [:username, :email, :profile_photo, :password, :password_confirmation, :current_password, :mobile_number])\n end", "def before_save\n encrypt_secret\n super\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:dealer_code,\n :password,\n :password_confirmation,\n :remember_me) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:dealer_code,\n :password,\n :remember_me) }\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:settings, keys: [:timezone, :experimentation_email, :reflection_at_string, reflection_on: []])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username,:firstname,:lastname, :email, :study_agreement])\n devise_parameter_sanitizer.permit(:account_update, keys: [:firstname,:lastname, :email, :password, :password_confirmation,:timezone, :reflection_at, reflection_on: []])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:locale, :name, :email])\n # devise_parameter_sanitizer.permit(:sign_in, keys: [:locale]) n/n\n devise_parameter_sanitizer.permit(:account_update, keys: [:locale, :name, :email])\n # logger.info \"INFO: did > configure_permitted_parameters\"\n end", "def user_model\n self.class.user_model \n end", "def use_default_user_model def_model\n def_model\nend", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :fname, :lname, :username, :birthday, :image, :newsletter, :language) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :password, :fname, :lname, :username, :birthday, :image, :description, :phoneNumber, :facebook, :twitter, :googlePlus, :newsletter, :language) }\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :password, :remember_me) }\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:realname, :username, :email, :phone, :password, :password_confirmation, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:realname, :email, :phone, :password, :password_confirmation, :current_password) }\n end", "def configure_devise_permitted_parameters\n\t\tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[name username email password password_confirmation])\n\t\tdevise_parameter_sanitizer.permit(:sign_in, keys: %i[login password remember_me])\n\t\tdevise_parameter_sanitizer.permit(:account_update, keys: %i[name username email current_password password password_confirmation])\n\tend", "def authenticated?; super; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n end", "def configure_perimitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys:[:fname, :lname, :username, :seller])\n devise_parameter_sanitizer.permit(:account_update, keys:[:fname, :lname, :username, :seller])\n end", "def ensure_signed_up!\n # current_user\n end", "def before_save_hook\n execute_hooks_for(:before, :save)\n end", "def authentication_method\n super\n end" ]
[ "0.66721886", "0.6502948", "0.63222593", "0.62730604", "0.6130677", "0.6068753", "0.6025418", "0.60153186", "0.60153186", "0.60153186", "0.60072136", "0.58971494", "0.58386886", "0.57572865", "0.57572865", "0.5739815", "0.5698664", "0.5697451", "0.5694965", "0.5686829", "0.5668846", "0.56506205", "0.564083", "0.56354135", "0.5634792", "0.5604774", "0.5590977", "0.5574914", "0.5564565", "0.55633837", "0.55420834", "0.55418307", "0.55386853", "0.553784", "0.5527609", "0.5508592", "0.55071867", "0.5493432", "0.5437388", "0.5415542", "0.54106224", "0.53995055", "0.5390492", "0.5368074", "0.53602344", "0.53512746", "0.53439623", "0.53372324", "0.5334779", "0.533321", "0.5325153", "0.5320609", "0.5308436", "0.5308436", "0.52921", "0.52808315", "0.52679104", "0.52580124", "0.5251449", "0.52484745", "0.5246599", "0.5236401", "0.522986", "0.52261955", "0.52261955", "0.5220911", "0.5217499", "0.5216579", "0.5212448", "0.5208811", "0.52073616", "0.5206077", "0.5202489", "0.5186692", "0.5185192", "0.5179572", "0.51745987", "0.5172164", "0.5170508", "0.5170508", "0.5165273", "0.5163913", "0.51633966", "0.5155453", "0.515468", "0.51441187", "0.5141288", "0.513796", "0.51371497", "0.51339316", "0.51308405", "0.51274705", "0.51267725", "0.51230204", "0.51159155", "0.51152974", "0.5114944", "0.51111484", "0.5110958", "0.5110773" ]
0.7465398
0
Creates configuration values for Devise and for the given module. Devise::Models.config(Devise::Models::DatabaseAuthenticatable, :stretches) The line above creates: 1) An accessor called Devise.stretches, which value is used by default; 2) Some class methods for your model Model.stretches and Model.stretches= which have higher priority than Devise.stretches; 3) And an instance method stretches. To add the class methods you need to have a module ClassMethods defined inside the given class. source://devise//lib/devise/models.rb31
def config(mod, *accessors); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_setup\n [\n Project,\n Affiliate,\n Employee,\n EmployeeSession,\n Ldaper,\n User,\n UserSession,\n Company,\n Admin\n ].each do |model|\n unless model.respond_to?(:original_acts_as_authentic_config)\n model.class_attribute :original_acts_as_authentic_config\n end\n model.original_acts_as_authentic_config = model.acts_as_authentic_config\n end\n end", "def devise_modules_hook!; end", "def create_configurable_methods!\n return if self.class.methods_configured == true\n \n self.class.send(:alias_method, klass_name.demodulize.underscore.to_sym, :record)\n self.class.send(:attr_writer, login_field) if !respond_to?(\"#{login_field}=\")\n self.class.send(:attr_reader, login_field) if !respond_to?(login_field)\n self.class.send(:attr_writer, password_field) if !respond_to?(\"#{password_field}=\")\n self.class.send(:define_method, password_field) {} if !respond_to?(password_field)\n \n self.class.class_eval <<-\"end_eval\", __FILE__, __LINE__\n def #{login_field}_with_authentication_flag=(value)\n self.authenticating_with = :password\n self.#{login_field}_without_authentication_flag = value\n end\n alias_method_chain :#{login_field}=, :authentication_flag\n \n def #{password_field}_with_authentication_flag=(value)\n self.authenticating_with = :password\n self.#{password_field}_without_authentication_flag = value\n end\n alias_method_chain :#{password_field}=, :authentication_flag\n \n private\n # The password should not be accessible publicly. This way forms using form_for don't fill the password with the attempted password. The prevent this we just create this method that is private.\n def protected_#{password_field}\n @#{password_field}\n end\n end_eval\n \n self.class.methods_configured = true\n end", "def configure(&block)\n self.config = Config.new(self)\n config.instance_eval(&block)\n\n attr_accessor *config.accessors\n attr_reader *config.setters.keys\n\n config.setters.each do |name, definition|\n define_method(:\"#{name}=\", definition)\n end\n end", "def set_encryption_attributes\n @sorcery_config.encryption_provider.stretches = @sorcery_config.stretches if @sorcery_config.encryption_provider.respond_to?(:stretches) && @sorcery_config.stretches\n @sorcery_config.encryption_provider.join_token = @sorcery_config.salt_join_token if @sorcery_config.encryption_provider.respond_to?(:join_token) && @sorcery_config.salt_join_token\n @sorcery_config.encryption_provider.pepper = @sorcery_config.pepper if @sorcery_config.encryption_provider.respond_to?(:pepper) && @sorcery_config.pepper\n end", "def config\n Setting[klass_name]\n end", "def setup_config\n # To be Extended\n end", "def config\n\t\t\t@app_class.config\n\t\tend", "def enable_honeybadger(**config)\n Bundler.require(:honeybadger)\n Honeybadger.configure do |config_klass|\n config.each do |k, v|\n if k == :before_notify\n config_klass.send(k, v)\n else\n config_klass.send(:\"#{k}=\", v)\n end\n end\n end\n end", "def method_missing(method, *args)\n args.unshift(method.to_s)\n set_user_config args\n end", "def add_config_inheritance!\n class_eval do\n def self.inherited(subclass)\n subclass.class_eval do\n class << self\n attr_accessor :sorcery_config\n end\n end\n # Pass parent config to subclass\n subclass.sorcery_config = sorcery_config\n super\n end\n end\n end", "def configurations; end", "def method_missing(sym, *args, &block)\n if configuration.respond_to?(sym)\n configuration.send(sym, *args, &block)\n else\n super\n end\n end", "def method_missing(method_name, *arguments, &block)\n if Configuration.instance.respond_to?(method_name)\n Configuration.instance.public_send(method_name, *arguments, &block)\n else\n super\n end\n end", "def method_missing(method, *_args, &_block)\n @config.send(method)\n end", "def configure &block\n @config_helper = ConfigHelper.new(&block)\n end", "def set_config(config)\n\t\tend", "def configuration\n HungryForm.configuration.send(self.class.name.demodulize.underscore)\n end", "def configuration; end", "def configuration; end", "def configuration; end", "def configuration; end", "def configuration; end", "def add_config_options_to_initializer\n devise_initializer_path = \"config/initializers/devise.rb\"\n if File.exist?(devise_initializer_path)\n old_content = File.read(devise_initializer_path)\n\n if old_content.match(Regexp.new(/^\\s# ==> Configuration for :trialable\\n/))\n false\n else\n inject_into_file(devise_initializer_path, :before => \" # ==> Configuration for :confirmable\\n\") do\n<<-CONTENT\n # ==> Configuration for :trialable\n # The period a user can access the site without enrolling\n # config.trial_period = 60.days\n\nCONTENT\n end\n end\n end\n end", "def config\n\n end", "def extended( instance )\n \n super if defined?( super )\n \n configuration_modules.each { |this_member| instance.extend( this_member ) }\n \n end", "def format_class(klass, helper_config)\n @klass_config.delete(klass)\n @config[klass.to_s] = helper_config\n true\n end", "def install!\n @method_name ||= self.name.split('::').last.downcase.to_sym\n _cls = self # for self is obscured in define_method block's body\n ( class << Vendorificator::Config ; self ; end ).\n send(:define_method, @method_name ) do |name, *args, &block|\n mod = _cls.new(name.to_s, *args, &block)\n self[:modules] << mod\n mod\n end\n end", "def configure!\n begin\n configuration.apply!\n rescue NameError\n puts\n puts \"WARNING: #{$!.message}\"\n puts\n puts \"This happened while trying to configure Sparkly Authentication.\"\n puts \"You should verify that /config/initializers/sparkly_authentication.rb\"\n puts \"is set up properly. It could be that you just haven't created the\"\n puts \"model yet. If so, this error will disappear when the model exists.\"\n puts\n if ENV['AUTH_BACKTRACE']\n puts $!.backtrace\n else\n puts \"(Run with AUTH_BACKTRACE=true to see a full bactrace.)\"\n end\n puts\n end\n end", "def config\n yield self\n end", "def configure!\n raise(AlreadyConfiguredError, @configured_by) if already_configured?\n\n debug! if config.debug?\n\n configurators.each do |(group, block)|\n group group\n class_eval(&block)\n group nil\n end\n\n # Register metrics in adapters after evaluating all configuration blocks\n # to ensure that all global settings (like default tags) will be applied.\n adapters.each_value do |adapter|\n metrics.each_value do |metric|\n adapter.register!(metric)\n end\n end\n\n @configured_by = caller_locations(1, 1)[0].to_s\n end", "def configuration\n Stupidedi::Config.new.customize do |c|\n c.interchange.customize do |x|\n x.register(\"00401\") { Stupidedi::Versions::Interchanges::FourOhOne::InterchangeDef }\n end\n\n c.functional_group.customize do |x|\n x.register(\"004010\") { Stupidedi::Versions::FunctionalGroups::FortyTen::FunctionalGroupDef }\n end\n\n c.transaction_set.customize do |x|\n # Not using the barebone transaction set definition, as it doesn't have enough constraints to parse\n # the document with multiple levels of HL (not deterministic)\n # x.register(\"004010\", \"SH\", \"856\") { Stupidedi::Contrib::FortyTen::TransactionSetDefs::SH856 }\n \n # Modified the guide to include REF element for the Line Item HL\n x.register(\"004010\", \"SH\", \"856\") { Stupidedi::Contrib::FortyTen::Guides::SH856 }\n end\n end\n end", "def configure_force10_settings!\n delegate(provider, :configure_force10_settings!)\n end", "def method_missing(missing_method_name, *args, &block)\n if 'cfg' == missing_method_name.to_s\n self.config.settings\n else\n super\n end\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:nhs_number, :email, :password, :password_confirmation, :remember_me)\n end\n\n devise_parameter_sanitizer.for(:sign_in) do |u|\n u.permit(:login, :nhs_number, :email, :password, :remember_me)\n end\n\n devise_parameter_sanitizer.for(:account_update) do |u|\n u.permit(:login, :nhs_number, :email, :password, :password_confirmation, :current_password)\n end\n end", "def configure\n self.configuration ||= Configuration.new\n\n yield(configuration) if block_given?\n \n configuration.validate!\n\n setup if configuration.enabled?\n end", "def configure( &block )\n @class_method_map ||= {}\n Parametrization.patch!\n Parametrization::Config.instance_eval(&block)\n Parametrization::Config.resolve!\n Parametrization::Base.speciate!\n @configured = true\n end", "def configure_devise_permitted_parameters\n # We can't easily override here the internal Devise::RegistrionController used by the\n # Engine, because the engine is not namespaced.\n # So we have to resort to some tinkering right here:\n# DEBUG\n# logger.debug( \"\\r\\n\\r\\n!! =====[ #{self.class.name}: configure_devise_permitted_parameters ]====\" )\n# logger.debug( \"- resource...: \" << resource.inspect )\n# logger.debug( \"- PARAMS.....: \" << params.inspect )\n# logger.debug( \"- CTRL.......: \" << params[:controller] )\n# logger.debug( \"- ACTION.....: \" << params[:action] )\n\n # User new/create: do not allow any parameter if recaptcha fails:\n if (params[:controller].to_s == 'devise/registrations') &&\n ( (params[:action].to_s == 'new') || (params[:action].to_s == 'create') )\n# logger.debug( \"In devise/registrations...\" )\n\n if (params[:action].to_s == 'new') || (params[:action].to_s == 'create' && verify_recaptcha)\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(\n :email, :password, :password_confirmation,\n :name, :first_name, :last_name, :description, :year_of_birth\n )\n end\n flash[:error] = nil\n else\n flash[:error] = I18n.t('search_view.captcha_fail')\n end\n end\n\n # User edit/update:\n devise_parameter_sanitizer.permit(:account_update) do |user_params|\n user_params.permit(\n :email, :password, :password_confirmation,\n :name, :first_name, :last_name, :description, :year_of_birth\n )\n end\n end", "def devise_install(&block)\n if block_given?\n Devise.setup do |config|\n block.call config\n end\n end\n end", "def configuration\n provider.configuration\n end", "def configuration\n cfg = {}\n cfg[:author_avpair] = @author_avpair.name if (@author_avpair)\n cfg[:command_authorization_profile] = @command_authorization_profile.name if (@command_authorization_profile)\n cfg[:disabled] = self.disabled? if (self.disabled?)\n cfg[:enable_password] = @enable_password if (@enable_password)\n cfg[:enable_password_expires_on] = @enable_password_expires_on.to_s if (@enable_password_expires_on)\n cfg[:enable_password_lifespan] = @enable_password_lifespan if (@enable_password_lifespan != 0)\n cfg[:enable_acl] = @enable_acl.name if (@enable_acl)\n cfg[:encryption] = @encryption.to_s if (@encryption)\n cfg[:login_acl] = @login_acl.name if (@login_acl)\n cfg[:login_password] = @login_password if (@login_password)\n cfg[:login_password_expires_on] = @login_password_expires_on.to_s if (@login_password_expires_on)\n cfg[:login_password_lifespan] = @login_password_lifespan if (@login_password_lifespan != 0)\n cfg[:salt] = @salt if (@salt)\n cfg[:user_group] = @user_group.name if (@user_group)\n return(cfg)\n end", "def devise_parameter_sanitizer\n if resource_class == Host\n Host::ParameterSanitizer.new(Host, :host, params)\n else\n ParameterSanitizer.new(User, :user, params)\n # super # Use the default one\n end\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def add_included_hook\n attribute_proc = attribute_method(configuration)\n constructor = configuration.constructor\n mass_assignment = configuration.mass_assignment\n extensions = core_extensions\n inclusions = core_inclusions\n\n self.module.define_singleton_method :included do |object|\n super(object)\n extensions.each { |mod| object.extend(mod) }\n inclusions.each { |mod| object.send(:include, mod) }\n object.send(:include, Model::Constructor) if constructor\n object.send(:include, Model::MassAssignment) if mass_assignment\n object.send(:define_singleton_method, :attribute, attribute_proc)\n end\n end", "def module_config\n [\n ::GDO::DB::GDT_Boolean.new('login_tos').initial(\"0\"),\n ::GDO::Net::GDT_Url.new('login_tos_url').reachable.protocols('http','https'),\n ::GDO::DB::GDT_UInt.new('login_tries').min(\"0\").max(\"100\").initial(\"5\").bytes(2),\n ::GDO::Date::GDT_Duration.new('login_timeout').min(\"0\").initial(\"300\"),\n ::GDO::DB::GDT_Boolean.new('login_captcha').initial(\"0\"),\n ]\n end", "def get_config\n\t\tend", "def configure\n yield(config)\n end", "def retriable_configuration\n Take2::Configuration::CONFIG_ATTRS.each_with_object({}) do |key, hash|\n hash[key] = send(key)\n end\n end", "def config\n @_config ||= self.class.config.inheritable_copy\n end", "def config\n yield self\n end", "def config\n yield self\n end", "def config\n yield self\n end", "def config\n machined.config\n end", "def configure\n yield config\n end", "def configure\n yield config\n end", "def configure\n yield config\n end", "def configure\n yield configurable\n self\n end", "def configure_model\n configure base_uri: base_uri\n Ladder::Config.register_model self unless Ladder::Config.models.include? self\n end", "def configure\n yield config\n end", "def configure\n yield config\n end", "def configure_warden!; end", "def configure\n yield configuration\n configuration\n end", "def configure\n yield(config)\n end", "def munge_config\n @data = @config.send(:data).instance_variable_get(:@data)\n @data[:driver][:instance_name] = @image.id\n suite = @data[:suites].find{ |n| n[:name] == @image.name }\n if suite && suite[:inherit]\n inherited = Linecook::Image.new(suite[:inherit][:name], suite[:inherit][:group], suite[:inherit][:tag])\n inherit(inherited)\n @data[:driver][:image] = \"#{inherited.group}:#{inherited.tag}\"\n @data[:driver][:provision_command] ||= []\n @data[:driver][:provision_command] << 'sed -i \\'s/\\(PasswordAuthentication no\\)/#\\1/g\\' /etc/ssh/sshd_config'\n end\n end", "def devise_mappings; end", "def configure\n\t\t\tyield configuration\n\t\tend", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def method_missing(meth, *args, &blk)\n configuration.key?(meth.to_s) ? configuration.fetch(meth.to_s) : super\n end", "def method_missing(meth, *args, &blk)\n configuration.key?(meth.to_s) ? configuration.fetch(meth.to_s) : super\n end", "def initialize\n super\n Souffle::Config.merge!(config)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :surname, :email, :role_id, :job_grade, :line_manager, :admin, :password, :password_confirmation) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:first_name, :surname, :email, :password, :remember_me) }\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :surname, :email, :role_id, :line_manager, :admin, :password, :password_confirmation, :current_password) }\n\tend", "def configure\n yield(config)\n config\n end", "def config\n ModelApi.config\n end", "def initialize(**options)\n @mod = Module.new\n @config = Avromatic::Model::Configuration.new(**options)\n define_included_method\n end", "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end", "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end", "def config\n Wrangler::ExceptionHandler.config\n end", "def included(klass)\n set_config_defaults\n\n klass.class_eval do\n include ::Collapsium::Config\n end\n end", "def method_missing(name, *args)\n @config.respond_to?(name) ? @config.send(name, *args) : super\n end", "def define_reflection_methods\n\n # *_class_name, *_class, *_table_name methods for all classes\n @config.classes.to_h.each do |class_type,class_name|\n class_type_name = class_type.to_s.gsub(/_class$/,'').singularize\n class_eval do\n \n # def CLASS_TYPE_class_name\n define_method \"#{class_type_name}_class_name\" do\n if @config.send(class_type).is_a?(Class)\n @config.send(class_type).name\n else\n @config.send(class_type).to_s.camelize\n end\n end\n alias_method \"#{class_type_name.pluralize}_class_name\", \"#{class_type_name}_class_name\"\n \n # def CLASS_TYPE_class\n define_method \"#{class_type_name}_class\" do\n \"::#{send(\"#{class_type_name}_class_name\")}\".constantize\n end\n alias_method \"#{class_type_name.pluralize}_class\", \"#{class_type_name}_class\"\n\n # def CLASS_TYPE_table_name\n define_method \"#{class_type_name}_table_name\" do\n send(\"#{class_type_name}_class\").table_name\n end\n alias_method \"#{class_type_name.pluralize}_table_name\", \"#{class_type_name}_table_name\"\n\n # def CLASS_TYPE_singular_key (used primarily for associations)\n define_method \"#{class_type_name}_singular_key\" do\n send(\"#{class_type_name}_class_name\").underscore.split(\"/\").last.singularize.to_sym\n end\n alias_method \"#{class_type_name.pluralize}_singular_key\", \"#{class_type_name}_singular_key\"\n\n # def CLASS_TYPE_plural_key (use primarily for associations)\n define_method \"#{class_type_name}_plural_key\" do\n send(\"#{class_type_name}_class_name\").underscore.split(\"/\").last.pluralize.to_sym\n end\n alias_method \"#{class_type_name.pluralize}_plural_key\", \"#{class_type_name}_plural_key\"\n \n # These define aliases for custom class names, like user_class and user_table_name aliased to subject_class and subject_table_name\n unless class_type.to_s.underscore == \"#{class_name.to_s.underscore}_class\"\n %w(_class_name _class _table_name _singular_key _plural_key).each do |suffix|\n alias_method \"#{class_name.to_s.underscore.singularize}#{suffix}\", \"#{class_type_name}#{suffix}\"\n alias_method \"#{class_name.to_s.underscore.pluralize}#{suffix}\", \"#{class_name.to_s.underscore.singularize}#{suffix}\"\n end\n end\n \n end\n end\n\n # *_foreign_key method for primary classes\n @config.primary_classes.to_h.each do |class_type,class_name|\n class_type_name = class_type.to_s.gsub(/_class$/,'').singularize\n class_eval do\n # def CLASS_TYPE_foreign_key\n define_method \"#{class_type_name}_foreign_key\" do\n # This is hideous, but we need some sort of fallback for cases like Rails 4 Heroku deploys where the environment and\n # database are not available.\n begin\n \"#{send(\"#{class_type_name}_table_name\").singularize}_#{send(\"#{class_type_name}_class\").primary_key}\"\n rescue\n \"#{send(\"#{class_type_name}_table_name\").singularize}_id\"\n end\n end\n alias_method \"#{class_type.to_s.gsub(/_class$/,\"\").pluralize}_foreign_key\", \"#{class_type.to_s.gsub(/_class$/,\"\").singularize}_foreign_key\"\n \n unless class_type.to_s.underscore == \"#{class_name.to_s.underscore}_class\"\n alias_method \"#{class_name.to_s.underscore.singularize}_foreign_key\", \"#{class_type.to_s.gsub(/_class$/,\"\").singularize}_foreign_key\" # CLASS_NAME_foreign_key\n alias_method \"#{class_name.to_s.underscore.pluralize}_foreign_key\", \"#{class_name.to_s.underscore.singularize}_foreign_key\"\n end\n end\n end\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def configure\n yield configuration\n end", "def install_configure_in(base)\n base.instance_eval <<-EOF\n # Configuration class for host module\n #\n #{base.name}::Configuration = Class.new(Configurations::Configuration)\n\n # The central configure method\n # @params [Proc] block the block to configure host module with\n # @raise [ArgumentError] error when not given a block\n # @example Configure a configuration\n # MyGem.configure do |c|\n # c.foo = :bar\n # end\n #\n def self.configure(&block)\n semaphore.synchronize do\n fail ArgumentError, \"configure needs a block\" unless block_given?\n include_configuration_type!(#{base.name}::Configuration)\n\n set_configuration!(&block)\n end\n end\n\n # A reader for Configuration\n #\n def configuration\n semaphore.synchronize do\n return @configuration if @configuration\n\n if @configuration_defaults\n include_configuration_type!(#{base.name}::Configuration)\n set_configuration! { }\n end\n end\n end\n\n\n private\n\n # Sets the configuration instance variable\n #\n def self.set_configuration!(&block)\n @configuration = #{base.name}::Configuration.__new__(\n configuration_options,\n &block\n )\n end\n\n @semaphore = Mutex.new\n def self.semaphore\n @semaphore\n end\n\n EOF\n end", "def configuration\n @config ||= setup\n end", "def config\n Troy.configuration\n end", "def config\n @config = ActiveSupport::HashWithIndifferentAccess.new(@config) if @config.is_a? Hash\n @config\n end", "def included(base)\n install_configure_in(base)\n base.instance_eval do\n extend ClassMethods\n\n # call configuration_mutex once to initialize the value\n #\n initialize_configuration!\n end\n end", "def included(base)\n install_configure_in(base)\n base.instance_eval do\n extend ClassMethods\n\n # call configuration_mutex once to initialize the value\n #\n initialize_configuration!\n end\n end", "def blacklight_config\n @blacklight_config ||= begin\n # Create a new config based on the defaults\n config = default_blacklight_config.inheritable_copy(self.class)\n\n config.current_exhibit = exhibit\n\n config.document_presenter_class = lambda do |context|\n if context.action_name == 'index'\n config.index.document_presenter_class\n else\n config.show.document_presenter_class\n end\n end\n\n config.show.merge! show if show.present?\n config.index.merge! index if index.present?\n config.index.respond_to[:iiif_json] = true\n\n config.index.thumbnail_field ||= Spotlight::Engine.config.thumbnail_field\n\n config.add_results_collection_tool 'curator_actions', if: :render_curator_actions?\n\n unless config.curator_actions\n config.curator_actions ||= Blacklight::NestedOpenStructWithHashAccess.new(Blacklight::Configuration::ToolConfig)\n config.curator_actions.save_search!\n config.curator_actions.bulk_actions!\n end\n\n unless config.bulk_actions\n config.bulk_actions ||= Blacklight::NestedOpenStructWithHashAccess.new(Blacklight::Configuration::ToolConfig)\n\n config.bulk_actions.change_visibility!\n config.bulk_actions.add_tags!\n config.bulk_actions.remove_tags!\n end\n\n config.default_solr_params = config.default_solr_params.merge(default_solr_params)\n\n config.default_per_page = default_per_page if default_per_page\n\n config.view.embed!\n config.view.embed.partials ||= ['openseadragon']\n config.view.embed.if = false\n config.view.embed.locals ||= { osd_container_class: '' }\n\n # Add any custom fields\n config.index_fields.merge! custom_index_fields(config)\n config.index_fields.reject! { |_k, v| v.if == false }\n\n # Update with customizations\n config.index_fields.each do |k, v|\n v.original = v.dup\n if index_fields[k]\n v.merge! index_fields[k].symbolize_keys\n elsif v.custom_field\n set_custom_field_defaults(v)\n else\n set_index_field_defaults(v)\n end\n\n v.immutable = Blacklight::OpenStructWithHashAccess.new(v.immutable)\n v.merge! v.immutable.to_h.symbolize_keys\n\n v.if = :field_enabled? unless v.if == false\n\n v.normalize! config\n v.validate!\n end\n\n config.show_fields.reject! { |_k, v| v.if == false }\n\n config.show_fields.reject { |k, _v| config.index_fields[k] }.each do |k, v|\n v.original = v.dup\n config.index_fields[k] = v\n\n if index_fields[k]\n v.merge! index_fields[k].symbolize_keys\n else\n set_show_field_defaults(v)\n end\n\n v.immutable = Blacklight::OpenStructWithHashAccess.new(v.immutable)\n v.merge! v.immutable.to_h.symbolize_keys\n\n v.if = :field_enabled? unless v.if == false\n\n v.normalize! config\n v.validate!\n end\n\n ##\n # Sort after the show fields have also been added\n config.index_fields = Hash[config.index_fields.sort_by { |k, _v| field_weight(index_fields, k) }]\n\n config.show_fields = config.index_fields\n\n config.search_fields.merge! custom_search_fields(config)\n if search_fields.present?\n config.search_fields = Hash[config.search_fields.sort_by { |k, _v| field_weight(search_fields, k) }]\n\n config.search_fields.each do |k, v|\n v.original = v.dup\n v.if = :field_enabled? unless v.if == false\n next if search_fields[k].blank?\n\n v.merge! search_fields[k].symbolize_keys\n v.normalize! config\n v.validate!\n end\n end\n\n if sort_fields.present?\n config.sort_fields = Hash[config.sort_fields.sort_by { |k, _v| field_weight(sort_fields, k) }]\n\n config.sort_fields.each do |k, v|\n v.original = v.dup\n v.if = :field_enabled? unless v.if == false\n next if sort_fields[k].blank?\n\n v.merge! sort_fields[k].symbolize_keys\n v.normalize! config\n v.validate!\n end\n end\n\n config.facet_fields.merge! custom_facet_fields\n if facet_fields.present?\n config.facet_fields = Hash[config.facet_fields.sort_by { |k, _v| field_weight(facet_fields, k) }]\n\n config.facet_fields.each do |k, v|\n v.original = v.dup unless v.custom_field\n next if facet_fields[k].blank?\n\n v.merge! facet_fields[k].symbolize_keys\n v.enabled = v.show\n v.if = :field_enabled? unless v.if == false\n v.normalize! config\n v.validate!\n end\n end\n\n config.per_page = (config.per_page & per_page) if per_page.present?\n\n if document_index_view_types.present?\n config.view.each do |k, v|\n v.original = v.dup\n v.key = k\n v.if = :enabled_in_spotlight_view_type_configuration? unless v.if == false\n end\n end\n\n if config.search_fields.blank?\n config.navbar.partials[:saved_searches].if = false if config.navbar.partials.key? :saved_searches\n config.navbar.partials[:search_history].if = false if config.navbar.partials.key? :search_history\n end\n\n config\n end\n end", "def config; end", "def config; end" ]
[ "0.6104608", "0.55268943", "0.5508198", "0.54230964", "0.5134628", "0.51155233", "0.50748897", "0.50601983", "0.50557953", "0.5049194", "0.5031976", "0.5007836", "0.49720958", "0.49681893", "0.49612817", "0.4950117", "0.49405015", "0.49391896", "0.4930056", "0.4930056", "0.4930056", "0.4930056", "0.4930056", "0.49216035", "0.49116385", "0.4904082", "0.4891149", "0.48706812", "0.48482576", "0.48370555", "0.48291495", "0.48077098", "0.480138", "0.47967553", "0.47963077", "0.47919813", "0.47834405", "0.47824502", "0.4777974", "0.47680825", "0.47667402", "0.4760399", "0.4758372", "0.4758372", "0.4755343", "0.475405", "0.4749459", "0.47472942", "0.47460634", "0.47454834", "0.4743954", "0.4743954", "0.4743954", "0.47384202", "0.47304875", "0.47304875", "0.47304875", "0.47211328", "0.4720766", "0.47142473", "0.47142473", "0.47140923", "0.4710927", "0.47093773", "0.4708152", "0.47080305", "0.4704395", "0.46809816", "0.46809816", "0.46809816", "0.46809816", "0.46809816", "0.46809816", "0.46809816", "0.46747905", "0.46747905", "0.46705317", "0.46655506", "0.46650222", "0.46629775", "0.46608424", "0.4651573", "0.4651573", "0.46463883", "0.46435484", "0.46396863", "0.46322188", "0.4627878", "0.4627878", "0.4627878", "0.4627878", "0.4623273", "0.46220827", "0.46199498", "0.46168685", "0.46137172", "0.46137172", "0.46131214", "0.46112043", "0.46112043" ]
0.5426884
3
Redefine inspect using serializable_hash, to ensure we don't accidentally leak passwords into exceptions. source://devise//lib/devise/models/authenticatable.rb124
def inspect; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inspect\n inspected = super\n inspected.gsub! @password, '*******' if @password\n end", "def inspect\n inspection = serializable_hash.collect do |k,v|\n \"#{k}: #{respond_to?(:attribute_for_inspect) ? attribute_for_inspect(k) : v.inspect}\"\n end\n \"#<#{self.class} #{inspection.join(\", \")}>\"\n end", "def inspect\n inspected = super\n\n inspected.gsub! @password, \"*******\" if @password\n inspected.gsub! @token, \"*******\" if @token\n\n inspected\n end", "def inspect\n str = instance_variables.map do |iv|\n if iv == '@password'\n \"#{iv}=[FILTERED]\"\n else\n \"#{iv}=#{instance_variable_get(iv).inspect}\"\n end\n end.join(', ')\n\n \"#<#{self.class}:0x#{(object_id * 2).to_s(16)} #{str}>\"\n end", "def to_h\n super.select {|k, v| k != 'hashed_password'}\n end", "def inspect\n variables = instance_variables.reject { |v| v == :@password }.map { |v| \" #{v}=#{instance_variable_get(v)}\" }\n\n ::Kernel.instance_method(:to_s).bind(self).call.sub('>', \"#{variables.join(',')}>\")\n end", "def inspect\n inspected = super\n\n # mask password\n inspected = inspected.gsub! @password, \"*******\" if @password\n # Only show last 4 of token, secret\n if @access_token\n inspected = inspected.gsub! @access_token, \"#{'*'*36}#{@access_token[36..-1]}\"\n end\n if @client_secret\n inspected = inspected.gsub! @client_secret, \"#{'*'*36}#{@client_secret[36..-1]}\"\n end\n\n inspected\n end", "def inspect\n inspected = super\n\n # mask password\n inspected = inspected.gsub! @password, \"*******\" if @password\n # Only show last 4 of token, secret\n if @access_token\n inspected = inspected.gsub! @access_token, \"#{'*'*36}#{@access_token[36..-1]}\"\n end\n if @client_secret\n inspected = inspected.gsub! @client_secret, \"#{'*'*36}#{@client_secret[36..-1]}\"\n end\n\n inspected\n end", "def inspect\n inspected = super\n\n # mask password\n inspected = inspected.gsub! @password, \"*******\" if @password\n # Only show last 4 of token, secret\n if @access_token\n inspected = inspected.gsub! @access_token, \"#{'*'*36}#{@access_token[36..-1]}\"\n end\n\n inspected\n end", "def to_h\n super.select {|k, v| k != 'hashed_password'}\n end", "def to_s\n hide_password(fetch.dup).to_yaml\n end", "def get_field_deserializers()\n return super.merge({\n \"password\" => lambda {|n| @password = n.get_string_value() },\n \"pkcs12Value\" => lambda {|n| @pkcs12_value = n.get_string_value() },\n })\n end", "def serializable_hash (options={})\n options = {\n except: [:password_digest],\n methods: [:url]\n \n }.update(options)\n\n super(options)\n end", "def serializable_hash(options = {})\n pre_sanitized_hash = super({\n :only => [:id, :name, :email]\n }.merge(options))\n\n # Sanitize\n pre_sanitized_hash.merge({\n \"name\" => Rack::Utils.escape_html(self.name),\n \"email\" => Rack::Utils.escape_html(self.email)\n })\n end", "def inspect\n @hash.inspect\n end", "def print_hash_values hash\n puts hash unless hash.is_a? Hash\n hash.each do |k, v|\n if v.is_a? Hash\n puts \"User:\".yellow + \" #{k}\"\n print_hash_values v\n else\n if k == 'password'\n puts \"#{k.yellow}: ** HIDDEN **\"\n else\n puts \"#{k.yellow}: #{v}\\n\" unless v.nil?\n end\n end\n end\n end", "def inspect # :nodoc:\n mystr = super()\n mystr.gsub!(/(.)pass=.*?([,\\}])/,\"\\\\1pass=<hidden>\\\\2\")\n mystr\n end", "def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end", "def get_field_deserializers()\n return super.merge({\n \"passwordBlockFingerprintUnlock\" => lambda {|n| @password_block_fingerprint_unlock = n.get_boolean_value() },\n \"passwordBlockTrustAgents\" => lambda {|n| @password_block_trust_agents = n.get_boolean_value() },\n \"passwordExpirationDays\" => lambda {|n| @password_expiration_days = n.get_number_value() },\n \"passwordMinimumLength\" => lambda {|n| @password_minimum_length = n.get_number_value() },\n \"passwordMinutesOfInactivityBeforeScreenTimeout\" => lambda {|n| @password_minutes_of_inactivity_before_screen_timeout = n.get_number_value() },\n \"passwordPreviousPasswordBlockCount\" => lambda {|n| @password_previous_password_block_count = n.get_number_value() },\n \"passwordRequiredType\" => lambda {|n| @password_required_type = n.get_enum_value(MicrosoftGraph::Models::AndroidWorkProfileRequiredPasswordType) },\n \"passwordSignInFailureCountBeforeFactoryReset\" => lambda {|n| @password_sign_in_failure_count_before_factory_reset = n.get_number_value() },\n \"securityRequireVerifyApps\" => lambda {|n| @security_require_verify_apps = n.get_boolean_value() },\n \"workProfileBlockAddingAccounts\" => lambda {|n| @work_profile_block_adding_accounts = n.get_boolean_value() },\n \"workProfileBlockCamera\" => lambda {|n| @work_profile_block_camera = n.get_boolean_value() },\n \"workProfileBlockCrossProfileCallerId\" => lambda {|n| @work_profile_block_cross_profile_caller_id = n.get_boolean_value() },\n \"workProfileBlockCrossProfileContactsSearch\" => lambda {|n| @work_profile_block_cross_profile_contacts_search = n.get_boolean_value() },\n \"workProfileBlockCrossProfileCopyPaste\" => lambda {|n| @work_profile_block_cross_profile_copy_paste = n.get_boolean_value() },\n \"workProfileBlockNotificationsWhileDeviceLocked\" => lambda {|n| @work_profile_block_notifications_while_device_locked = n.get_boolean_value() },\n \"workProfileBlockScreenCapture\" => lambda {|n| @work_profile_block_screen_capture = n.get_boolean_value() },\n \"workProfileBluetoothEnableContactSharing\" => lambda {|n| @work_profile_bluetooth_enable_contact_sharing = n.get_boolean_value() },\n \"workProfileDataSharingType\" => lambda {|n| @work_profile_data_sharing_type = n.get_enum_value(MicrosoftGraph::Models::AndroidWorkProfileCrossProfileDataSharingType) },\n \"workProfileDefaultAppPermissionPolicy\" => lambda {|n| @work_profile_default_app_permission_policy = n.get_enum_value(MicrosoftGraph::Models::AndroidWorkProfileDefaultAppPermissionPolicyType) },\n \"workProfilePasswordBlockFingerprintUnlock\" => lambda {|n| @work_profile_password_block_fingerprint_unlock = n.get_boolean_value() },\n \"workProfilePasswordBlockTrustAgents\" => lambda {|n| @work_profile_password_block_trust_agents = n.get_boolean_value() },\n \"workProfilePasswordExpirationDays\" => lambda {|n| @work_profile_password_expiration_days = n.get_number_value() },\n \"workProfilePasswordMinLetterCharacters\" => lambda {|n| @work_profile_password_min_letter_characters = n.get_number_value() },\n \"workProfilePasswordMinLowerCaseCharacters\" => lambda {|n| @work_profile_password_min_lower_case_characters = n.get_number_value() },\n \"workProfilePasswordMinNonLetterCharacters\" => lambda {|n| @work_profile_password_min_non_letter_characters = n.get_number_value() },\n \"workProfilePasswordMinNumericCharacters\" => lambda {|n| @work_profile_password_min_numeric_characters = n.get_number_value() },\n \"workProfilePasswordMinSymbolCharacters\" => lambda {|n| @work_profile_password_min_symbol_characters = n.get_number_value() },\n \"workProfilePasswordMinUpperCaseCharacters\" => lambda {|n| @work_profile_password_min_upper_case_characters = n.get_number_value() },\n \"workProfilePasswordMinimumLength\" => lambda {|n| @work_profile_password_minimum_length = n.get_number_value() },\n \"workProfilePasswordMinutesOfInactivityBeforeScreenTimeout\" => lambda {|n| @work_profile_password_minutes_of_inactivity_before_screen_timeout = n.get_number_value() },\n \"workProfilePasswordPreviousPasswordBlockCount\" => lambda {|n| @work_profile_password_previous_password_block_count = n.get_number_value() },\n \"workProfilePasswordRequiredType\" => lambda {|n| @work_profile_password_required_type = n.get_enum_value(MicrosoftGraph::Models::AndroidWorkProfileRequiredPasswordType) },\n \"workProfilePasswordSignInFailureCountBeforeFactoryReset\" => lambda {|n| @work_profile_password_sign_in_failure_count_before_factory_reset = n.get_number_value() },\n \"workProfileRequirePassword\" => lambda {|n| @work_profile_require_password = n.get_boolean_value() },\n })\n end", "def inspect\n deep_hash.inspect\n end", "def inspect\n \"#<#{self.class}:#{object_id} to_hash=#{to_hash.inspect}>\"\n end", "def serializable_hash(options={})\n options[:except] ||= [ :password, :email,:encrypted_password, :salt]\n options[:methods] ||= [ :image_url ]\n super options\n end", "def inspect\n redacted_string(:inspect)\n end", "def inspect\n redacted_string(:inspect)\n end", "def to_s\n %[#<password safe>]\n end", "def to_s\n %[#<password safe>]\n end", "def strip_hash( hash, cloned=true )\n\t\tnewhash = cloned ? hash.dup : hash\n\t\tnewhash.default = nil if newhash.default_proc\n\t\tnewhash.each_key {|key|\n\t\t\tcase newhash[ key ]\n\t\t\twhen Hash\n\t\t\t\tnewhash[ key ] = strip_hash( newhash[key], false )\n\n\t\t\twhen Proc, Method, UnboundMethod, IO\n\t\t\t\tself.log.warning \"Stripping unserializable object from session \" \\\n\t\t\t\t\t\"hash: %p\" % newhash[ key ]\n\t\t\t\tnewhash[ key ] = \"[Can't serialize a %s]\" % newhash[ key ].class\n\t\t\tend\n\t\t}\n\n\t\treturn newhash\n\tend", "def inspect\n @hash.inspect\n end", "def inspect\n inspected = super\n\n # Only show last 4 of token, secret\n if @access_token\n inspected = inspected.gsub! @access_token, \"#{'*'*8}#{@access_token[8..-1]}\"\n end\n if @consumer_secret\n inspected = inspected.gsub! @consumer_secret, \"#{'*'*8}#{@consumer_secret[8..-1]}\"\n end\n\n inspected\n end", "def get_field_deserializers()\n return super.merge({\n \"bitLockerEnabled\" => lambda {|n| @bit_locker_enabled = n.get_boolean_value() },\n \"codeIntegrityEnabled\" => lambda {|n| @code_integrity_enabled = n.get_boolean_value() },\n \"earlyLaunchAntiMalwareDriverEnabled\" => lambda {|n| @early_launch_anti_malware_driver_enabled = n.get_boolean_value() },\n \"osMaximumVersion\" => lambda {|n| @os_maximum_version = n.get_string_value() },\n \"osMinimumVersion\" => lambda {|n| @os_minimum_version = n.get_string_value() },\n \"passwordBlockSimple\" => lambda {|n| @password_block_simple = n.get_boolean_value() },\n \"passwordExpirationDays\" => lambda {|n| @password_expiration_days = n.get_number_value() },\n \"passwordMinimumCharacterSetCount\" => lambda {|n| @password_minimum_character_set_count = n.get_number_value() },\n \"passwordMinimumLength\" => lambda {|n| @password_minimum_length = n.get_number_value() },\n \"passwordMinutesOfInactivityBeforeLock\" => lambda {|n| @password_minutes_of_inactivity_before_lock = n.get_number_value() },\n \"passwordPreviousPasswordBlockCount\" => lambda {|n| @password_previous_password_block_count = n.get_number_value() },\n \"passwordRequireToUnlockFromIdle\" => lambda {|n| @password_require_to_unlock_from_idle = n.get_boolean_value() },\n \"passwordRequired\" => lambda {|n| @password_required = n.get_boolean_value() },\n \"passwordRequiredType\" => lambda {|n| @password_required_type = n.get_enum_value(MicrosoftGraph::Models::RequiredPasswordType) },\n \"secureBootEnabled\" => lambda {|n| @secure_boot_enabled = n.get_boolean_value() },\n \"storageRequireEncryption\" => lambda {|n| @storage_require_encryption = n.get_boolean_value() },\n })\n end", "def inspect\n self._inspect({})\n end", "def inspect\n \"#<Fernet::Verifier @secret=[masked] @token=#{@token} @message=#{@message.inspect} @ttl=#{@ttl} @enforce_ttl=#{@enforce_ttl}>\"\n end", "def inspect\n to_hash.to_s\n end", "def inspect\n to_hash.to_s\n end", "def inspect_attributes\n %i[uuid name type slug status email]\n end", "def serializable_hash(options = {})\n pre_sanitized_hash = super({\n :only => [:id, :name, :hex_colour]\n }.merge(options))\n\n # Sanitize\n pre_sanitized_hash.merge({\n \"name\" => Rack::Utils.escape_html(self.name)\n })\n end", "def inspect\n self.to_hash.inspect\n end", "def password_digest\n BCrypt::Password.new(super)\n end", "def as_json(options = {})\n super(options.merge({ except: :password_digest }))\n end", "def inspect!\n warn(inspect)\n end", "def inspect!\n warn(inspect)\n end", "def serializable_hash(opts = {})\n options = {\n :only => [:id, :email, :account_id, :firstname, :lastname, :biography]\n }.update(opts)\n super(options)\n end", "def get_field_deserializers()\n return super.merge({\n \"deviceThreatProtectionEnabled\" => lambda {|n| @device_threat_protection_enabled = n.get_boolean_value() },\n \"deviceThreatProtectionRequiredSecurityLevel\" => lambda {|n| @device_threat_protection_required_security_level = n.get_enum_value(MicrosoftGraph::Models::DeviceThreatProtectionLevel) },\n \"minAndroidSecurityPatchLevel\" => lambda {|n| @min_android_security_patch_level = n.get_string_value() },\n \"osMaximumVersion\" => lambda {|n| @os_maximum_version = n.get_string_value() },\n \"osMinimumVersion\" => lambda {|n| @os_minimum_version = n.get_string_value() },\n \"passwordExpirationDays\" => lambda {|n| @password_expiration_days = n.get_number_value() },\n \"passwordMinimumLength\" => lambda {|n| @password_minimum_length = n.get_number_value() },\n \"passwordMinutesOfInactivityBeforeLock\" => lambda {|n| @password_minutes_of_inactivity_before_lock = n.get_number_value() },\n \"passwordPreviousPasswordBlockCount\" => lambda {|n| @password_previous_password_block_count = n.get_number_value() },\n \"passwordRequired\" => lambda {|n| @password_required = n.get_boolean_value() },\n \"passwordRequiredType\" => lambda {|n| @password_required_type = n.get_enum_value(MicrosoftGraph::Models::AndroidRequiredPasswordType) },\n \"securityBlockJailbrokenDevices\" => lambda {|n| @security_block_jailbroken_devices = n.get_boolean_value() },\n \"securityDisableUsbDebugging\" => lambda {|n| @security_disable_usb_debugging = n.get_boolean_value() },\n \"securityPreventInstallAppsFromUnknownSources\" => lambda {|n| @security_prevent_install_apps_from_unknown_sources = n.get_boolean_value() },\n \"securityRequireCompanyPortalAppIntegrity\" => lambda {|n| @security_require_company_portal_app_integrity = n.get_boolean_value() },\n \"securityRequireGooglePlayServices\" => lambda {|n| @security_require_google_play_services = n.get_boolean_value() },\n \"securityRequireSafetyNetAttestationBasicIntegrity\" => lambda {|n| @security_require_safety_net_attestation_basic_integrity = n.get_boolean_value() },\n \"securityRequireSafetyNetAttestationCertifiedDevice\" => lambda {|n| @security_require_safety_net_attestation_certified_device = n.get_boolean_value() },\n \"securityRequireUpToDateSecurityProviders\" => lambda {|n| @security_require_up_to_date_security_providers = n.get_boolean_value() },\n \"securityRequireVerifyApps\" => lambda {|n| @security_require_verify_apps = n.get_boolean_value() },\n \"storageRequireEncryption\" => lambda {|n| @storage_require_encryption = n.get_boolean_value() },\n })\n end", "def devise_parameter_sanitizer; end", "def dump_hash(hash, context = CoderContext.new)\n # Symbolizing keys to unlock **intepolation\n ObjectDumper.dump(hash, context).symbolize_keys\n end", "def attributes\n sanitized_values = self.to_h.dup\n sanitized_values[:access_token] = 'REDACTED'\n sanitized_values[:issuer] = self.issuer\n sanitized_values\n end", "def inspect()\n serialize.to_s()\n end", "def inspect()\n serialize.to_s()\n end", "def fattr_inspect\n to_hash.inspect\n end", "def symbolize_password_keys!(authentications)\n auth_type = authentications.keys.first\n # symbolize userid, password\n authentications[auth_type].symbolize_keys!\n\n return authentications, auth_type\n end", "def as_json(options = {})\n\t\tsuper(options.merge({except: [:password_digest]}))\n\tend", "def password\n return self[:password]\n end", "def save_auth_hash_to_session(provider)\n # Save the auth hash without raw info\n session[\"devise.#{provider}_data\"] = auth_hash.reject { |key| key.to_sym == :raw_info }\n end", "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end", "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end", "def password_protected\n @attributes[:password_protected]\n end", "def fetchable_fields\n super - [:password, :password_confirmation]\n # if (context[:current_user].guest)\n # super - [:email]\n # else\n # super\n # end\n end", "def to_json(options={})\n options[:except] ||= [:password_digest]\n super(options)\n end", "def inspect\n inspection =\n self.class.fields.keys.collect { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.join(\", \")\n\n \"#<#{self.class} #{inspection}>\"\n end", "def inspect\n \"#{self.name}, #{self.email}, #{self.age}\"\n end", "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Oauth.V1.UserInfoInstance #{values}>\"\n end", "def decode_credentials; end", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def inspect\n \"#<FlashHash @values=#{values.inspect} @cache=#{cache.inspect}>\"\n end", "def password\n \t\t return password_virtual_attr\n end", "def inspect\n\t\t\tmodel_inspect = super\n\t\t\ta = dynamic_attributes_fields.keys.map { |attr| \"#{attr}: #{self[attr].inspect || 'nil'}\" }\n\t\t\tdynamic_inspect = a.join(', ')\n\t\t\t\"#{model_inspect[0..-2]} || #{dynamic_inspect}>\"\n\t\tend", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:id, :password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count,\n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:id, :password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count, \n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def serialize(hash)\n hash.inspect\n end", "def to_json(options={})\n\t\toptions[:except] ||= [:hashed_password, :salt]\n\t\tsuper(options)\n end", "def inspect() \"~#{@obj.inspect}~\" ; end", "def inspect\n inspection = self.info.keys.map { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.compact.join(\", \")\n \"#<#{self.class}:0x#{self.object_id.to_s(16)} #{inspection}>\"\n end", "def as_json(options = nil)\n json = super(options)\n json.delete 'password'\n json.delete 'password_digest'\n json\n end", "def get_field_deserializers()\n return super.merge({\n \"loginName\" => lambda {|n| @login_name = n.get_string_value() },\n })\n end", "def before_save\n super\n unless(self.values[:credentials])\n self.values[:credentials] = {}\n end\n random_sec = 3.times.map{ SecureRandom.urlsafe_base64 }.join\n self.user.run_state.random_sec = random_sec\n self.credentials = Utils::Cipher.encrypt(\n JSON.dump(self[:credentials]),\n :key => [\n SALTER,\n self.user.username,\n self.user.run_state.random_sec\n ].join(SALTER_JOINER),\n :iv => self.user.run_state.random_sec\n )\n self.extras = Sequel.pg_json(self.extras)\n self.infos = Sequel.pg_json(self.infos)\n if(password)\n self.password_digest = checksum(password)\n end\n end", "def inspect\n \"<User username=#{@username} id=#{@id} discriminator=#{@discriminator}>\"\n end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def inspect; to_s; end", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count, \n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def imported_password_hash\n @attributes[:imported_password_hash]\n end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect() end", "def inspect\n '#<FlashHash @values=%s @cache=%s>' % [values.inspect, cache.inspect]\n end", "def inspectable?; true; end" ]
[ "0.6759818", "0.6555846", "0.6528037", "0.649177", "0.64875275", "0.6479564", "0.64795583", "0.64795583", "0.64664364", "0.6395847", "0.60975415", "0.60969543", "0.59869015", "0.5884381", "0.5821079", "0.58077705", "0.5797657", "0.57793945", "0.5778903", "0.5762275", "0.5741444", "0.5732009", "0.57015187", "0.57015187", "0.56970763", "0.56970763", "0.565337", "0.5652519", "0.5614307", "0.5604721", "0.55771637", "0.5550913", "0.5499372", "0.5499372", "0.5487828", "0.547054", "0.5459699", "0.5425159", "0.54240346", "0.54045403", "0.54045403", "0.53943694", "0.5384049", "0.5359704", "0.53575087", "0.53436136", "0.53279316", "0.53279316", "0.53260714", "0.5324483", "0.5310931", "0.53008604", "0.52926505", "0.5284388", "0.5284388", "0.5282707", "0.5267178", "0.5265292", "0.5264228", "0.52607614", "0.52572066", "0.5256179", "0.5247898", "0.5247898", "0.5247898", "0.52402115", "0.52316916", "0.522933", "0.5222381", "0.52161235", "0.5216026", "0.52149713", "0.521119", "0.52060556", "0.5204099", "0.5200312", "0.5199014", "0.5198453", "0.5195976", "0.5195976", "0.5195976", "0.5195976", "0.5195976", "0.5192583", "0.51919687", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.51866645", "0.518561", "0.51819307" ]
0.0
-1
Redefine serializable_hash in models for more secure defaults. By default, it removes from the serializable model all attributes that are not accessible. You can remove this default by using :force_except and passing a new list of attributes you want to exempt. All attributes given to :except will simply add names to exempt to Devise internal list. source://devise//lib/devise/models/authenticatable.rb109
def serializable_hash(options = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serializable_hash(options = nil)\n options = options.try(:dup) || {}\n options[:except] = Array(options[:except]).dup\n\n if options[:force_except]\n options[:except].concat Array(options[:force_except])\n else\n options[:except].concat UNSAFE_ATTRIBUTES_FOR_SERIALIZATION\n end\n\n super(options)\n end", "def serializable_hash(options = nil)\n options ||= {} # Following Rails implementation\n options[:except] ||= [:oauth_token, :oauth_expires_at]\n super(options)\n end", "def as_json(options={})\n options[:except] ||= @@secure_fields\n super(options)\n end", "def as_json(options={})\n options[:except] ||= @@secure_fields\n super(options)\n end", "def encrypted_attributes\n active_record_attributes.except(*attributes_without_encrypted_values.keys)\n end", "def to_json(options={})\n options[:except] ||= [:encrypted_password, :password_salt]\n super(options)\n end", "def to_json(options={})\n options[:except] ||= [:encrypted_password, :password_salt]\n super(options)\n end", "def serializable_hash(options={})\n options[:except] ||= [ :password, :email,:encrypted_password, :salt]\n options[:methods] ||= [ :image_url ]\n super options\n end", "def as_json(options={})\n exclusion_list = []\n exclusion_list += ConfigCenter::Defaults::EXCLUDED_JSON_ATTRIBUTES\n exclusion_list += ConfigCenter::User::EXCLUDED_JSON_ATTRIBUTES\n options[:except] ||= exclusion_list\n super(options)\n end", "def serializable_hash\n attrs = self.class._attributes.dup.keys\n\n # Inclusive fields.\n if @opts[:only].present? || @opts[:fields].present?\n (@opts[:only] ||= []).concat(@opts[:fields] ||= [])\n attrs = (attrs & @opts[:only].map(&:to_sym))\n # Exclusive fields.\n elsif @opts[:exclude].present?\n attrs = (attrs - @opts[:exclude].map(&:to_sym))\n end\n\n filter_attributes(attrs)\n end", "def attributes_hash\n attributes = @serializable.attributes\n if options[:only].any?\n attributes.slice(*options[:only])\n elsif options[:except].any?\n attributes.except(*options[:except])\n else\n attributes\n end\n end", "def attributes_without_encrypted_values\n attributes_with_decrypted_values.except *eager_load_conductors.map(&:encrypted_attribute)\n end", "def serializable_hash(options = nil)\n super((options || {}).merge({\n :only => [\n :name,\n :full_name,\n :url,\n :registration_method,\n :uses_fk,\n :uses_isic,\n :uses_citylife\n ]\n }))\n end", "def except_attributes\n [].freeze\n end", "def serializable_hash(opts = {})\n options = {\n :only => [:id, :email, :account_id, :firstname, :lastname, :biography]\n }.update(opts)\n super(options)\n end", "def to_json(options={})\n options[:except] ||= ConfigCenter::User::ExcludedJsonAttributes\n super(options)\n end", "def to_json(options={})\n\t\toptions[:except] ||= [:hashed_password, :salt]\n\t\tsuper(options)\n end", "def serializable_hash (options={})\n options = {\n except: [:password_digest],\n methods: [:url]\n \n }.update(options)\n\n super(options)\n end", "def safe_attributes=(attrs, user=User.current)\n return unless attrs.is_a?(Hash)\n\n attrs = attrs.dup\n attrs = delete_unsafe_attributes(attrs, user)\n \n return if attrs.empty?\n\n # mass-assignment security bypass\n assign_attributes attrs, :without_protection => true\n end", "def to_json(options={})\n options[:except] ||= [:password_digest]\n super(options)\n end", "def as_json(*)\n super(except: %i[password_digest created_at updated_at deleted_at])\n end", "def except(*keys)\n common = keys & self.class.required_attributes\n\n if common.empty?\n self.class.new(@hash.except(*keys))\n else\n to_hash.except(*keys)\n end\n end", "def as_json(options = {})\n super(options.merge({ except: :password_digest }))\n end", "def allowed_attributes\n self.new.attributes.keys.reject do |col|\n protected_attributes.include?(col)\n end\n end", "def serializable_hash(options={})\n options = { \n exclude: [:snapshot_url, :is_active]\n }.update(options)\n super(options)\n end", "def restore_attributes(options = {})\n original_attributes_before_type_cast = self.original_attributes_before_type_cast.dup\n \n if options[:only]\n only = Array(options[:only]).map(&:to_s)\n original_attributes_before_type_cast.delete_if { |key, value| !only.include?(key) }\n elsif options[:except]\n except = Array(options[:except]).map(&:to_s)\n original_attributes_before_type_cast.delete_if { |key, value| except.include?(key) }\n end\n \n @attributes.update(original_attributes_before_type_cast)\n end", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:id, :password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count,\n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:id, :password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count, \n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def attributes_to_save # :doc:\n attrs_to_save = attributes.clone.delete_if do |k, v|\n [:password, crypted_password_field, password_salt_field, :persistence_token, :perishable_token, :single_access_token, :login_count, \n :failed_login_count, :last_request_at, :current_login_at, :last_login_at, :current_login_ip, :last_login_ip, :created_at,\n :updated_at, :lock_version].include?(k.to_sym)\n end\n attrs_to_save.merge!(:password => password, :password_confirmation => password_confirmation)\n end", "def clear_original_attributes(options = {})\n if !(options[:only] or options[:except]) || !@original_attributes\n return @original_attributes = nil\n end\n \n attributes_to_clear = if options[:only]\n Array(options[:only]).map(&:to_s)\n elsif options[:except]\n except = Array(options[:except]).map(&:to_s)\n self.class.column_names.reject { |c| except.include?(c) }\n end\n \n attributes_to_clear.each do |attribute|\n @original_attributes[attribute] = @attributes[attribute]\n end\n end", "def serializable_attributes\n #attribute_names = @record.attributes.keys # This includes all attributes including associations\n attribute_names = @record.class.keys.keys # This includes just keys\n idex = attribute_names.index(\"_id\")\n attribute_names[idex] = \"id\" if idex\n\n if options[:only]\n options.delete(:except)\n attribute_names = attribute_names & Array(options[:only]).collect { |n| n.to_s }\n else\n options[:except] = Array(options[:except]) \n attribute_names = attribute_names - options[:except].collect { |n| n.to_s }\n end\n\n attribute_names.collect { |name| Attribute.new(name, @record) }\n end", "def ignore_attributes\n read_inheritable_attribute(:attr_ignore) || []\n end", "def attributes_protected_by_default\n []\n end", "def to_json(options = {})\n if options[:except].nil?\n options[:except] = []\n end\n options[:except] |= [:password, :photo, :total_value, :lock_status, :isroot]\n super(options)\n end", "def serializable_hash(options = {})\n pre_sanitized_hash = super({\n :only => [:id, :name, :email]\n }.merge(options))\n\n # Sanitize\n pre_sanitized_hash.merge({\n \"name\" => Rack::Utils.escape_html(self.name),\n \"email\" => Rack::Utils.escape_html(self.email)\n })\n end", "def attributes_protected_by_default\n [\"key\"]\n end", "def json_options\n { except: %i[created_at updated_at password_digest] }\n end", "def ignore_attributes(*attributes)\r\n @@ignored_attributes[name] = attributes.flatten.map(&:to_s)\r\n end", "def exclude_attrs(hash, attrs, must_exclude, associations)\n exclude = attrs + associations + must_exclude\n hash.except(*exclude)\n end", "def attributes_protected_by_default\n []\n end", "def safe_attributes=(attrs, user=User.current)\n if attrs.respond_to?(:to_unsafe_hash)\n attrs = attrs.to_unsafe_hash\n end\n\n return unless attrs.is_a?(Hash)\n\n if attrs['custom_field_values'].present?\n editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}\n attrs['custom_field_values'].select! {|k, v| editable_custom_field_ids.include?(k.to_s)}\n end\n\n if attrs['custom_fields'].present?\n editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}\n attrs['custom_fields'].select! {|c| editable_custom_field_ids.include?(c['id'].to_s)}\n end\n\n super(attrs, user)\n end", "def protect_attributes(*args)\n self.protected_attributes ||= []\n self.protected_attributes << args.collect(&:to_s)\n end", "def ignore_non_read_or_write_attributes\n ['title', 'email', 'expertise_list', 'tool_list', 'mbox_sha1sum']\n end", "def ignoring(*attributes)\n attributes.each do |attr_name|\n @_attributes.delete(attr_name.to_sym)\n end\n end", "def ignored_merge_attributes\n IGNORED_ATTRIBUTES\n end", "def set_except(hash, *except)\n set_restricted(hash, false, except.flatten)\n end", "def as_json(options = {})\n\t\tsuper(options.merge({except: [:password_digest]}))\n\tend", "def attributes\n sanitized_values = self.to_h.dup\n sanitized_values[:access_token] = 'REDACTED'\n sanitized_values[:issuer] = self.issuer\n sanitized_values\n end", "def object_serialization_options\n {:except => [:created_at, :updated_at, :maintenance_mode]}\n end", "def serializable_hash(*)\n\n excludes = ['id', 'created_at', 'updated_at', 'from_searcher', 'searcher_key']\n output = super.except(*excludes)\n output.merge!(search_data) if search_data\n\n # Flatten the extra data fields into output\n return output\n\n end", "def freeze\n @original_deserialized_values ||= {}\n @original_deserialized_values.freeze\n super\n end", "def serializable_hash(options)\n original_hash = super(options)\n Hash[original_hash.map {|k, v| [self.aliased_fields.invert[k] || k , v] }]\n end", "def remove_non_permitted_booking_attrs hash\n hash[:booking].delete_if {|k,v| k.to_s.in? %w(id hotel_id encrypted_cc_number encrypted_cc_cvv state customer_id rate discounted_rate created_at updated_at guid paid total) }\n hash\n end", "def serializable_hash(options={})\n options[:only] = [:name, :phone, :street, :city, :state, :zip]\n options[:methods] = [:id, :lat, :long]\n super options\n end", "def extract_serializable_attributes(options = {})\n opts = options.try(:dup) || {}\n only = Array.wrap(opts[:only]).map(&:to_s)\n\n only = if only.blank?\n serializable_attributes\n else\n only & serializable_attributes\n end\n\n only -= Array.wrap(opts[:except]).map(&:to_s) if opts.key?(:except)\n only.uniq\n end", "def returnable_attributes\n attrs = dirty_attributes.dup\n self.class.attributes.select {|name, props| props[:writer] != :public}.each do |name, props|\n attrs.delete name\n end\n attrs.delete(:id)\n attrs\n end", "def as_json(options={})\n options[:except] ||= [:password_digest, :email]\n options[:methods] ||= [:gravatar_id]\n super\n end", "def as_json(options = nil)\n json = super(options)\n json.delete 'password'\n json.delete 'password_digest'\n json\n end", "def unknown_attributes\n @unknown_attributes ||= {}\n end", "def unknown_attributes\n @unknown_attributes ||= {}\n end", "def unknown_attributes\n @unknown_attributes ||= {}\n end", "def serialize_options\n\t\t{\n\t\t\texcept: [\n\t\t\t\t:has_password, :created_at, :unique_token, :updated_at, :custom_name,\n\t\t\t\t:admin, :show_ads, :name_source, :image, :email\n\t\t\t\t\n\t\t\t],\n\t\t\tmethods: [ :kind, :display, :url ]\n\t\t}\n\tend", "def safe_attributes=(attrs, user=User.current)\n if attrs.respond_to?(:to_unsafe_hash)\n attrs = attrs.to_unsafe_hash\n end\n\n @attributes_set_by = user\n return unless attrs.is_a?(Hash)\n\n attrs = attrs.deep_dup\n\n if attrs['custom_field_values'].present?\n editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}\n attrs['custom_field_values'].select! {|k, v| editable_custom_field_ids.include?(k.to_s)}\n end\n\n if attrs['custom_fields'].present?\n editable_custom_field_ids = editable_custom_field_values(user).map {|v| v.custom_field_id.to_s}\n attrs['custom_fields'].select! {|c| editable_custom_field_ids.include?(c['id'].to_s)}\n end\n\n if ActiveRecord::VERSION::MAJOR <= 4\n # mass-assignment security bypass\n assign_attributes attrs, :without_protection => true\n else\n assign_attributes attrs\n end\n end", "def protected_attributes=(attributes = nil)\n attributes = attributes.is_a?(Hash) ? attributes.symbolize_keys : {}\n send :attributes=, attributes.only(:author, :email, :summary, :content, :attachment), false\n end", "def remove_readonly_attributes(attributes)\n unless self.class.readonly_attributes.nil?\n attributes.delete_if { |key, value| self.class.readonly_attributes.include?(key.gsub(/\\(.+/,\"\")) }\n else\n attributes\n end\n end", "def omitted_attributes\n (self.class.replicate_omit_attributes + @replicate_opts[:omit]).uniq\n end", "def as_json(options = {})\n super(options.merge({ except: [:auth_token, :created_at, :updated_at] }))\n end", "def attributes_protected_by_default\n ['id']\n end", "def original_attributes\n @record.attributes.symbolize_keys.select do |(attr, _)|\n !%i(created_at updated_at).include?(attr)\n end\n end", "def update_except(hash, *except)\n update_restricted(hash, false, except.flatten)\n end", "def ignored_associations\n %w().freeze\n end", "def untouchable_params_attributes #:nodoc:\n { :outfile_id => true }\n end", "def slice_unauthorized_attributes!\n authorized_attributes = upper(:@@attributes) || {}\n @params.slice!(*authorized_attributes)\n end", "def deny_all!(kind = :all, attributes = {})\n allow_all(kind, attributes).save\n end", "def serializable_hash(options = {})\n # options = (options || {}).merge(:except => definition.flags.select{ |k, v| !v }.collect{ |x| x.first.to_s.gsub(\"is_\", \"\").gsub(\"_displayed\", \"\") })\n super\n end", "def sanitized_allowed_attributes=(attributes); end", "def sanitized_allowed_attributes=(attributes); end", "def object_serialization_options\n {:except => [:site_id, :email_address, :type], :methods => :variant}\n end", "def sanitize(attributes, authorizer)\n sanitized_attributes = attributes.reject { |key, value| authorizer.deny?(key) }\n debug_protected_attribute_removal(attributes, sanitized_attributes)\n sanitized_attributes\n end", "def serializable_attributes\n attributes = %w[id name created_at]\n attributes << \"uid\" unless confidential?\n attributes\n end", "def attributes_for_saving_with_person attributes\n attributes = attributes_for_saving_without_person(attributes)\n\n attributes.delete(:company)\n attributes.delete(:deals)\n attributes.delete(:won_deals_total)\n attributes.delete(:lead_status)\n attributes.delete(:viewed_at)\n attributes.delete(:deal_ids)\n attributes.delete(:predefined_contacts_tag_ids)\n attributes.delete(:user_id)\n attributes.delete(:user)\n\n attributes.delete(:image_thumb_url) if attributes[:image_thumb_url] == \"/images/thumb/missing.png\"\n\n attributes\n end", "def attr_encrypted_encrypted_attributes\n @attr_encrypted_encrypted_attributes ||= begin\n duplicated= {}\n self.class.attr_encrypted_encrypted_attributes.map { |key, value| duplicated[key] = value.dup }\n duplicated\n end\n end", "def showable_attributes\n return attributes if permitted_to?(WriteAllPrivilege)\n attributes.reject do |k,v|\n !allowed?(:read, k, true)\n end\n end", "def freeze\n freeze!\n attributes.freeze\n super\n end", "def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end", "def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end", "def decorated_attributes(attrs = {})\n attrs.dup\n end", "def remove_attributes_protected_from_mass_assignment_with_exception_on_unsafe_attributes(attributes)\n safe_attributes = remove_attributes_protected_from_mass_assignment_without_exception_on_unsafe_attributes(attributes)\n if attributes != safe_attributes\n raise RuntimeError, \"Cannot mass assign the following attributes: #{(attributes.keys - safe_attributes.keys).to_sentence}\"\n end\n safe_attributes\n end", "def serializable_attribute_names\n attribute_names = @record.attribute_names\n\n if options[:only]\n options.delete(:except)\n attribute_names = attribute_names & Array(options[:only]).collect { |n| n.to_s }\n else\n options[:except] = Array(options[:except]) | Array(@record.class.inheritance_column)\n attribute_names = attribute_names - options[:except].collect { |n| n.to_s }\n end\n\n attribute_names\n end", "def serializable_attribute_names\n attribute_names = @record.attribute_names\n\n if options[:only]\n options.delete(:except)\n attribute_names = attribute_names & Array(options[:only]).collect { |n| n.to_s }\n else\n options[:except] = Array(options[:except]) | Array(@record.class.inheritance_column)\n attribute_names = attribute_names - options[:except].collect { |n| n.to_s }\n end\n\n attribute_names\n end", "def creatable_attributes(resource, attributes)\n uncreatable_keys = configuration.uncreatable_keys(resource)\n DataMapper::Ext::Hash.except(attributes, *uncreatable_keys)\n end", "def to_json(options={})\n options[:except] ||= [:created_at, :updated_at]\n super(options)\n end", "def essential_attributes\n [\"is_transient\",\"id\"]\n end", "def to_hash\n super.reject { |_k, v| v.nil? }\n end", "def strip_non_model_safe_params parameters\n safe_params = if include_only = self._wrapper_options[:include]\n parameters.slice(*include_only)\n else\n exclude = _wrapper_options[:exclude] || []\n parameters.except(*(exclude + EXCLUDE_PARAMETERS))\n end \n return safe_params\n end", "def serializable_hash\n all = super\n attrs_to_serialize = filtered_attributes(all.keys, scope)\n all.slice(*attrs_to_serialize)\n end", "def remove_excluded_attributes!(hash)\n hash.each do |attr, val|\n if attr.in?(EXCLUDED_ENTITY_ATTRIBUTES)\n hash.delete(attr)\n elsif val.is_a? Array\n val.each {|v| remove_excluded_attributes!(v) if v.is_a?(Hash) }\n elsif val.is_a? Hash\n remove_excluded_attributes!(val)\n end\n end\n end", "def filter_attributes(record)\n self.changed_keys ||= []\n if !record.auditable_attributes.nil?\n self.changed_keys &= record.auditable_attributes\n end\n if !record.unauditable_attributes.nil?\n self.changed_keys -= record.unauditable_attributes\n end\n self.changed_keys -= %w{updated_at created_at _id}\n self.changed_keys\n end", "def raw_model_values(model)\n values = {}\n prohibited = [:id, :created_at, :updated_at]\n model.class.attributes.each do |attr|\n v = model.send(\"#{attr}\") unless prohibited.include?(attr)\n values[attr] = v if v\n end\n values\n end", "def remove_protected_attributes(attributes)\n protected_names = protected_properties.map { |prop| prop.name }\n return attributes if protected_names.empty? or attributes.nil?\n\n attributes.reject do |property_name, property_value|\n protected_names.include?(property_name.to_s)\n end\n end", "def attributes\n serializable = {}\n\n @attrs.each do |key|\n serializable[key.to_s] = nil\n end\n\n serializable\n end" ]
[ "0.7684171", "0.7101956", "0.6999355", "0.6999355", "0.68720347", "0.68301487", "0.68301487", "0.68215245", "0.6777539", "0.676231", "0.6721639", "0.67139935", "0.6700285", "0.6637154", "0.66026056", "0.6566339", "0.65397054", "0.65301406", "0.6500796", "0.6500116", "0.6488385", "0.6477835", "0.64033467", "0.6396573", "0.6387061", "0.638421", "0.6377829", "0.6372524", "0.63650733", "0.63458043", "0.6322442", "0.63117695", "0.63109225", "0.63032323", "0.629259", "0.62816775", "0.623592", "0.6233374", "0.6228817", "0.6221411", "0.62069887", "0.62051374", "0.6180939", "0.6176423", "0.61526656", "0.6149525", "0.61311805", "0.6126088", "0.61246705", "0.6122662", "0.6069026", "0.6028782", "0.6015416", "0.60147506", "0.6012562", "0.5999482", "0.5996394", "0.59911454", "0.5986546", "0.5986546", "0.5986546", "0.5985547", "0.5972578", "0.59479266", "0.5942979", "0.5938456", "0.5934515", "0.5934466", "0.5928974", "0.5907749", "0.5906163", "0.588637", "0.587398", "0.5871631", "0.5838406", "0.583758", "0.583758", "0.58309305", "0.5817302", "0.58172154", "0.5811331", "0.5810907", "0.58064216", "0.5803103", "0.57871634", "0.57871634", "0.5781338", "0.5773131", "0.5762858", "0.5762858", "0.5760629", "0.5758741", "0.57477397", "0.57335657", "0.57285106", "0.57263553", "0.5720696", "0.57150054", "0.57127845", "0.57053095", "0.5696363" ]
0.0
-1
Check if the current object is valid for authentication. This method and find_for_authentication are the methods used in a Warden::Strategy to check if a model should be signed in or not. However, you should not overwrite this method, you should overwrite active_for_authentication? and inactive_message instead.
def valid_for_authentication?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticated?\n valid? && !get_authenticated_user.nil?\n end", "def authenticate?\n @authentication_required\n end", "def check_authentication\n authenticate_user\n end", "def authenticate_user\n if current_user\n true\n else\n raise Exceptions::AuthorizationError.new('invalid user authorization')\n end\n end", "def authenticate_user?\n !current_user.nil?\n end", "def valid?\n return @valid if @valid != nil\n return true if self.user && self.user.valid_session?\n authenticate!\n end", "def active_for_authentication?\n active? && super\n end", "def authenticated?\n [email protected]?\n end", "def authenticated?\n authentication.authenticated?\n end", "def authentication_successful?\n current_user.present?\n end", "def active_for_authentication?\n self.active?\n end", "def active_for_authentication?\n super && self.enabled? && self.is_allowed_in?\n end", "def active_for_authentication?\n super\n end", "def active_for_authentication?\n super && self.is_active?\n end", "def active_for_authentication?\n super && isActive\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && is_active?\n end", "def authenticated?\n # If logged on to website, we're good\n @user = current_user\n authenticated = [email protected]?\n\n # If not logged on, or submitting via JSON post (likely), check params\n unless authenticated\n @user = User.find_by(email: params[:email])\n authenticated = @user && @user.authenticate(params[:password])\n end\n\n authenticated\n end", "def authenticated?\n warden.user ? true : false\n end", "def active_for_authentication?\n super && active\n end", "def active_for_authentication?\n\t\tsuper && (self.is_active)\n\tend", "def valid_for_authentication?\n return super unless persisted? && lock_strategy_enabled?(:failed_attempts)\n\n # Unlock the user if the lock is expired, no matter\n # if the user can login or not (wrong password, etc)\n unlock_access! if lock_expired?\n\n if super && !access_locked?\n true\n else\n increment_failed_attempts\n if attempts_exceeded?\n lock_access! unless access_locked?\n else\n save(validate: false)\n end\n false\n end\n end", "def authenticated_user?\n warden.authenticated?\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def active_for_authentication?\n super && !expired?\n end", "def authenticated?\n !account.nil?\n end", "def authentication?\n !!@authentication\n end", "def authenticated?\n false\n end", "def active_for_authentication?\r\n super && active_status?\r\n end", "def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end", "def active_for_authentication?\n super && !access_locked?\n end", "def active_for_authentication?\n super && account_active?\n end", "def authenticated?\n true\n end", "def authenticate_user!\n authenticated =\n if security.authenticate? || !defined? super\n instance_exec(&security.authenticate)\n else\n Logger.deprecated 'Wallaby will use `authenticate_wallaby_user!`' \\\n 'instead of `authenticate_user!` from 6.2.'\n super\n end\n raise NotAuthenticated if authenticated == false\n\n true\n end", "def resource_valid_for_authentication?\n @resource.respond_to?(:valid_for_authentication?) && @resource.valid_for_authentication? { valid_password? }\n end", "def authenticated?\n !!session[:user]\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticated?(*args)\n warden.authenticated?(*args)\n end", "def authenticated?(*args)\n warden.authenticated?(*args)\n end", "def active_for_authentication?\n super and self.disponible?\n end", "def authenticated?\n !!@authenticated\n end", "def user_authenticated?\n basic_authenticated? || token_authenticated?\n end", "def authenticated?\n @authenticated || false\n end", "def active_for_authentication?\n super && un_blocked?\n end", "def authenticate\n klass.new(request).authenticate == true\n end", "def authenticate_current_user\n raise_not_authorized_error unless current_user\n end", "def valid_for_authentication?\n block_given? ? yield : true\n end", "def resource_active_for_authentication?\n [email protected]_to?(:active_for_authentication?) || @resource.active_for_authentication?\n end", "def check_authenticate_user\n if request.headers[:token].present?\n @auth_token = AuthToken.find_by(token: request.headers[:token])\n @current_user = auth_token.user if @auth_token.present?\n unless @auth_token && @current_user\n error_response_with_obj(HTTP_UNAUTHORIZED[:code], \"Invalid Authentication token\")\n end\n else\n error_response_with_obj(HTTP_UNAUTHORIZED[:code], \"Invalid Authentication token\")\n end\n end", "def authenticated?\n @authenticated\n end", "def authenticated?\n @authenticated\n end", "def active_for_authentication?\n super and self.enabled?\n end", "def active_for_authentication?\n !deactivated? && super\n end", "def authenticate\n logged_in? || access_denied\n end", "def active_for_authentication?\n super && !disabled?\n end", "def active_for_authentication?\n super and self.locked != 1\n end", "def authenticate\n\t\t\tlogged_in? ? true : access_denied\n\t\tend", "def active_for_authentication?\n login_email = multi_email.login_email_record\n\n if login_email && !login_email.primary?\n super && login_email.active_for_authentication?\n else\n super\n end\n end", "def active_for_authentication?\n super && assigned?\n end", "def authenticate_normal_user\n unless authenticate\n return false\n end\n logged_in_normal_user? ? true : access_denied\n end", "def authentication_successful?\n @user.present?\n end", "def user_is_authenticated\r\n !!current_user\r\n end", "def authenticate\n logged_in? || access_denied\n end", "def authenticate?\n booking_ambassador.try(:authenticate_user?)\n end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def authenticate!\n current_user ? true : raise(Pundit::NotAuthorizedError)\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticate\n if @current_user\n else\n redirect_to login_url\n end\n end", "def valid_authentication_token?(incoming_auth_token)\n incoming_auth_token == self.authentication_token\n end", "def application_authenticated?\n !!application_authentication\n end", "def authenticated?\n !anonymous?\n end", "def is_authenticate(password)\n @user.authenticate(password)\n end", "def authenticate\n unless signed_in?\n flash[:warn] = {general: ['Please sign in']}\n redirect '/user/sign_in'\n end\n true\n end", "def active_for_authentication?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def is_authenticated?\n @authenticated_user = instance_eval &AbstractAuth.invoke(:authenticated_user)\n @is_admin = instance_eval &AbstractAuth.invoke(:is_admin)\n # Uncomment the following line to test out admin interface\n #@is_admin = true\n @is_editor = instance_eval &AbstractAuth.invoke(:is_editor)\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def authenticate\n\t logged_in? ? true : access_denied\n\tend", "def authenticated?(*args)\n warden.authenticated?(*args)\n end", "def authorized_for?(options = {})\n current_user && current_user.authorized_for?(options)\n end", "def authenticate\n if not current_user\n redirect_to signin_path, notice: 'Not logged in'\n end\n end", "def authenticate\n redirect_to '/login' unless current_user\n end", "def valid_authentication_token?(incoming_auth_token)\n incoming_auth_token.present? && incoming_auth_token == self.authentication_token\n end", "def active_for_authentication?\n super && !banned?\n end", "def authenticate_user\n if !current_user\n redirect_to login_path\n end\n end", "def authenticate_user\n if !current_user\n redirect_to login_path\n end\n end", "def valid_for_token_auth?\n token_authenticatable? && auth_token.present? && with_authentication_hash(:token_auth, token_auth_hash)\n end", "def active_for_authentication?\n super && !self.deactivated # i.e. super && self.is_active\n end" ]
[ "0.74941295", "0.74451613", "0.7284745", "0.72492754", "0.7247155", "0.71508455", "0.7145744", "0.71074176", "0.7099553", "0.70868194", "0.7068981", "0.70279866", "0.7000821", "0.69834995", "0.6964953", "0.6928543", "0.6928543", "0.6928543", "0.6927825", "0.692428", "0.6908483", "0.68900585", "0.6881579", "0.68748605", "0.68374854", "0.6826477", "0.6826477", "0.68087703", "0.6807978", "0.6805228", "0.68051696", "0.68027925", "0.67970955", "0.6784209", "0.6783371", "0.6782588", "0.67819524", "0.67751545", "0.6774827", "0.6773146", "0.67715764", "0.67715764", "0.6764667", "0.67558646", "0.6752384", "0.67426664", "0.6742269", "0.6739359", "0.6722201", "0.6707714", "0.6704659", "0.6696396", "0.6695388", "0.6695388", "0.6673386", "0.6672905", "0.6665291", "0.66493726", "0.66477156", "0.6643586", "0.6624269", "0.6598896", "0.6593053", "0.6587631", "0.6568475", "0.6567069", "0.65655875", "0.6562696", "0.6562696", "0.65481234", "0.65481234", "0.6541519", "0.6535993", "0.65318483", "0.652809", "0.6519498", "0.6516837", "0.6512191", "0.65059984", "0.6482419", "0.6468278", "0.64619935", "0.64619935", "0.64619935", "0.64619935", "0.64619935", "0.64619935", "0.64619935", "0.64527136", "0.64507204", "0.64506924", "0.6449441", "0.64442015", "0.64380205", "0.6432249", "0.64310396", "0.64310396", "0.6430614", "0.6425577" ]
0.70710826
11
This is an internal method called every time Devise needs to send a notification/mail. This can be overridden if you need to customize the email delivery logic. For instance, if you are using a queue to deliver emails (active job, delayed job, sidekiq, resque, etc), you must add the delivery to the queue just after the transaction was committed. To achieve this, you can override send_devise_notification to store the deliveries until the after_commit callback is triggered. The following example uses Active Job's `deliver_later` : class User devise :database_authenticatable, :confirmable after_commit :send_pending_devise_notifications protected def send_devise_notification(notification, args) If the record is new or changed then delay the delivery until the after_commit callback otherwise send now because after_commit will not be called. For Rails < 6 use `changed?` instead of `saved_changes?`. if new_record? || saved_changes? pending_devise_notifications << [notification, args] else render_and_send_devise_message(notification, args) end end private def send_pending_devise_notifications pending_devise_notifications.each do |notification, args| render_and_send_devise_message(notification, args) end Empty the pending notifications array because the after_commit hook can be called multiple times which could cause multiple emails to be sent. pending_devise_notifications.clear end def pending_devise_notifications
def send_devise_notification(notification, *args); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later\n end", "def send_devise_notification(notification, *args)\n if Rails.env.development?\n devise_mailer.send(notification, self, *args).deliver_later\n else\n super\n end\n end", "def send_devise_notification(notification, *args)\n #devise_mailer.send(notification, self, *args).deliver_later #NOTE:simdilik\n end", "def send_devise_notification(notification, *args)\n message = devise_mailer.send(notification, self, *args)\n # Remove once we move to Rails 4.2+ only.\n if message.respond_to?(:deliver_now)\n message.deliver_now\n else\n message.deliver\n end\n end", "def send_devise_notification(notification, *args)\n devise_mailer\n .send(notification, self, *args)\n .deliver_later(queue: :maintenance)\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_now\n end", "def send_devise_notification(notification, *args)\n devise_mailer.send(notification, self, *args).deliver_later(wait: 2.seconds)\n end", "def send_devise_notification(notification, *args)\n ActiveSupport::Deprecation.warn \"send_devise_notification\"\n=begin\n ActiveSupport::Deprecation.warn \"#{notification}\"\n ActiveSupport::Deprecation.warn \"#{self}\"\n ActiveSupport::Deprecation.warn \"po zmianach\"\n=end\n method = self.class.name.underscore + \"_#{notification}\"\n method = method.to_sym\n ActiveSupport::Deprecation.warn \"#{method}\"\n tmp = *args\n ActiveSupport::Deprecation.warn \"#{tmp}\"\n if tmp != {}\n ActiveSupport::Deprecation.warn \"tmp rozne {} #{tmp} is_a? #{self.is_a?(Class)}\"\n notifications_mailer.send(notification, self, tmp).deliver\n else\n\n notifications_mailer.send(method, self, *args).deliver\n end\n\n end", "def send_devise_notification(notification, *args)\n notification = @override_devise_notification if @override_devise_notification.present?\n model = @override_devise_model || self\n if @invitation_message.present?\n if args[1]\n args[1][:personal_message] = @invitation_message\n else\n args[1] = { personal_message: @invitation_message }\n end\n end\n devise_mailer.send(notification, model, *args).deliver_now\n end", "def send_notifications!\n NotificationMailer.job_notification(account_manager, self).deliver_later\n end", "def send_email(object)\n # SomeNotifier.notification(...).deliver_now\n end", "def admin_notify\n UserMailer.signup_notification(self).deliver_later!(wait: 1.minute)\n end", "def notify\n send_email_notification if allow_email_notifications\n send_slack_notification if allow_slack_notifications\n end", "def deliver\n inform_interceptors\n if delivery_handler\n delivery_handler.deliver_mail(self) { do_delivery }\n else\n do_delivery\n end\n inform_observers\n self\n end", "def on_delivery_notification(&blk)\n @on_delivery_notification = blk\n end", "def notify_email\n begin\n InsuranceLeadMailer.send_email(self).deliver\n rescue => e\n Rails.logger.error(\"Unable to send insurnace lead notification. #{e.message}\")\n end\n end", "def queued_message_sending\n if recipient.prefers_receive_email_notifications\n # we send some messgaes to the different mailer\n UserMailer.send(\"deliver_#{admin_message.mailer_method}\", self, recipient)\n end\n end", "def send_notifications\n end", "def send_email_changed_notification; end", "def push_notification\n UserMailer.new_message(self).deliver_now\n end", "def send_email_changed_notification?; end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def notify_admin\n return if admin_notified?\n update_column(:admin_notified, true) if persisted?\n RegistrationMailer.admin_notification_email(self).deliver\n end", "def deliver\n APN::Notifications.deliver([self])\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def deliver_activation_instructions!\n if Settings.uses_resque_for_background_emails\n Resque.enqueue(Jobs::SendSignUpNotification, self.id)\n else\n Notifier.signup_notification(self.id).deliver_later\n end\n end", "def send_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def mailer_notify\n #TODO-low is there a better way for sending it?\n # this is because we're testing it in capybara-email\n UserMailer\n .with(organizational_mentorship_id: id)\n .invitation_to_become_mentee\n .yield_self { |mail_message| Rails.env.test? || Rails.env.development? ? mail_message.deliver_now : mail_message.deliver_later }\n\n UserSentInvitationToBecomeMentee.create!(user: mentee_user, resource: self)\n end", "def send_newsletter_email\n UserMailer.newsletter_confirmation(self).deliver_later\n end", "def will_notify\n #Resque.safe_enqueue Notification, to_user_id, id, APP::NOTIFICATIONS::MESSAGE\n end", "def email_user\n Mailer.deliver_nesstar_catalogs_processed(datasets, user_id, base_host) if EMAIL_ENABLED && User.find(user_id).person.send_notifications?\n end", "def send_request_notification_email\n ReservationMailer.request_notification(self).deliver_now\n end", "def notify_email\n begin\n QuoteMailer.send_email(self).deliver\n rescue => e\n Rails.logger.error(\"Unable to send quote email notification. #{e.message}\")\n end\n end", "def send_notification\n unless development?\n recipient_email = Hacker.first(:username => self.recipient).email\n Notifier.send_message_notification(recipient_email, self.sender)\n end\n end", "def send_admin_notification_email\n #Notifies admin of the registration\n UserMailer.new_user(self).deliver\n end", "def send_execution_notification\n payload = execution_notification_payload\n trade_order.portfolio.user.notify_devices payload, self\n end", "def send_notification\n\n\n end", "def email_notification\n return unless app.emailable? && should_email?\n Mailer.err_notification(self).deliver_now\n rescue => e\n HoptoadNotifier.notify(e)\n end", "def call\n users_to_notify.uniq.each do |recipient|\n workflow_message_mailer(to: recipient).send(mailer_method).deliver_later\n end\n end", "def send_notification\n AdminMailer.delay.new_report(self)\n end", "def call\n users_to_notify.uniq.each do |recipient|\n Hyrax::MessengerService.deliver(user, recipient, message.html_safe, subject)\n\n mailer = workflow_message_mailer(to: recipient)\n mailer.send(mailer_method).deliver_later if mailer.respond_to?(mailer_method)\n end\n end", "def send_email_password_changed\n Resque.enqueue(PasswordNotification,self)\n end", "def notify\n if Backup::Mail::Base.setup?\n Backup::Mail::Base.notify!(self)\n end\n end", "def notify_user(user, deliver: true)\n if user.last_notification_mail_sent.nil?\n user.update(last_notification_mail_sent: 1.day.ago)\n end\n notification_ids = notifications_for_user(user)\n comment_thread_ids = comment_threads_for_user(user)\n return if notification_ids.count.zero? && comment_thread_ids.count.zero?\n\n mailer = NotificationMailer.notify(\n user_id: user.id,\n notification_ids: notification_ids,\n comment_thread_ids: comment_thread_ids,\n )\n if deliver\n mailer.deliver_later\n end\n mailer\n end", "def after_deliver; end", "def notify_user\n NotiMailer.notification_proposal(self.homework.user.email, self, self.homework).deliver\n end", "def groups_notification_email\n @data = last_notification\n # Only send if there's something to send\n return unless @data.any?\n rails_secrets = Rails.application.secrets\n send_to = rails_secrets.user_default_email\n send_from = 'notifications@' + rails_secrets.domain_name\n mail(from: send_from, to: send_to,\n subject: 'Competitor-Monitor Changes Notification')\n end", "def notify(subject,body,obj = nil,sanitize_text=true,notification_code=nil,send_mail=true,sender=nil)\n Mailboxer::Notification.notify_all([self],subject,body,obj,sanitize_text,notification_code,send_mail,sender)\n end", "def send_email!\n UserMailer.event_ticket_notification(user, self).deliver_now\n end", "def send_activation_email\n unless notified?\n Notifier.email_activation(self).deliver\n self.update_attribute(:notified, true)\n end\n end", "def send_admin_notification\n Notifications.send_admin_notification(User.admin, self).deliver\n end", "def email_user\n Mailer.deliver_metadata_processed(dataset_id, user_id, @missing_variables, base_host) if EMAIL_ENABLED && User.find(user_id).person.send_notifications?\n end", "def notify_supplier_final_payment_paid\n WeixinsJob.perform_later({:event => 'delivery_final_payment_paid', :id => self.id}) if supplier.weixin\n end", "def notify\n return if @user.email.blank?\n\n Notifier.user_event_analisys(@user, @user.events.future.analisys.first).deliver_now if @user.events.future.analisys.present?\n Notifier.user_event_visit(@user, @user.events.future.visits.first).deliver_now if @user.events.future.visits.present?\n end", "def push_notification\n NotificationMailer.push_notification\n end", "def send_admin_mail\n AdministratorMailer.new_user_waiting_for_approval(self).deliver_now\n end", "def send_mail_to_admin\n \tNotification.send_mail_to_admin(self).deliver!\n end", "def send_confirmation_instructions\n generate_confirmation_token! if self.confirmation_token.nil?\n ::Devise.mailer.confirmation_instructions(self).deliver\n end", "def notify\n MemberMailerWorker.perform_in(15.minutes, member_id: self.employer.id.to_s, package_order_id: self.id.to_s, perform: :send_package_invoice_to_employer)\n #TeamMailerWorker.perform_async(package_order_id: self.id.to_s, perform: :send_new_package_order)\n end", "def notify_of_request\n # UserNotifier.async_deliver_donations_requested(user)\n end", "def post_approve_email\n NotificationMailer.post_approve_email('[email protected]')\n end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def notify_order\n UserMailer.notify_order\n end", "def send_fundraiser_featured_notification\n person.send_email :fundraiser_featured_notification, fundraiser: self\n end", "def deliver\n options = {\n notification: self,\n output: output\n }\n\n notifier = eval(notifier_strategy).new( options )\n notifier.deliver\n\n self.completed_at = DateTime.now\n self.save\n end", "def send_email\n # There is a deliver_later method which we could use\n InvoiceMailer.email_invoice(self).deliver_now\n self.sent_by_email = true\n self.save\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def skip_email_changed_notification!; end", "def perform(user_name, content)\n\t\tNotificationMailer.notify_email(user_name, content).deliver\n\tend", "def send_devise_notification(notification, *args)\n I18n.with_locale(locale) { super notification, *args }\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def send_admin_email\n AdminMailer.new_user_waiting_for_approval.deliver\n end", "def deliver_mail\n @invitation.deliver_mail\n track 'Invitation Deliver Mail', @invitation\n redirect_to account_invitations_path, notice: 'Invitation email has been sent.'\n end", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def notify(object,class_name,notification_name,sms = false,options)\n if options[:email]\n if options[:password].present?\n Email.send_welcome_email(object,class_name,notification_name,options[:password])\n else\n Email.send_email(object,class_name,notification_name)\n end\n end\n Sms.send_sms(object,class_name,notification_name) if sms\n end", "def sendmail(to, notification_mail, params, attachments = [])\n raise NotImplementedError, \"you should implement #{self.class}##{__method__}\"\n end", "def deliver(event)\n payload = event.payload\n\n info(\n message: 'Mail sent',\n mailer_class: payload[:mailer],\n message_id: payload[:message_id],\n current_user: current_user(payload),\n email_subject: payload[:subject],\n email_to_hint: email_to_hint(payload),\n email_from: payload[:from],\n email_date: payload[:date]\n )\n end", "def deliver_email(mail)\n if mail.respond_to?(:deliver_later)\n mail.deliver_later\n else\n mail.deliver\n end\n end", "def after_deliver\n # Send email to giftor, if this order was a gift, so that he knows it has been delivered to the giftee\n Spree::OrderMailer.giftor_delivered_email(self.order).deliver() if (self.order.is_gift? && !Spree::MailLog.has_email_been_sent_already?(self.order, 'Order::giftor_delivered_email'))\n end" ]
[ "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.73494565", "0.7292247", "0.7279809", "0.726385", "0.72538704", "0.72085065", "0.7154309", "0.7128858", "0.67239183", "0.66529745", "0.637737", "0.61787283", "0.61346895", "0.6092559", "0.6071795", "0.6059725", "0.603257", "0.6024043", "0.6003791", "0.6003723", "0.5999508", "0.5996599", "0.5989521", "0.5963425", "0.59565", "0.5955635", "0.5903928", "0.59018457", "0.5900357", "0.58960295", "0.58831376", "0.5870913", "0.5862214", "0.5861305", "0.5853771", "0.5846952", "0.58199126", "0.58182514", "0.5816244", "0.5798398", "0.57964516", "0.5792653", "0.5781787", "0.5779214", "0.5761936", "0.57589936", "0.5731847", "0.5729348", "0.57280266", "0.5727593", "0.5713029", "0.5710436", "0.56922567", "0.5691609", "0.568694", "0.56843543", "0.56821775", "0.5664814", "0.5647862", "0.5645503", "0.5638867", "0.56076074", "0.55960524", "0.55852264", "0.5566976", "0.55392873", "0.5538154", "0.55181515", "0.5511836", "0.5501219", "0.55011123", "0.549801", "0.549801", "0.549801", "0.5497742", "0.5493707", "0.5491502", "0.5490592", "0.5488593", "0.54748946", "0.5468232", "0.54680455" ]
0.656878
28
Find first record based on conditions given (ie by the sign in form). This method is always called during an authentication process but it may be wrapped as well. For instance, database authenticatable provides a `find_for_database_authentication` that wraps a call to this method. This allows you to customize both database authenticatable or the whole authenticate stack by customize `find_for_authentication.` Overwrite to add customized conditions, create a join, or maybe use a namedscope to filter records while authenticating. Example: def self.find_for_authentication(tainted_conditions) find_first_by_auth_conditions(tainted_conditions, active: true) end Finally, notice that Devise also queries for users in other scenarios besides authentication, for example when retrieving a user to send an email for password reset. In such cases, find_for_authentication is not called. source://devise//lib/devise/models/authenticatable.rb275
def find_for_authentication(tainted_conditions); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_for_authentication(tainted_conditions)\n find_first_by_auth_conditions(tainted_conditions)\n end", "def find_first_by_auth_conditions(warden_conditions)\n conditions = warden_conditions.dup\n if login = conditions.delete(:login)\n where(conditions).where([\"lower(username) = :value OR lower(email) = :value\", { :value => login.downcase }]).first\n else\n where(conditions).first\n end\n end", "def find_for_authentication(conditions)\n if ( login = conditions[:email] ).present?\n if login =~ /@/\n find_by_email(login)\n else\n find_by_slug(login)\n end\n else\n super\n end\n end", "def find_for_database_authentication(conditions={})\n find_by_email_or_alias(conditions[:email])\n end", "def find_by_authentication_token(authentication_token = nil)\n if authentication_token\n where(authentication_token: authentication_token).first\n end\n \n end", "def find_user\n results = @ldap.search( :base => options[:ldap][:base], :filter => user_filter)\n return results.first\n end", "def find_by(**args)\n where(**args).first\n end", "def find_first(conditions = nil, orderings = nil)\n sql = \"SELECT * FROM #{table_name} \"\n add_conditions!(sql, conditions)\n sql << \"ORDER BY #{orderings} \" unless orderings.nil?\n sql << \"LIMIT 1\"\n \n record = connection.select_one(sql, \"#{name} Load First\")\n instantiate(record) unless record.nil?\n end", "def find_by_credentials(credentials)\n credential = credentials[0].dup\n credential.downcase! if @klass.sorcery_config.downcase_username_before_authenticating\n @klass.sorcery_config.username_attribute_names.each do |name|\n @user = @klass.first(name => credential)\n break if @user\n end\n !!@user ? @klass.get(@user.id) : nil\n end", "def get_record\n recordset = self.get_recordset\n find_by_fields = self.get_find_by_fields\n find_by_key = self.get_model.primary_key\n\n # Find by another column if it's permitted.\n if find_by_query_param && params[find_by_query_param].in?(find_by_fields)\n find_by_key = params[find_by_query_param]\n end\n\n # Filter recordset, if configured.\n if self.filter_recordset_before_find\n recordset = self.get_filtered_data(recordset)\n end\n\n # Return the record.\n if find_by_value = params[:id] # Route key is always :id by Rails convention.\n return self.get_recordset.find_by!(find_by_key => find_by_value)\n end\n return nil\n end", "def find_first(options = {})\n construct_scope(options).first\n end", "def find_by(conditions={})\n raise ArgumentError if conditions.empty?\n query = %(SELECT * FROM #{table_name} #{build_condition(conditions)})\n res = connection.execute(query).first\n\n if res.nil?\n raise RecordNotFound\n end\n res.extend Result::Behavior\n end", "def find_one\n return super if params[klass.primary_key].present?\n @find_one ||= klass.new_collection_from_result(limit(1).fetch).first\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def find_by(params = {})\n find_by_index(params) || where(params).first\n end", "def first(*conditions)\n record = DB.client.query(query(conditions)).first\n return unless record\n\n instance_type.new(@record_type, record, @mapping)\n end", "def find_by_external_authentication_uid(external_authentication_uid)\n finder = table.where(:external_authentication_uid => external_authentication_uid)\n if user_data = execute_sql(:read, :user) { finder.first }\n inflate_model(user_data)\n else\n nil\n end\n end", "def find_record\n if record\n self.new_session = false\n return record\n end\n \n find_with.each do |find_method|\n if send(\"valid_#{find_method}?\")\n self.new_session = false\n return record\n end\n end\n nil\n end", "def find opt = nil, opts = { }\n opt ||= :all\n \n opts[:limit] = 1 if opt == :first\n\n # self.sql sets self.model_class.\n this_sql = self.sql(opts)\n result = model_class.find_by_sql(this_sql)\n\n result = result.first if opt == :first\n\n result\n end", "def find_by_id_or_username\n if input_is_id?\n find_by_id\n else\n find_by_username\n end\n end", "def find_user\n return nil if session[:user_id].nil?\n User.find(session[:user_id])\n end", "def find_user\n return nil if session[:user_id].nil?\n User.find(session[:user_id])\n end", "def find_by_query(&block)\n finder = block ? block.call(table) : table\n if user_data = execute_sql(:read, :user) { finder.first }\n inflate_model(user_data)\n else\n nil\n end\n end", "def find_record_from_identifier(entity)\n model = entity.model\n user_token = request.headers[\"X-#{model.to_s.upcase}-TOKEN\"]\n super if model != User || user_token.blank?\n model.find_by authentication_token: user_token\n end", "def find(*arguments)\n scope = arguments.slice!(0)\n options = arguments.slice!(0) || {}\n\n case scope\n when :all then find_every(options)\n when :first then find_every(options).first\n else find_single(scope, options)\n end\n end", "def first(*args)\n if args.any?\n if args.first.kind_of?(Integer) ||\n (loaded? && !args.first.kind_of?(Hash))\n to_a.first(*args)\n else\n apply_finder_options(args.first).first\n end\n else\n find_first\n end\nend", "def authenticated_user\n User.where(email: email_from_headers, password: password_from_headers).first\n end", "def find\n super.first\n end", "def find_user_for_git_or_lfs_request\n return unless git_or_lfs_request?\n\n find_user_from_lfs_token || find_user_from_basic_auth_password\n end", "def find_by_username_password(username, password)\n User.find_by_username(username).try(:credential).try(:authenticate_by_password, password).try(:user)\n end", "def authenticate(name_or_email, password)\n m = active.find_by_email(name_or_email)\n m = active.find_by_name(name_or_email) unless m \n m && m.authenticated?(password) ? m : nil\n end", "def first(options={})\r\n find(:first, options)\r\n end", "def first(*args)\n find(:first, *args)\n end", "def first(*args)\n find(:first, *args)\n end", "def first(*args)\n find(:first, *args)\n end", "def find\n model_class.filterrific_find(self)\n end", "def _find_record(options)\n if options && options[:lock]\n self.class.preload(strict_loaded_associations).lock(options[:lock]).find_by!(hid: hid)\n else\n self.class.preload(strict_loaded_associations).find_by!(hid: hid)\n end\n end", "def find_by_id_or_username!\n if input_is_id?\n find_by_id!\n else\n find_by_username!\n end\n end", "def find_person\r\n if (params[:u] == nil || params[:u] == '')\r\n require_login || return\r\n @person = User.current\r\n else\r\n @person = Person.find(params[:u])\r\n end\r\n rescue ActiveRecord::RecordNotFound\r\n render_404\r\n end", "def find(*arguments)\r\n scope = arguments.slice!(0)\r\n options = arguments.slice!(0) || {}\r\n \r\n case scope\r\n when :all then find_every(options)\r\n when :first then find_every(options).first\r\n else find_single(scope, options)\r\n end\r\n end", "def authenticate!\n\n # mapping comes from devise base class, \"mapping.to\" is the class of the model\n # being used for authentication, typically the class \"User\". This is set by using\n # the `devise` class method in that model\n klass = mapping.to\n\n if request.headers['HTTP_X_MY_API'].present?\n # the returned user object will be saved and serialised into the session\n user = klass.find_or_initialize_by_email(request.headers['HTTP_X_MY_API'])\n success! user\n end\n\n # if we wanted to stop other strategies from authenticating the user\n end", "def find_by_omniauth(auth)\n identity = User::Identity.find_by(provider: auth.provider, uid: auth.uid)\n identity.user if identity\n end", "def find_one(options = {})\n @find_one ||=\n if primary_key_set?\n without_collection_params { super() }\n else\n klass.new_collection_from_result(limit(1).fetch(options)).first\n end\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def multi_authenticate\n if user_signed_in?\n @user = current_user #from devise authentication\n else\n @user = find_user(request, cookies) #find user by user_cookie\n end\n end", "def find_for_show(find_by_conditions:)\n search.find_by(find_by_conditions)\n end", "def find_one(criteria, options = {})\n criteria = normalize_criteria criteria\n hash = self.collection.find_one(criteria, options)\n self.normalize(hash) if hash\n end", "def first!\n first or raise RecordNotFound\n end", "def authentication provider=:identity\n Authentication.where(user_id: id, provider: provider).all.first\n end", "def find_by_id\n User.find_by_id(@username_or_id)\n end", "def find_first(*args)\n id = get_range(:count => 1, *args).first\n id && find_one(id, *args)\n end", "def find_by_username\n User.find_by_username(@username_or_id)\n end", "def find(*args)\n find_all(*args).first\n end", "def current_user\n @current_user ||= ::User.send(\"find_by_#{self.identifier_attribute}!\", session[identifier_name])\n rescue ActiveRecord::RecordNotFound\n nil\n end", "def find_by(options)\n warn \"Using `Repository#find_by` with an email may return inexact matches\" if email_key?(options)\n where(options, true).first\n end", "def find_current_user\n Current.user = UserSession.find&.user\n\n return if logged_in?\n\n authenticate_with_http_token do |token, options|\n user = User.find_by(api_token: token)\n return unless user.present?\n\n # Compare the tokens in a time-constant manner, to mitigate timing attacks.\n Current.user = user if ActiveSupport::SecurityUtils.secure_compare(user.api_token, token)\n end\n end", "def find_user(params)\n Rails.application.eager_load!\n user = nil\n ActiveRecord::Base.descendants.select {|model| model < Umanage::User}.each do |umodel|\n user ||= umodel.find_by(email: params[:session][:email].downcase)\n end\n return user\n end", "def first!\n first || raise_record_not_found_exception!\n end", "def find(conditions = EMPTY_HASH)\n new(restricted_relation(conditions))\n end", "def find(id)\n finder_or_run(:find, id)\n end", "def find_service(filter, *required_credentials)\n select(&service?(filter))\n .find(&credentials?(required_credentials))\n end", "def authenticate(attributes={})\n return unless authentication_keys.all? { |k| attributes[k].present? }\n conditions = attributes.slice(*authentication_keys)\n resource = find_for_authentication(conditions)\n resource if resource.try(:valid_for_authentication?, attributes)\n end", "def authenticated_user\n @authenticated_user ||= user(options[:login])\n end", "def first(conditions_or_id={})\n conditions =\n if Hash === conditions_or_id\n conditions_or_id\n else\n if BSON::ObjectId === conditions_or_id\n {'_id' => conditions_or_id}\n else\n {'_id' => BSON::ObjectId.from_string(conditions_or_id)}\n end\n end\n\n if record = collection.find(conditions).first\n self.new(record)\n end\n end", "def find_by(*conditions)\n where(*conditions).take\n end", "def authenticate!\n\n # mapping comes from devise base class, \"mapping.to\" is the class of the model\n # being used for authentication, typically the class \"User\". This is set by using\n # the `devise` class method in that model\n #byebug\n klass = mapping.to\n\n if request.headers['X-HC-FB-AUTH'].present?\n # the returned user object will be saved and serialised into the session\n\n decoded = Base64.decode64(request.headers['X-HC-FB-AUTH'])\n user_and_token = decoded.split(':')\n\n users = klass.includes(:identities).where(socify_identities: { uid: user_and_token[0], token: user_and_token[1], provider: \"facebook\"})\n begin\n if users.size == 1\n u = users.first\n identity = u.identities.find_by!(uid: user_and_token[0], token: user_and_token[1], provider: \"facebook\")\n if !identity.expires_at || (identity.expires_at && identity.expires_at > Time.now)\n success! u\n else\n fail! \"token expired\"\n end\n else\n fail! \"invalid uid and/or token\"\n end\n rescue\n fail!\n end\n end\n\n # if we wanted to stop other strategies from authenticating the user\n end", "def login_from_session\n self.current_<%= singular_name %> = <%= class_name %>.find_authenticated_model_with_id(session[:<%= singular_name %>]) if session[:<%= singular_name %>]\n end", "def find_user\n @user = User.find_by(id: params[:id])\n if @user.nil?\n head :not_found\n return\n end\n end", "def find_user\n return User.all if params[:user_id].nil?\n\n User.find(params[:user_id])\n end", "def find(*arguments)\n scope = arguments.slice!(0)\n options = arguments.slice!(0) || {}\n\n case scope\n when :all then find_every(options)\n when :first then find_every(options).first\n when :last then find_every(options).last\n else find_single(scope)\n end\n end", "def find(id = nil)\n args = [id].compact\n session = new(*args)\n return session if session.find_record\n nil\n end", "def find_single(scope, options)\n return nil if scope.nil?\n old_find_single(scope, options)\n end", "def find_on_conditions(id, conditions)\n find_first(\"#{primary_key} = '#{sanitize(id)}' AND #{sanitize_conditions(conditions)}\") || \n raise(RecordNotFound, \"Couldn't find #{name} with #{primary_key} = #{id} on the condition of #{conditions}\")\n end", "def find_user_by_login(login)\n GoodData::Domain.find_user_by_login(self, login, client: client)\n end", "def find_record_with_callbacks\n run_callbacks(:before_find)\n result = find_record_without_callbacks\n run_callbacks(:after_find) if result\n result\n end", "def find(*args)\n if args[0].is_a?(String) && args[0].length == has_token_id_options[:length]\n record = find_by_token(args[0])\n end\n record || super(*args)\n end", "def authenticated_user\n if session[:user_id].nil?\n return nil\n else\n return User.find(session[:user_id])\n end\n end", "def find_current_user\n user = nil\n unless api_request?\n if session[:user_id]\n # existing session\n user = (User.active.find(session[:user_id]) rescue nil)\n elsif cookies[Redmine::Configuration['autologin_cookie_name']] && Setting.autologin?\n # auto-login feature starts a new session\n user = User.try_to_autologin(cookies[Redmine::Configuration['autologin_cookie_name']])\n session[:user_id] = user.id if user\n user\n elsif params[:format] == 'atom' && params[:key] && accept_key_auth_actions.include?(params[:action])\n # RSS key authentication does not start a session\n user = User.find_by_rss_key(params[:key].to_s)\n end\n end\n if user.nil? && Setting.rest_api_enabled? && api_request?\n if (key = api_key_from_request) && accept_key_auth_actions.include?(params[:action])\n # Use API key\n user = User.find_by_api_key(key.to_s)\n else\n # HTTP Basic, either username/password or API key/random\n authenticate_with_http_basic do |username, password|\n user = User.try_to_login(username, password) || User.find_by_api_key(username)\n end\n end\n # Switch user if requested by an admin user\n if user && user.admin? && (username = api_switch_user_from_request)\n su = User.find_by_login(username)\n if su && su.active?\n logger.info(\" User switched by: #{user.login} (id=#{user.id})\") if logger\n user = su\n else\n render_error :message => 'Invalid X-ChiliProject-Switch-User header', :status => 412\n end\n end\n end\n user\n end", "def logged_in\n found_florist = Florist.where(status: \"Active\").where(company_id: params[\"company_id\"]).first \n if found_florist != nil\n found_user = Employee.where(status: \"Active\").where(florist_id: found_florist.id).where(username: params[\"username\"]).first\n if found_user && found_user.authenticate(params[\"password\"])\n session[\"found_user_id\"] = found_user.id\n session[\"found_florist_id\"] = found_florist.id\n redirect_to home_path and return\n else # do nothing\n end\n end\n render(:login, layout:false) and return\n end", "def auth_options\n # Use Devise's first authentication method (e.g. email or username) to\n # get the sign in parameter\n authn_method = serialize_options(resource)[:methods].first\n authn_value = sign_in_params[authn_method]\n\n # Look for a user matching that email/username\n user = resource_class.find_for_authentication(authn_method => authn_value)\n\n super.merge(\n sign_in_params: sign_in_params.except(\"password\"),\n user: user\n )\n end", "def find_current_user #for madlib/user connection - am i using this?\n @user_found = User.find_by(id: session[:user_id])\n end", "def authenticated_record\n return @__authenticated_record if\n instance_variable_defined? :@__authenticated_record\n @__authenticated_record = begin\n session = ::Session.find\n session && session.record\n end\n end", "def find_user(request, username, password)\n\n end", "def find_with_ferret(q, options = {}, find_options = {})\n if respond_to?(:scope) && scope(:find, :conditions)\n if find_options[:conditions]\n find_options[:conditions] = \"(#{find_options[:conditions]}) AND (#{scope(:find, :conditions)})\"\n else\n find_options[:conditions] = scope(:find, :conditions)\n end\n end\n return ActsAsFerret::find q, self, options, find_options\n end", "def first(conditions = {})\n new(conditions.merge(Connection.get(create_route(:get, conditions)).body['data']))\n end", "def find_user\n @to_find = User.find(params[:id])\n end", "def system_user\n User.find_by('first_name = ? AND last_name = ?', 'system', 'user')\n end", "def find_by_username!\n User.find_by_username!(@username_or_id)\n end", "def find_user\n @user= User.where(id: params[:id]).first\n end", "def field_find(**args)\n # if looking for a specific field, use built-in hash for initial filter,\n # otherwise get all fields.\n fields_in_scope =\n if args[:tag].is_a?(String)\n fields(args[:tag]).dup\n else\n @fields.dup\n end\n fields_in_scope.each { |f| return f if f.meets_criteria?(args) }\n nil\n end", "def find_by_id!\n User.find(@username_or_id)\n end", "def authenticate_by_api_key_in_params\n if api_key = params[:api_key]\n User.where(:api_key => api_key).first\n end\n end", "def authentication_find_options\n {}\n end", "def authenticate(email, password)\n u = first(:email => email)\n u && u.activated? && u.authenticated?(password) ? u : nil\n end", "def user(id_or_username = \"my\", params = {})\n if id_or_username.is_a?(Fixnum) || id_or_username == 'my'\n find_user_by_id id_or_username, params\n else\n find_user_by_username id_or_username, params\n end\n end", "def find_by_oauth2_method\n self.class.find_by_oauth2_method\n end", "def user(user_model = :User, primary_key = :id)\n unless whodunnit.nil?\n \tuser_model.to_s.constantize.find_by(primary_key.to_s.concat(' = ?'), whodunnit)\n end\n end", "def find_for_radius_authentication(authentication_hash)\n uid_field = self.radius_uid_field.to_sym\n username, password = radius_credentials(authentication_hash)\n uid = self.radius_uid_generator.call(username, self.radius_server)\n\n resource = find_for_authentication({ uid_field => uid }) ||\n new(uid_field => uid)\n\n resource.valid_radius_password?(username, password) ? resource : nil\n end", "def method_missing(method_name, *args)\n\n method = method_name.to_s\n\n if method.end_with? '!'\n method.chop!\n error_on_empty = true\n end\n\n if method.start_with? 'find_all_by_'\n attribs = method.gsub /^find_all_by_/, ''\n elsif method.start_with? 'find_by_'\n attribs = method.gsub /^find_by_/, ''\n limit(1)\n elsif method.start_with? 'find_first_by_'\n limit(1)\n find_first = true\n attribs = method.gsub /^find_first_by_/, ''\n elsif method.start_with? 'find_last_by_'\n limit(1)\n find_last = true\n attribs = method.gsub /^find_last_by_/, ''\n else\n super\n end\n\n attribs = attribs.split '_and_'\n conditions = {}\n attribs.each { |attr| conditions[attr] = args.shift }\n\n where(conditions, *args)\n load\n raise RecordNotFound if error_on_empty && @records.empty?\n return @records.first if limit_value == 1\n @records\n end", "def find_by!(*conditions)\n where(*conditions).take!\n end", "def authenticate\n\t\t@authenticatedUser = User.where(:name => params[:user][:Name],:password => params[:user][:Password]).first\n\n\t\t@user = User.new(params[:user])\n\t\tfirst_time = false\n\n\t\tif (User.all.size == 0) && @authenticatedUser.nil? && params[:user][:Name] == \"admin\" && params[:user][:Password] == \"admin\"\n\t \t\t@authenticatedUser = User.new\n\t \t\tfirst_time = true\n\t \tend\n\n\t \tif (not @authenticatedUser.nil?) or first_time\n\t\t\tlogin_ok = is_admin(@authenticatedUser)\n\t\t\n\t\t\tif login_ok or first_time\n\t\t\t\tsession[:currentUser] = @authenticatedUser\n\t\t\t\tredirect_to :action => \"home\"\n\t\t\telse\n\t\t\t\tredirect_to '/login/index', :notice => 'Invalid username or password please try again.'\n\t\t\tend\n\t\telse\n\t\t\tredirect_to '/login/index', :notice => 'Invalid username or password please try again.'\n\t\tend\n\tend" ]
[ "0.8376131", "0.73385286", "0.7232145", "0.6439226", "0.6180954", "0.60416645", "0.59338146", "0.59282655", "0.5896667", "0.587386", "0.5858959", "0.56547666", "0.5654545", "0.56482434", "0.56319886", "0.56121224", "0.55974674", "0.5554522", "0.55490065", "0.55426943", "0.55408835", "0.55408835", "0.55333954", "0.550889", "0.54957104", "0.54909873", "0.5490773", "0.547602", "0.5475105", "0.5468014", "0.54475987", "0.5423939", "0.5402883", "0.5396987", "0.5396987", "0.53952646", "0.539085", "0.53670716", "0.53595465", "0.5358887", "0.53157204", "0.5309042", "0.5288391", "0.52845407", "0.5282002", "0.52813417", "0.5279111", "0.52734625", "0.5266739", "0.52636564", "0.5259626", "0.5259239", "0.5252208", "0.5251209", "0.52495784", "0.52381945", "0.5230113", "0.52260077", "0.5200207", "0.5186905", "0.518288", "0.51729256", "0.5168427", "0.51648647", "0.5163681", "0.51594406", "0.51583534", "0.5150541", "0.51487005", "0.5144222", "0.5134343", "0.5131859", "0.5123804", "0.51155454", "0.5114945", "0.5107797", "0.5107617", "0.51066303", "0.5104973", "0.5099655", "0.5093735", "0.50933886", "0.5088111", "0.50860155", "0.5085691", "0.50802577", "0.5071043", "0.50659657", "0.50653344", "0.50592893", "0.5053222", "0.5051189", "0.5049803", "0.50496995", "0.50414157", "0.50407445", "0.50366217", "0.50288486", "0.5025595", "0.5025358" ]
0.64916086
3
Find or initialize a record setting an error if it can't be found. source://devise//lib/devise/models/authenticatable.rb284
def find_or_initialize_with_error_by(attribute, value, error = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_or_initialize_with_error_by_email(value, error)\n if value.present?\n record = find_by_email(value)\n end\n \n unless record\n record = new\n \n if value.present?\n record.email = value\n else\n error = :blank\n end\n \n record.errors.add(:email, error)\n end\n \n record\n end", "def find_or_initialize_with_error_by(attribute, value, error = :invalid) #:nodoc:\n find_or_initialize_with_errors([attribute], { attribute => value }, error)\n end", "def find_or_initialize_with_errors(required_attributes, attributes, error = :invalid) #:nodoc:\n attributes.try(:permit!)\n attributes = attributes.to_h.with_indifferent_access\n .slice(*required_attributes)\n .delete_if { |key, value| value.blank? }\n\n if attributes.size == required_attributes.size\n record = find_first_by_auth_conditions(attributes) and return record\n end\n\n new(devise_parameter_filter.filter(attributes)).tap do |record|\n required_attributes.each do |key|\n record.errors.add(key, attributes[key].blank? ? :blank : error)\n end\n end\n end", "def find_or_initialize_with_errors(required_attributes, attributes, error = T.unsafe(nil)); end", "def find_or_initialize_identity\n Identity.where(provider: auth.provider, uid: auth.uid).first_or_initialize do |i|\n i.data = auth.to_h\n end\n end", "def find_or_initialize_user\n @user = params[:id] ? User.find(params[:id]) : User.new\n rescue ActiveRecord::RecordNotFound\n redirect_to(\n admin_users_path,\n alert: \"User with ID #{params[:id]} not found!\"\n )\n end", "def find_or_create_err!(attrs)\n Err.where(\n fingerprint: attrs[:fingerprint]\n ).first ||\n problems.create!(attrs.slice(:error_class, :environment)).errs.create!(attrs.slice(:fingerprint, :problem_id))\n end", "def find_or_initialize(id, friendly: false)\n friendly ? friendly_find(id) : model.find(id)\n rescue ::ActiveRecord::RecordNotFound\n model.new\n end", "def find_with_login_instead_of_default(required_attributes={}, attributes={}, error=:invalid)\n resource = nil\n scope_field = self.basecamper[:scope_field]\n login_fields = self.basecamper[:login_fields]\n\n attributes = devise_parameter_filter.filter(attributes)\n\n login_fields.each do |login_field|\n login_field = login_field.downcase.to_sym\n\n resource = to_adapter.find_first({\n login_field => attributes[:login],\n scope_field => attributes[scope_field]\n })\n\n break unless resource.nil?\n end\n\n unless resource\n resource = new\n\n required_attributes.each do |key|\n unless key == self.basecamper[:subdomain_field]\n value = attributes[key]\n resource.send(\"#{key}=\", value)\n resource.errors.add(key, value.present? ? error : :blank)\n end\n end\n end\n\n return resource\n end", "def find_existing_record\n @record = record_class.find(@locator)\n end", "def find_existing_record\n @record = record_class.find(@locator)\n end", "def create_record_for_not_found_response; end", "def record_not_found\n raise ActiveRecord::RecordNotFound\n end", "def find_record\n if record\n self.new_session = false\n return record\n end\n \n find_with.each do |find_method|\n if send(\"valid_#{find_method}?\")\n self.new_session = false\n return record\n end\n end\n nil\n end", "def set_record\n begin\n found_record = Record.find(params[:id])\n @record = found_record\n rescue\n raise ActionController::RoutingError.new('Not Found')\n end\n end", "def set_error\n @error = Error.find(params[:id])\n end", "def set_error\n @error = Error.find(params[:id])\n end", "def set_error\n @error = Error.find(params[:id])\n end", "def set_rails_error\n\n if(self.rails_error_id)\n rails_error = RailsError.find(self.rails_error_id)\n if rails_error != nil\n self.rails_error = rails_error\n return true\n else\n errors.add_to_base(\"value of field: 'rails_error' is invalid- it must be unique\")\n return false\n end\n end\nend", "def set_user_error\n @user_error = UserError.find(params[:id])\n end", "def find_record_by(model)\n raise_must_override\n end", "def find_one\n return super if params[klass.primary_key].present?\n @find_one ||= klass.new_collection_from_result(limit(1).fetch).first\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def get_or_create_rec(params, request)\n if /invalid_credentials/.match(params['message'])\n # invalid credentials failure (from failure callback)\n Rails.logger.error(\"*** invalid credentials\")\n ret = Access.new\n ret.provider = params['strategy']\n ret.errors.add(:base, \"invalid credentials\")\n return ret\n else\n # not a failure callback process it.\n omni_hash = request.env['omniauth.auth']\n provider = params['provider'] rescue nil\n uid = omni_hash[:uid] rescue nil\n email = omni_hash[:info][:email] rescue nil\n # look up this authorization via two scopes, and confirm they are the same record\n matching_uids = Access.match_provider_uid(params['provider'], uid)\n matching_emails = Access.match_provider_email(params['provider'], email)\n # Key consistency checks\n if matching_uids.count == 0 && matching_emails.count == 0\n # no matching records in database, return a new record\n return Access.new\n elsif matching_uids.count == 1 &&\n matching_emails.count == 1 &&\n matching_uids.first.id == matching_emails.first.id\n # record is same from both lookups\n return matching_uids.first\n else\n # mismatched records in database return one with error\n ret = matching_emails.first\n ret.errors.add(:base, \"Mismatched lookups by uid: #{uid.inspect} and email: #{email.inspect}\")\n return ret\n end\n end\n end", "def find_invoice_or_fail(id)\n begin\n invoice = find_invoice(id)\n rescue InvalidInvoiceError => e\n raise Reji::AccessDeniedHttpError, e.message\n end\n\n raise ActiveRecord::RecordNotFound if invoice.nil?\n\n invoice\n end", "def init_by_email(email)\n if email.present?\n where(email: email).first_or_initialize\n else\n new\n end\n end", "def store_invalid_record(record)\n return unless InvalidRecord.table_exists?\n\n invalid_record = InvalidRecord.where(record: record).first\n invalid_record ||= InvalidRecord.new\n invalid_record.record = record\n invalid_record.validation_errors = record.errors.messages\n invalid_record.save!\n end", "def set_contact_error\n @contact_error = ContactError.find(params[:id])\n end", "def find_or_create_user\n\n # create the user \n email = self.accesscode.to_s+\"@shuttlechallenge.ca\"\n user = User.where(email: email).first\n\n if user.nil? # no duplicate users please\n password = self.accesscode\n name = \"#{self.firstname} #{self.lastname}\"\n user = User.new(name: name, email: email, password: password)\n\n \n #create the access object for this user\n user.access = Access.new(code: password)\n\n\n\n #device\n user.device= Device.new(device: self.logger_id)\n user.save!\n\n end\n user\n end", "def database_specific_error_class(exception, opts)\n case exception.errno\n when 1048\n NotNullConstraintViolation\n when 1062\n UniqueConstraintViolation\n when 1451, 1452\n ForeignKeyConstraintViolation\n else\n super\n end\n end", "def find_or_initialize_invoice\n @invoice = Invoice.find_or_initialize_by_survey_id(@survey.id)\n end", "def record_not_found\n ActiveRecord::RecordNotFound\n end", "def find_model(record)\n raise_must_override\n end", "def find_or_create_identity!(auth)\n ident = Identity.from_oauth auth\n\n # Identity already exist. Make sure it's valid...\n if ident.persisted? && ident.user != self\n raise \"Identity is associated with another user (#{ident.user}).\"\n end\n\n ident.user = self\n ident.save!\n ident\n end", "def find_existing_record(klass, obj_hash, importer: nil)\n if klass == User\n # The index for css_id has an odd column name plus find_by_css_id is faster.\n User.find_by_css_id(obj_hash[\"css_id\"])\n elsif klass == Organization\n # The url may need to be converted into a clean url\n Organization.unscoped.find_by_url(obj_hash[\"url\"])\n elsif klass == Appeal\n # uuid is not a uniq index, so can't rely on importer to do it automatically\n Appeal.find_by(uuid: obj_hash[\"uuid\"])\n elsif [Organization, Veteran, Person].include?(klass)\n # Let importer find it using the fallback: klass.unscoped.find_by(unique_field: obj_hash[unique_field])\n nil\n end\n end", "def find_record\n @record ||= model.find_by_id(params[:id])\n end", "def find_person\r\n if (params[:u] == nil || params[:u] == '')\r\n require_login || return\r\n @person = User.current\r\n else\r\n @person = Person.find(params[:u])\r\n end\r\n rescue ActiveRecord::RecordNotFound\r\n render_404\r\n end", "def find_record\n record_id = params[:record_id] || params[:id]\n @record = Record.where(medical_record_number: record_id).first\n raise RequestError.new(404) if @record.nil?\n end", "def get_error(id)\n @error = Error.with_user(session[:user_id]).first!(:id=>id.to_i)\n end", "def safe_obj_by_key!(obj_key)\n safe_obj_by_key(obj_key) or raise ActiveRecord::RecordNotFound\n end", "def init_validation\n @document = Valid.get_association self, :id\n @user = Valid.get_association self, :user_id\n end", "def get_ldap_data\n if Rails.env.production?\n result = LdapHelper::find_user(self.username)\n\n if result\n self.legacy_id ||= result.try(:employeeNumber).try(:first)\n self.first_name ||= result.try(:givenName).try(:first)\n self.last_name ||= result.try(:sn).try(:first)\n self.display_name ||= result.try(:displayName).try(:first)\n self.status ||= result.try(:employeeType).try(:first) || \"potential\"\n self.email ||= result.try(:mail).try(:first) || \"#{username}@fake.me\"\n end\n end\n end", "def find_by_id!(id)\n new(one.find_by_id(id) || raise(RecordNotFound, \"A #{name} record for #{id} does not exist.\"))\n end", "def find_record\n record_id = params[:record_id] || params[:id]\n @record = Record.where(medical_record_number: record_id).first\n not_found if @record.nil?\n end", "def fetch_user_validation_record\n if @user_validation_hash_id > 0\n @user_validation_hash_obj = UserValidationHash.where(id: @user_validation_hash_id).first\n end\n end", "def error\n records\n @config[:error]\n end", "def find_record(item, no_raise: false, meth: nil, **opt)\n # noinspection RubyMismatchedReturnType\n return item if item.nil? || item.is_a?(record_class)\n meth ||= __method__\n record = error = id = nil\n\n id_key = opt.key?(:id_key) ? opt[:id_key] : id_column\n if id_key\n opt.merge!(item) if item.is_a?(Hash)\n opt.reverse_merge!(id_term(item, **opt))\n id = opt[id_key] || opt[alt_id_key(opt)]\n if id && (id_key == id_column)\n record = record_class.find(id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif id\n record = record_class.find_by(id_key => id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n else\n error = \"#{id_key} value given\"\n end\n error &&= \"No #{record_name} #{error}\"\n else\n error = \"#{record_name}: :id_key set to nil\"\n end\n\n if record\n record\n elsif !id\n Log.info { \"#{meth}: #{error} (no record specified)\" }\n raise_failure(:file_id) unless no_raise\n elsif no_raise\n # noinspection RubyMismatchedReturnType\n Log.warn { \"#{meth}: #{error} (skipping)\" }\n else\n Log.error { \"#{meth}: #{error}\" }\n raise_failure(:find, item) unless no_raise\n end\n end", "def set_import_error\n @import_error = current_user.import_errors.find(params[:id])\n end", "def set_user\n @user ||= User.find_by(rfid: params[:id])\n @user ||= User.find_by(id: params[:id])\n raise ActiveRecord::RecordNotFound if @user.nil?\n end", "def find_record(item, no_raise: false, meth: nil, **opt)\n return item if item.nil? || item.is_a?(record_class)\n meth ||= __method__\n record = error = id = sid = nil\n id_key = opt.key?(:id_key) ? opt[:id_key] : id_column\n sid_key = opt.key?(:sid_key) ? opt[:sid_key] : sid_column\n if id_key || sid_key\n opt.merge!(item) if item.is_a?(Hash)\n opt.reverse_merge!(id_term(item, **opt))\n id = id_key && (opt[id_key] || opt[alt_id_key(opt)])\n sid = sid_key && opt[sid_key]\n if valid_sid?(id)\n if sid && (id != sid)\n Log.warn { \"#{meth}: id: #{id.inspect}, but sid: #{sid.inspect}\" }\n end\n id, sid = [nil, id]\n elsif id && sid\n Log.debug do\n \"#{meth}: choosing id: #{id.inspect} over sid: #{sid.inspect}\"\n end\n end\n if id && (id_key == id_column)\n record = record_class.find(id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif id\n record = record_class.find_by(id_key => id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif sid\n record = record_class.find_by(sid_key => sid)\n error = \"for #{sid_key} #{sid.inspect}\" unless record\n else\n error = '%s value given' % [id_key, sid_key].compact.join(' or ')\n end\n error &&= \"No #{record_name} #{error}\"\n else\n error = \"#{record_name}: both :id_key and :sid_key set to nil\"\n end\n if record\n record\n elsif !id && !sid\n Log.info { \"#{meth}: #{error} (no record specified)\" }\n raise_failure(:file_id) unless no_raise\n elsif no_raise\n # noinspection RubyMismatchedReturnType\n Log.warn { \"#{meth}: #{error} (skipping)\" }\n else\n Log.error { \"#{meth}: #{error}\" }\n raise_failure(:find, item) unless no_raise\n end\n end", "def lookup_and_create_account( id )\n\n # lookup locally with the default email\n user = User.find_by_email( User.email_from_cid( id ) )\n return user if user.present?\n\n # if we cannot find them, lookup in LDAP\n user_info = user_info_by_cid( id )\n return nil if user_info.nil?\n\n # now look them up with the located email\n user = User.find_by_email( user_info.email )\n return user if user.present?\n\n # create their account\n return User.new_user( user_info, user_info.email )\n end", "def set_user\n begin\n @user = User.find(params[:id])\n rescue ActiveRecord::RecordNotFound \n user = User.new\n user.errors.add(:id, \"Undefined id\")\n show_error(user, 404) and return\n end\n end", "def assert_record_on_error(e)\n if e.respond_to?(:record) && e.record.present?\n element = to_element(e.record)\n if main_model == element.to_sym && send(element).nil?\n send(\"#{element}=\", e.record)\n end\n end\n end", "def find_record_from_identifier(entity)\n model = entity.model\n user_token = request.headers[\"X-#{model.to_s.upcase}-TOKEN\"]\n super if model != User || user_token.blank?\n model.find_by authentication_token: user_token\n end", "def find_by_unconfirmed_phone_with_errors(attributes = {})\n inactivated_required_attributes = activation_keys.map { |k| k == :phone ? :unconfirmed_phone : k }\n inactivated_attributes = attributes.symbolize_keys\n inactivated_attributes[:unconfirmed_phone] = inactivated_attributes.delete(:phone)\n find_or_initialize_with_errors(inactivated_required_attributes, inactivated_attributes, :not_found)\n end", "def set_initial_data\n @store = @user.stores.first\n @account_types = people_params['account_type'] === \"multiple\" ? @user.account_types.default() : @user.account_types.default().where(kind: people_params['account_type'])\n rescue ActiveRecord::RecordNotFound => e\n render json: {\n error: e.to_s\n }, status: :not_found\n end", "def authenticate_account\n self.password ||= ''\n self.match = Account.find_by_email_address_and_password(self.site_id, self.email_address, self.password)\n if self.match\n self.account_id ||= self.match.id\n end\n end", "def find_one(options = {})\n @find_one ||=\n if primary_key_set?\n without_collection_params { super() }\n else\n klass.new_collection_from_result(limit(1).fetch(options)).first\n end\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "def find_or_initialize(query={}, opts={})\n find_one(query, opts) || new(query, true)\n end", "def peer_auditor\n if self.auditor_id > 0 \n User.find(self.auditor_id)\n else\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end\n rescue\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end", "def find_by_external_authentication_uid(external_authentication_uid)\n finder = table.where(:external_authentication_uid => external_authentication_uid)\n if user_data = execute_sql(:read, :user) { finder.first }\n inflate_model(user_data)\n else\n nil\n end\n end", "def find_or_create_record\n\n #check if the email has already signed up.\n manager_record = Manager.where(email: @email).first\n\n if manager_record.present?\n return validation_error(\n 'am_w_e_2',\n 'invalid_api_params',\n ['email_already_signed_up'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n record = ManagerWhitelisting.where(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n ).first\n\n if record.present?\n return validation_error(\n 'am_w_e_3',\n 'invalid_api_params',\n ['email_already_whitelisted'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n create_response = ManagerWhitelisting.create!(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n )\n\n template_vars = { company_web_domain: CGI.escape(GlobalConstant::CompanyWeb.domain) }\n\n r = ::Email::HookCreator::SendTransactionalMail.new(\n receiver_entity_id: create_response.id,\n receiver_entity_kind: GlobalConstant::EmailServiceApiCallHook.whitelisting_requester_kind,\n template_name: GlobalConstant::PepoCampaigns.platform_whitelisting_done_template,\n template_vars: template_vars).perform\n return r unless r.success?\n\n success\n\n end", "def set_common_error\n @common_error = CommonError.find(params[:id])\n end", "def set_user\n begin\n @user = User.find_by name: params[:id]\n rescue Mongoid::Errors::DocumentNotFound\n begin\n @user = User.find_by email: params[:id]\n rescue Mongoid::Errors::DocumentNotFound\n @user = nil\n end\n end\n end", "def initialize\n @errors = ActiveRecord::Errors.new(self)\n def @errors.[](key) # Return errors in same format as Rails 3.\n Array(on(key))\n end\n end", "def populate_access_rec(rec, params, request)\n omni_hash = request.env['omniauth.auth']\n if rec.new_record?\n # put in key values for new record\n rec.user_id = current_user.id rescue rec.errors.add(:user_id, 'missing current_user.id parameters')\n rec.provider = params['provider']\n rec.uid = omni_hash[:uid] rescue rec.errors.add(:uid, 'missing uid parameters')\n rec.email = omni_hash[:info][:email] rescue rec.errors.add(:email, 'missing [:info][:email] parameters')\n else\n # comparison key values obtained safely\n user_id = current_user.id rescue nil\n provider = params['provider'] rescue nil\n uid = omni_hash[:uid] rescue nil\n email = omni_hash[:info][:email] rescue nil\n # confirm no change in key fields\n rec.errors.add(:user_id, \"does not match #{user_id.inspect}\") if rec.user_id != user_id\n rec.errors.add(:provider, \"does not match #{provider.inspect}e\") if rec.provider != provider\n rec.errors.add(:uid, \"does not match #{uid.inspect}\") if rec.uid != uid\n rec.errors.add(:email, \"does not match #{email.inspect}\")if rec.email != email\n end\n rec.name = omni_hash[:info][:name] rescue rec.errors.add(:name, 'missing [:info][:name] parameters')\n # hack to get omniauth mock to pass the state and code values\n if Rails.env.test?\n omni_params = request.env['omniauth.params']\n rec.state = omni_params['state'] rescue rec.errors.add(:state, 'missing mock state parameters')\n rec.code = omni_params['code'] rescue rec.errors.add(:code, 'missing mock code parameters')\n else\n rec.state = params['state']\n rec.code = params['code']\n end\n rec.expires = omni_hash[:credentials][:expires] rescue nil\n rec.expires_at = nil\n if rec.expires\n # get timestamp from expires_at in unix seconds since epoch ( January 1, 1970 - midnight UTC/GMT )\n expires_at_i = Integer(omni_hash[:credentials][:expires_at]) rescue 0\n rec.expires_at = Time.at(expires_at_i).utc.to_datetime if expires_at_i > 0\n end\n rec.token = omni_hash[:credentials][:token] rescue rec.errors.add(:name, 'missing [:credentials][:token] parameters')\n rec.refresh_token = omni_hash[:credentials][:refresh_token] rescue nil # OK if no refresh token\n rec. omni_hash = omni_hash\n return rec\n end", "def set_daw_log_error\n @daw_log_error = DawLogError.find(params[:id])\n end", "def initialize(user, record)\n raise Pundit::NotAuthorizedError, \"Must be signed in.\" unless user\n @user = user\n @record = record\n end", "def find_or_create_for_omniauth auth, &block\n email = auth.info.email\n # This is just a placeholder for indexes and validations etc.\n # (twitter doesn't give us an email)\n email ||= \"#{auth.info.nickname || auth.uid}@#{auth.provider}.auth\"\n\n user = find_for_omniauth auth\n user ||= find_or_initialize_by email: email\n\n user.omniauth!(auth, &block) and user\n end", "def first!\n first || raise_record_not_found_exception!\n end", "def create_or_find_user\n User.find_or_create_by(provider: auth_hash['provider'], uid: auth_hash['uid']) do |user|\n user.email = auth_hash['info']['email']\n user.name = auth_hash['info']['name']\n user.username = auth_hash['extra']['raw_info']['login']\n user.public_repos = auth_hash['extra']['raw_info']['public_repos']\n end\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def find_for_authentication(tainted_conditions)\n find_first_by_auth_conditions(tainted_conditions)\n end", "def set_extractor_error\n @extractor_error = ExtractorError.find(params[:id])\n end", "def resolve(email:, password:)\n user = User.create!(email: email, password: password)\n { user: user }\n rescue ActiveRecord::RecordInvalid => e\n GraphQL::ExecutionError.new(\"Invalid input: #{e.record.errors.full_messages.join(', ')}\")\n # {\n # user: user,\n # errors: []\n # }\n # if user.save\n # {\n # user: user,\n # errors: []\n # }\n # else\n # {\n # user: nil,\n # errors: user.errors.full_messages\n # }\n # end\n end", "def create!\n self.save\n self.set_lookup(:login) if self.is_a?(User)\n :ok\n end", "def find_for_authentication(conditions)\n if ( login = conditions[:email] ).present?\n if login =~ /@/\n find_by_email(login)\n else\n find_by_slug(login)\n end\n else\n super\n end\n end", "def set_account\n @account = Account.find(params[:id]) or not_found\n end", "def person\n @person ||= Person.find_or_initialize_by email: @auth[:info][:email] do |p|\n if %i(first_name last_name).all? { |f| @auth[:info].key? f }\n # If the oauth provider gave us first and last name, use them\n p.first_name = @auth[:info][:first_name]\n p.last_name = @auth[:info][:last_name]\n else\n p.name = @auth[:info][:name]\n end\n end\n end", "def user_attributes=(attrs)\n self.user = User.where(attrs).first_or_initialize(attrs) \n @show_exists_message = !user.new_record?\n end", "def load_alert_record(redirect = true)\n if (params[:id].blank?)\n @alert_record = nil\n return @alert_record\n end\n\n @alert_record = AlertRecord.where(:_id => params[:id]).first\n\n if (@alert_record.blank? && redirect)\n # If not found, show an error and redirect\n flash[:error] = t(\"alerts.error.record_not_found\")\n redirect_to alert_records_path()\n end\n\n return @alert_record\n end", "def find_email\n val = @email\n return if val.nil? \n val = LdapQuery::Scanner.search(val).as_user_attributes[:email] \n if val.nil?\n errors.add :base, 'Email address not found'\n return false\n end\n @email = val\n xdelegate = User.find_by_email(val.to_s)\n if xdelegate.nil?\n errors.add :base, 'Email does not have an account on this website'\n return false\n else\n self.delegate_user_id = xdelegate.id\n end\n\n end", "def find_record(xero_id)\n raise_must_override\n end", "def find(id)\n Infopark::Crm::Contact.find(id)\n rescue ActiveResource::ResourceNotFound\n raise UserNotFound.new\n end", "def user_for_login!(login)\n begin\n if !@user_by_login.has_key?(login)\n @user_by_login[login] = User.find_by_login!(login)\n end\n rescue ActiveRecord::RecordNotFound\n if params[:use_anonymous]\n @user_by_login[login] = User.anonymous()\n else\n @unfound_class = \"User\"\n @unfound_key = login\n raise\n end\n end\n @user_by_login[login]\n end", "def set_error_log\n @error_log = current_user.error_logs.where(id: params[:id]).first\n end", "def lookup_on_error\n\n if h.on_error\n\n self\n\n elsif h.parent_id\n\n par = parent\n # :( get_parent would probably be a better name for #parent\n\n unless par\n puts \"~~\"\n puts \"parent gone for\"\n p h.fei\n p h.parent_id\n p tree\n puts \"~~\"\n end\n\n par ? par.lookup_on_error : nil\n\n else\n\n nil\n end\n end", "def ldap_before_save\n self.email = Devise::LDAP::Adapter.get_ldap_param(username, 'mail').first\n end", "def set_recordfile\n @recordfile = Recordfile.find_by_web_id(params[:id])\n raise ActiveRecord::RecordNotFound unless @recordfile\n end", "def set_user(params)\n User.where(params).first_or_initialize\n end", "def set_account\n\t # I made changes to this so if something broke, check here first\n\t if params[:id] != nil\n @account = Account.find(params[:id])\n\t elsif params[:account] != nil\n\t @account = Account.find(params[:account][:id])\n\t end\n\t rescue ActiveRecord::RecordNotFound\n redirect_to \"/home/index\"\n end", "def find_user\n @user = User.find_from_param(params[:user_id])\n rescue ActiveRecord::RecordNotFound\n redirect_to '/' \n end", "def prepare_find\n raise Error.new('Cannot find an event without an ID') if id.blank?\n self\n end", "def validate(record)\n if record._database_validations_fallback\n super\n else\n return unless record.public_send(foreign_key).blank? && record.public_send(association).blank?\n\n record.errors.add(association, :blank, message: :required)\n end\n end", "def find_by_token!(token)\n record = find_by_token(token)\n raise ActiveRecord::RecordNotFound, \"Could not find #{self.name} with token #{token.inspect}\" if record.nil?\n record\n end", "def find_user\n self.user_lookup_failed = false\n unless self.user_ids.blank?\n my_users = User.scoped.extending(QueryHelper::WhereIn).where_in('id', self.user_ids)\n unless my_users.blank?\n self.users = my_users\n else\n self.user_lookup_failed = true\n end\n end\n # be sure the call back returns true or else the call will fail with no error message\n # from the validation loop\n return true\n end", "def fill_mandatory_attributes(record, new_record)\n record[:usr_id] = $DB[\"SELECT nextval('users_usr_id_seq') as id\"].first[:id] if new_record\n record[:usr_screen_name] ||= \"userX#{$cntr+=1}\"\n\n if new_record\n [:usr_firstname, :usr_lastname].each do |col|\n record[col] = \"tmp_placeholder\"\n LOGGER.warn \"No #{col} for existing record: #{record[:usr_id]}\"\n end\n end\nend", "def set_missing_person\n @missing_person = MissingPerson.find(params[:id])\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def authenticate(username_or_email, password)\n user = PublicEarth::Db::User.new\n if username_or_email.blank?\n user.errors.add_to_base(\"NO_USERNAME\")\n elsif password.blank?\n user.errors.add_to_base(\"NO_PASSWORD\")\n else\n existing = find_by_username_or_email(username_or_email)\n if existing\n if active?(existing.id)\n begin\n user.attributes = one.authenticate(username_or_email, password)\n user.authenticated = true\n rescue\n user.errors.add(:username, \"INVALID_PASSWORD\")\n end\n else\n user.errors.add_to_base(\"UNCONFIRMED\")\n end\n else\n user.errors.add_to_base(\"INVALID_ACCOUNT\")\n end\n end\n user\n end", "def load_user\n if (params[:id].blank?)\n @user = nil\n return @user\n end\n\n @user = User.where(:_id => params[:id]).first\n\n if (@user.blank?)\n # If not found, show an error and redirect\n flash[:error] = t(\"users.error.not_found\")\n redirect_to users_path()\n end\n\n return @user\n end" ]
[ "0.6865253", "0.68158925", "0.67669266", "0.6545734", "0.6322297", "0.62069666", "0.5981765", "0.5978297", "0.57525104", "0.57500273", "0.57500273", "0.56879693", "0.5464216", "0.5460448", "0.5425983", "0.54112273", "0.5399895", "0.5399895", "0.53956604", "0.53820455", "0.53755647", "0.535502", "0.53504884", "0.53362477", "0.5333499", "0.5330909", "0.53271013", "0.53215414", "0.5293732", "0.5290289", "0.5286428", "0.5259738", "0.525951", "0.523996", "0.5229366", "0.5201179", "0.518957", "0.51805097", "0.51692367", "0.5160049", "0.5127131", "0.51023805", "0.5095321", "0.5084246", "0.5077115", "0.50724834", "0.505697", "0.5043994", "0.5043434", "0.5042751", "0.5042397", "0.5034287", "0.50269985", "0.50001454", "0.49975365", "0.4996336", "0.49944982", "0.49922502", "0.49909416", "0.49866548", "0.4976911", "0.4972579", "0.49648246", "0.49626434", "0.49584648", "0.49579996", "0.4945085", "0.49439904", "0.49411106", "0.49390098", "0.49380118", "0.49367812", "0.49347907", "0.4933484", "0.49294305", "0.49214357", "0.4920856", "0.49159294", "0.49148807", "0.49136135", "0.49126118", "0.4909345", "0.4908908", "0.49056122", "0.49055773", "0.4901395", "0.490063", "0.48934937", "0.4891493", "0.48914394", "0.48747367", "0.48746687", "0.48682845", "0.4864852", "0.48634362", "0.48615628", "0.48588556", "0.48540863", "0.48428798", "0.48340818" ]
0.6838537
1
Find or initialize a record with group of attributes based on a list of required attributes. source://devise//lib/devise/models/authenticatable.rb289
def find_or_initialize_with_errors(required_attributes, attributes, error = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_or_initialize_with_errors(required_attributes, attributes, error = :invalid) #:nodoc:\n attributes.try(:permit!)\n attributes = attributes.to_h.with_indifferent_access\n .slice(*required_attributes)\n .delete_if { |key, value| value.blank? }\n\n if attributes.size == required_attributes.size\n record = find_first_by_auth_conditions(attributes) and return record\n end\n\n new(devise_parameter_filter.filter(attributes)).tap do |record|\n required_attributes.each do |key|\n record.errors.add(key, attributes[key].blank? ? :blank : error)\n end\n end\n end", "def find_with_login_instead_of_default(required_attributes={}, attributes={}, error=:invalid)\n resource = nil\n scope_field = self.basecamper[:scope_field]\n login_fields = self.basecamper[:login_fields]\n\n attributes = devise_parameter_filter.filter(attributes)\n\n login_fields.each do |login_field|\n login_field = login_field.downcase.to_sym\n\n resource = to_adapter.find_first({\n login_field => attributes[:login],\n scope_field => attributes[scope_field]\n })\n\n break unless resource.nil?\n end\n\n unless resource\n resource = new\n\n required_attributes.each do |key|\n unless key == self.basecamper[:subdomain_field]\n value = attributes[key]\n resource.send(\"#{key}=\", value)\n resource.errors.add(key, value.present? ? error : :blank)\n end\n end\n end\n\n return resource\n end", "def fill_mandatory_attributes(record, new_record)\n record[:usr_id] = $DB[\"SELECT nextval('users_usr_id_seq') as id\"].first[:id] if new_record\n record[:usr_screen_name] ||= \"userX#{$cntr+=1}\"\n\n if new_record\n [:usr_firstname, :usr_lastname].each do |col|\n record[col] = \"tmp_placeholder\"\n LOGGER.warn \"No #{col} for existing record: #{record[:usr_id]}\"\n end\n end\nend", "def create_or_update_by_some( attrs={} )\n attrs = extract_ar_object_ids( attrs )\n conditions = attrs.delete( :find_by )\n raise 'You must provide a :find_by hash of attributes to search with, ie. :find_by => {:id => 1}' unless conditions\n attrs.merge!( conditions )\n record = find( :first, :conditions => conditions ) || self.new\n record.attributes = attrs\n record.save!\n record\n end", "def valid_user_attributes(options = {})\n { :login => 'fred',\n :email => '[email protected]',\n :site_id => 1\n }.merge(options)\nend", "def find_or_initialize_identity\n Identity.where(provider: auth.provider, uid: auth.uid).first_or_initialize do |i|\n i.data = auth.to_h\n end\n end", "def find_or_initialize_by(attrs = {}, &block)\n find_or(:new, attrs, &block)\n end", "def assign_attributes(attributes)\n super filter_attributes(attributes, Account.attribute_list)\n assign_attributes_for(attributes, User, :current_user)\n assign_attributes_for(attributes, Company, :company)\n assign_attributes_for(attributes, AccountType, :account_type)\n end", "def generate_attributes_from_ldap_info\n self.username = self.uid\n self.email = self.mail\n end", "def fill_required_fields(record) \n record.class.validators.select { |v| v.is_a? ActiveModel::Validations::PresenceValidator }.each do |validator|\n validator.attributes.each do |attribute|\n fill_field(record, attribute)\n end\n end\n end", "def user_attributes=(attrs)\n self.user = User.where(attrs).first_or_initialize(attrs) \n @show_exists_message = !user.new_record?\n end", "def initialize(attributes = {})\n super filter_attributes(attributes, Account.attribute_list)\n self.current_user = User.new(filter_attributes(attributes, User.attribute_list)) if current_user.nil?\n return if account_type.present?\n\n self.account_type = AccountType.new(filter_attributes(attributes, AccountType.attribute_list))\n end", "def attributes\n [\n {\n ldap_uid: enrolled_student_login_id,\n student_id: enrolled_student_student_id,\n first_name: 'First Name',\n last_name: 'Last Name',\n email_address: \"#{enrolled_student_login_id}@example.com\"\n },\n {\n ldap_uid: waitlisted_student_login_id,\n student_id: waitlisted_student_student_id,\n first_name: 'First Wait',\n last_name: 'Last Wait',\n email_address: \"#{waitlisted_student_login_id}@example.com\"\n },\n {\n ldap_uid: another_enrolled_login_id,\n student_id: another_enrolled_student_id,\n first_name: 'Another Name',\n last_name: 'One Last Name',\n email_address: \"#{another_enrolled_login_id}@example.com\"\n }\n ]\n end", "def new_from_hash_w_constraints model_hash, constraints\n\n logger.debug(model_hash.inspect)\n #logger.debug(active_scaffold_constraints.inspect)\n #logger.debug(session[:last_data_entry_constraints].inspect)\n\n # overwrite values with constrained values for this record\n unless constraints.nil? || constraints.empty?\n model_hash.merge! constraints\n end\n\n logger.debug(model_hash.inspect)\n\n klass = controller_model_class\n couldnt_find_models = {} # any fields that held id's\n # where, when we looked in the database for them,\n # no matching record was found\n\n model_hash.each do |k,v|\n\n # TODO remove dirty hack\n # is this field an association or regular column?\n # model should be responsible for knowing what field to look for,\n # right now we assume all have a name\n association_class = klass.reflect_on_association(k.to_sym).try :klass\n\n if association_class # if column is an association column\n value_as_id = v.try(:to_i) #is the value an id or a name?\n attempted_find_method = :find_by_name\n if value_as_id != 0 # if it is an id\n attempted_find_method = :find\n v = value_as_id\n end\n\n # TODO catch if we can't find the id\n # thing is we don't, at the moment, have users read in files with id's\n # only give in id's from constraints made in the controllers\n associated_object = association_class.send(attempted_find_method, v)\n\n if associated_object\n model_hash[k] = associated_object\n else\n couldnt_find_models[k]={:association => k,\n :raw_value => model_hash.delete(k), :cleaned_value => v}\n end\n\n end\n end\n record = klass.new model_hash\n def record.association_lookup_errors #use for error handling later\n couldnt_find_models\n end\n if record.respond_to?(:data_response=)\n record.data_response = current_user.current_data_response\n end\n record\n end", "def init_optional_attributes\n self.doi ||= record.doi if record.doi.present?\n self.pmid ||= record.pmid if record.pmid.present?\n end", "def initialize(params)\n require_keys([:firstName, :lastName, :email, :password], params)\n merge!(params)\n end", "def initialize_attributes(attributes); end", "def filter_attributes(attrs)\n attributes = attrs.each_with_object({}) do |name, inst|\n next unless validates?(name)\n inst[name] = get_field(name)\n end\n\n optional_fields = _optional\n if optional_fields.present?\n optional_fields.each do |field|\n next unless validates?(field)\n attributes[field] = get_field(field)\n end\n end\n\n associated_fields = _associations\n if associated_fields.present?\n associated_fields.each do |assoc|\n next unless validates?(assoc)\n attributes[assoc] = get_association(assoc)\n end\n end\n\n attributes\n end", "def login_attributes\n attrs = {}\n\n attr_pairs = [\n {\"userName\" => @user_name},\n {\"suspended\" => @suspended},\n {\"ipWhitelisted\" => @ip_whitelisted},\n {\"admin\" => @admin},\n {\"changePasswordAtNextLogin\" => @change_password_at_next_login},\n {\"agreedToTerms\" => @agreed_to_terms},\n {'password' => @password},\n {'hashFunctionName' => @hash_function_name},\n ]\n\n attr_pairs.each do |pair|\n key = pair.keys.first\n attrs.merge!(pair) unless pair[key].nil?\n end\n\n attrs\n end", "def find_with(*values)\n if values.blank?\n read_inheritable_attribute(:find_with) || find_with(:session, :cookie, :params, :http_auth)\n else\n values.flatten!\n write_inheritable_attribute(:find_with, values)\n end\n end", "def set_attributes_from_form_parameters params\n self.uid = params[:uid]\n self.uidNumber = params[:uidNumber]\n self.gidNumber = IEConfig::LDAP::Group.id_from_group_name(params[:group])\n self.mail = [params[:uid], IEConfig::LDAP::Domain].join('@')\n self.gecos = params[:gecos]\n self.cn = self.sn = params[:cn]\n self.ou = params[:group]\n self.homeDirectory = ['', 'home' , self.ou, self.uid].join('/')\n self.userPassword = ActiveLdap::UserPassword.md5(params[:password])\n self.userPassword_confirmation = ActiveLdap::UserPassword.md5(params[:password])\n self.dn = [\"uid=#{self.uid}\", \"ou=#{self.ou}\", IEConfig::LDAP::BaseDN].join(',')\n set_samba_attributes(self.uidNumber , params[:password])\n set_default_attributes\n return self\n end", "def find_or_create_by(attributes, &block)\n result = find_or_initialize_by(attributes, &block)\n result.save! unless result.persisted?\n result\n end", "def initialize(fields)\n set_attributes fields['email']\n end", "def initialize(attributes={})\n super(*DEFAULTS.merge(attributes).values_at(*members))\n\n validate!\n end", "def find_or_create_by(attributes)\n find_by(attributes) || create(attributes)\n end", "def valid_attributes\n {\n :user_id=> 1 ,\n :credit_card_no =>\"1234567812345678\",\n :billing_address =>\"MyText\" ,\n :zipcode =>12345\n }\n end", "def default_permissions_attributes_with_uniqueness=(attributes_collection)\n if attributes_collection.is_a? Hash\n keys = attributes_collection.keys\n attributes_collection = if keys.include?('id') || keys.include?(:id)\n Array(attributes_collection)\n else\n attributes_collection.sort_by { |i, _| i.to_i }.map { |_, attributes| attributes }\n end\n end\n\n attributes_collection.each do |prop|\n existing = case prop[:type]\n when 'group'\n search_by_type(:group)\n when 'person'\n search_by_type(:person)\n end\n\n next unless existing\n selected = existing.find { |perm| perm.agent_name == prop[:name] }\n prop['id'] = selected.id if selected\n end\n\n self.default_permissions_attributes_without_uniqueness=attributes_collection\n end", "def restrict_fields\n\n allowed_fields=User.new.attributes.keys\n @fields=allowed_fields & (params[:fields] || \"\").split(\",\")\n if @fields.present?\n @[email protected](@fields) \n else\n @fields=allowed_fields\n end \n end", "def populate_access_rec(rec, params, request)\n omni_hash = request.env['omniauth.auth']\n if rec.new_record?\n # put in key values for new record\n rec.user_id = current_user.id rescue rec.errors.add(:user_id, 'missing current_user.id parameters')\n rec.provider = params['provider']\n rec.uid = omni_hash[:uid] rescue rec.errors.add(:uid, 'missing uid parameters')\n rec.email = omni_hash[:info][:email] rescue rec.errors.add(:email, 'missing [:info][:email] parameters')\n else\n # comparison key values obtained safely\n user_id = current_user.id rescue nil\n provider = params['provider'] rescue nil\n uid = omni_hash[:uid] rescue nil\n email = omni_hash[:info][:email] rescue nil\n # confirm no change in key fields\n rec.errors.add(:user_id, \"does not match #{user_id.inspect}\") if rec.user_id != user_id\n rec.errors.add(:provider, \"does not match #{provider.inspect}e\") if rec.provider != provider\n rec.errors.add(:uid, \"does not match #{uid.inspect}\") if rec.uid != uid\n rec.errors.add(:email, \"does not match #{email.inspect}\")if rec.email != email\n end\n rec.name = omni_hash[:info][:name] rescue rec.errors.add(:name, 'missing [:info][:name] parameters')\n # hack to get omniauth mock to pass the state and code values\n if Rails.env.test?\n omni_params = request.env['omniauth.params']\n rec.state = omni_params['state'] rescue rec.errors.add(:state, 'missing mock state parameters')\n rec.code = omni_params['code'] rescue rec.errors.add(:code, 'missing mock code parameters')\n else\n rec.state = params['state']\n rec.code = params['code']\n end\n rec.expires = omni_hash[:credentials][:expires] rescue nil\n rec.expires_at = nil\n if rec.expires\n # get timestamp from expires_at in unix seconds since epoch ( January 1, 1970 - midnight UTC/GMT )\n expires_at_i = Integer(omni_hash[:credentials][:expires_at]) rescue 0\n rec.expires_at = Time.at(expires_at_i).utc.to_datetime if expires_at_i > 0\n end\n rec.token = omni_hash[:credentials][:token] rescue rec.errors.add(:name, 'missing [:credentials][:token] parameters')\n rec.refresh_token = omni_hash[:credentials][:refresh_token] rescue nil # OK if no refresh token\n rec. omni_hash = omni_hash\n return rec\n end", "def set_attributes(email,password,first_name,last_name)#called by sign_in api in apis controller\n self.email = email\n self.password = password\n self.first_name = first_name\n self.last_name = last_name\n self.save\n end", "def search_attributes\n\t\t['dn', self.attr_firstname, self.attr_lastname, self.attr_mail, self.attr_member]\n\tend", "def valid_attributes\n { email: valid_user.email, password: valid_user.password }\n end", "def add_default_attributes\n self.id_number ||= (self.class.where(['school_id = ?', school_id]).maximum('id_number') || 0) + 1\n (authorization || build_authorization).add_default_attributes(self)\n end", "def create_or_find_user\n User.find_or_create_by(provider: auth_hash['provider'], uid: auth_hash['uid']) do |user|\n user.email = auth_hash['info']['email']\n user.name = auth_hash['info']['name']\n user.username = auth_hash['extra']['raw_info']['login']\n user.public_repos = auth_hash['extra']['raw_info']['public_repos']\n end\n end", "def build_lookup_belongs(blank = nil)\n # TODO: Remove rescue statement\n @departments = Department.find_all_for_select_option(blank) rescue [['ERROR','']]\n @users = User.find_all_for_select_option(blank) rescue [['ERROR','']]\n @privacies = [[print_words('private').capitalize_words,false],[print_words('public').capitalize_words,true]]\n \n @addressbook_groups = AddressbookGroup.find_all_for_select_option(blank) rescue [['ERROR','']]\n \n end", "def attributes\n { 'username' => nil, 'work_place_refno' => nil, 'party_refno' => nil, 'user_roles' => nil,\n 'password_change_required' => nil, 'password_expiry_date' => nil, 'user_is_signed_ta_cs' => nil }\n end", "def add_params_from_model_by_request_param_keys(model, request_papram_keys)\n if request_papram_keys.class == Array\n model.attributes.each do |attribute_name, attribute_value|\n if request_papram_keys.include?(attribute_name)\n self[attribute_name] = attribute_value\n end\n end\n end\n end", "def initialize_vars\n \n @auth_user_class = Auth.configuration.user_class.constantize\n\n @auth_user_params = permitted_params.fetch(:user,{}) \n\n @auth_user = params[:id] ? @auth_user_class.find_self(params[:id],current_signed_in_resource) : @auth_user_class.new(@auth_user_params)\n \n end", "def authenticate(attributes={})\n return unless authentication_keys.all? { |k| attributes[k].present? }\n conditions = attributes.slice(*authentication_keys)\n resource = find_for_authentication(conditions)\n resource if resource.try(:valid_for_authentication?, attributes)\n end", "def find_or_create_by!(attributes, &block)\n find_by(attributes) || create!(attributes, &block)\n end", "def valid_user_attributes(add_attributes={})\n\t{\n\t\t:username => \"Jarqueline\",\n\t\t:password => \"Jarqueli42\"\n\t\t\n\t}.merge(add_attributes)\n\tend", "def user_param_keys(include_virtual_attributes = true)\n include_virtual_attributes ? [:first_name, :last_name, :email, :password, :role] : [:first_name, :last_name, :email, :role]\n end", "def attributes_protected_by_default\n begin\n default = [primary_key, inheritance_column]\n\n if !primary_key.eql?('id')\n default << 'id'\n end\n rescue ActiveRecord::NoDatabaseError\n default = []\n end\n\n return default\n end", "def fill_from_ldap\n person = self.ldap_person\n if person.nil?\n if Rails.development?\n self.name = \"Susan #{self.login}\"\n self.email = \"beehive+#{self.login}@berkeley.edu\"\n self.major_code = 'undeclared'\n self.user_type = case self.login\n when 212388, 232588\n User::Types::Grad\n when 212381, 300846, 300847, 300848, 300849, 300850\n User::Types::Undergrad\n when 212386, 322587, 322588, 322589, 322590\n User::Types::Faculty\n when 212387, 322583, 322584, 322585, 322586\n User::Types::Staff\n else\n User::Types::Affiliate\n end\n return true\n else\n self.name = 'Unknown Name'\n self.email = ''\n self.major_code = ''\n self.user_type = User::Types::Affiliate\n return false\n end\n else\n self.name = \"#{person.firstname} #{person.lastname}\".titleize\n self.email = person.email\n self.major_code = person.berkeleyEduStuMajorName.to_s.downcase\n self.user_type = case\n when person.berkeleyEduStuUGCode == 'G'\n User::Types::Grad\n when person.student?\n User::Types::Undergrad\n when person.employee_academic?\n User::Types::Faculty\n when person.employee?\n User::Types::Staff\n else\n User::Types::Affiliate\n end\n return true\n end\n end", "def from_join_params(params)\n self.first_name = params[:user_profile_attributes][:first_name]\n self.last_name = params[:user_profile_attributes][:last_name]\n self.card_number = params[:order][:card_number]\n self.card_verification = params[:order][:card_verification]\n self.ip_address = params[:request_ip]\n self.address = params[:user_profile_attributes][:address_street]\n self.city = params[:user_profile_attributes][:address_city]\n self.state = params[:user_profile_attributes][:address_state]\n self.zip = params[:user_profile_attributes][:address_zip]\n self.country = params[:user_profile_attributes][:address_country]\n self.amount = DEFAULT_PRICE\n self.card_expires_on = Chronic.parse(params[:order][:card_expires_on]).end_of_month rescue nil\n self.name = \"#{first_name} #{last_name}\"\n end", "def find_or_create_by(attrs = {}, &block)\n find_or(:create, attrs, &block)\n end", "def initialize_fields\n publisher.build if publisher.empty?\n contributor.build if contributor.empty?\n creator.build if creator.empty?\n identifier.build if identifier.empty?\n description.build if description.empty?\n super\n end", "def initialize(attributes = {}, persisted = false)\n attributes = attributes[0] if attributes.kind_of? Array\n self.contact_lists = attributes.delete(:list_ids) if attributes.has_key? :list_ids \n obj = super\n obj.set_defaults\n obj\n end", "def find_or_create_via_omniauth(attributes, existing_user=nil)\n identity = lookup(attributes[:uid], attributes[:provider])\n if(identity)\n Fission::Data.logger.info \"Found existing identity: #{identity.inspect}\"\n else\n Fission::Data.logger.info \"No existing identity found! Creating new user: #{attributes[:uid]}\"\n source = Source.find_or_create(:name => attributes[:provider])\n username = attributes[:info].try(:[], :nickname) ||\n attributes[:info].try(:[], :login) ||\n attributes[:info].try(:[], :email) ||\n unique_id\n user = User.find_by_username(username)\n unless(user)\n user = User.new(:username => username)\n user.run_state.identity_provider = attributes[:provider]\n user.source = source if source\n user.save\n end\n identity = Identity.new\n identity.user = user\n end\n identity.provider = attributes[:provider]\n identity.uid = attributes[:uid]\n identity.extras = attributes[:extras]\n identity.credentials = attributes[:credentials]\n identity.infos = attributes[:info]\n identity.source = source if source\n # Set login time\n identity.user.session[:login_time] = Time.now.to_f\n identity.user.save_session\n unless(identity.save)\n Fission::Data.logger.error identity.errors.inspect\n raise identity.errors unless identity.save\n end\n identity\n end", "def valid_attributes\n {\n \"oaipmh_repositoryName\" => \"test repositoryName\",\n \"oaipmh_adminEmail\" => \"[email protected]\",\n \"rifcs_group\" => \"test group\",\n \"rifcs_originatingSource\" => \"test originatingSource\",\n }\n end", "def initialize(attrs = {})\n @attrs = HashWithIndifferentAccess.new\n\n for k, v in (attrs || {}) do\n if ALLOWED[v]\n @attrs[k] = v\n end\n end\n end", "def initialize(attrs = {})\n @attributes = {}.with_indifferent_access\n process(defaults.merge(attrs))\n @new_record = true if id.nil?\n generate_key\n end", "def find_or_create_by(attributes, &block)\n find_by(attributes) || create(attributes, &block)\n end", "def cas_extra_attributes=(extra_attributes)\n extra_attributes.each do |name, value|\n puts \"DEBUG: cas_extra_attributes CALLED\"\n puts \"extra_attributes:\"+ name.to_s+\" => \"+ value.to_s\n case name.to_sym\n when :fullname\n self.fullname = value\n when :email\n self.email = value\n end\n end\n end", "def openid_fields=(fields)\n fields.each do |key, value|\n if value.is_a? Array\n value = value.first\n end\n case key.to_s\n when \"email\", \"http://axschema.org/contact/email\"\n self.email = value\n end\n end\n # If user already exists with that email, we just update that user instead\n if user = User.find_by_email(self.email)\n user.update_attribute(:identity_url, self.identity_url)\n # Overtake attributes from existing user, as we can't change self\n self.id = user.id\n else\n # If we are a new user ...\n if self.new_record?\n if self.email.present?\n # Create this user\n self.save!\n else\n # Don't allow this user to be created\n self.email = nil\n end\n end\n end\n end", "def merge_identities(user, auth)\n if auth.info[:first_name] && !user.first_name.present?\n user.first_name = auth.info[:first_name]\n end\n\n if auth.info[:last_name] && !user.last_name.present?\n user.last_name = auth.info[:last_name]\n end\n\n if auth.info[:email] && !user.email.present?\n user.email = auth.info[:email]\n end\n\n create_new_identity(user,auth)\n end", "def find_by_attributes\n Hash[@ucrm_local_id_field, id]\n end", "def initialize_attributes()\n @attributes ||= {}\n merged_attributes = {}\n defaults = self.class.schema.defaults(self)\n\n # Merge the defaults in where attributes don't have a value defined.\n defaults.each do |name, value|\n merged_attributes[name] = attributes[name] || value\n end\n @attributes = merged_attributes\n end", "def first_or_initialize(attrs = nil, &block)\n first_or(:new, attrs, &block)\n end", "def set_base_attributes_by_lookup attributes_hash\n searchable_type = self.class.base_name.demodulize.downcase \n initialize_base_attributes_getters attributes_hash[ searchable_type ]\n end", "def optional_attributes\n [:student_number, :state_id, :location, :gender, :dob, :grade, :frl_status,\n :race, :hispanic_ethnicity, :email, :credentials]\n end", "def find_or_create_user\n\n # create the user \n email = self.accesscode.to_s+\"@shuttlechallenge.ca\"\n user = User.where(email: email).first\n\n if user.nil? # no duplicate users please\n password = self.accesscode\n name = \"#{self.firstname} #{self.lastname}\"\n user = User.new(name: name, email: email, password: password)\n\n \n #create the access object for this user\n user.access = Access.new(code: password)\n\n\n\n #device\n user.device= Device.new(device: self.logger_id)\n user.save!\n\n end\n user\n end", "def valid_attributes\n {\n username: \"test_user\",\n full_name: \"Test User\",\n email: \"[email protected]\",\n password: \"test123\",\n password_confirmation: \"test123\"\n }\n end", "def init_validation\n @user = Valid.get_association(self, :user_id)\n @mailing_list_group = Valid.get_association self, :id\n end", "def create_parameters\n {\n record.id_attribute => record.id\n }.tap do |params|\n custom_attrs = attribute_names.inject({}) do |memo, attr|\n value = record.send(attr)\n memo[attr.to_s] = value if value\n memo\n end\n params.merge! custom_attrs\n params[\"ownerid\"] = record.owner.roleid if record.owner\n end\n end", "def update_accessors_from_attributes(attributes)\n if attributes[:guests]\n # Clear existing accessors and add selected ones\n clear_accessors\n attributes[:guests].each do |guest_id|\n if g = Guest.find(guest_id.to_i)\n authorize_for_user(g, g.current_circle)\n end\n end\n end\n if attributes[:circles]\n attributes[:circles].each do |circle_id|\n if c = Circle.find(circle_id.to_i)\n authorize_for_group(c)\n end\n end\n end\n end", "def attributes_protected_by_default\n # default = [ self.class.primary_key, self.class.inheritance_column ]\n # default << 'id' unless self.class.primary_key.eql? 'id'\n # default\n []\n end", "def initialize(attrs = {})\n super nil\n attrs.each_pair do |field, value|\n self[field] = value\n end\n end", "def map_openid_registration_with_persona_fields(registration)\n self.nickname ||= registration[\"nickname\"] if respond_to?(:nickname) && !registration[\"nickname\"].blank?\n self.login ||= registration[\"nickname\"] if respond_to?(:login) && !registration[\"nickname\"].blank?\n self.email ||= registration[\"email\"] if respond_to?(:email) && !registration[\"email\"].blank?\n self.name ||= registration[\"fullname\"] if respond_to?(:name) && !registration[\"fullname\"].blank?\n self.first_name ||= registration[\"fullname\"].split(\" \").first if respond_to?(:first_name) && !registration[\"fullname\"].blank?\n self.last_name ||= registration[\"fullname\"].split(\" \").last if respond_to?(:last_name) && !registration[\"fullname\"].blank?\n self.birthday ||= registration[\"dob\"] if respond_to?(:birthday) && !registration[\"dob\"].blank?\n self.gender ||= registration[\"gender\"] if respond_to?(:gender) && !registration[\"gender\"].blank?\n self.postcode ||= registration[\"postcode\"] if respond_to?(:postcode) && !registration[\"postcode\"].blank?\n self.country ||= registration[\"country\"] if respond_to?(:country) && !registration[\"country\"].blank?\n self.language ||= registration[\"language\"] if respond_to?(:language) && !registration[\"language\"].blank?\n self.timezone ||= registration[\"timezone\"] if respond_to?(:timezone) && !registration[\"timezone\"].blank?\n end", "def exposed_attributes\n [:id, :first_name, :last_name, :email, :phone, :role_id, :school_id]\n end", "def initialize(provider_attributes, options = {})\n @provider_attributes = provider_attributes.with_indifferent_access\n @provider_name = provider_attributes['provider']\n @options = {\n :user_attributes => {},\n :identity_attributes => {},\n :skip_raw_info => false,\n :skip_nils => true\n }.merge(options)\n\n @provider_identity = ModelMapper.new(self,\n :model => @options[:identity_model],\n :relation => @options[:identity_relation],\n :attributes => @options[:identity_attributes],\n :attribute_names => @options[:identity_attribute_names],\n :unique_identifiers => @options[:identity_identifiers] || [:provider, :uid],\n :required_criteria => @options[:identity_required_criteria]\n )\n @provider_user = ModelMapper.new(self,\n :model => @options[:user_model],\n :relation => @options[:user_relation],\n :attributes => @options[:user_attributes],\n :attribute_names => @options[:user_attribute_names],\n :unique_identifiers => @options[:user_identifiers] || [:email],\n :required_criteria => @options[:user_required_criteria]\n )\n end", "def get_ldap_attributes\n attributes = YaleLDAP.lookup(upi: upi.to_s)\n .slice(:first_name, :nickname, :last_name, :upi, :netid,\n :email, :organization, :curriculum, :college_name, :college_abbreviation,\n :class_year, :school, :telephone, :address)\n self.update_attributes(attributes)\n end", "def valid_attributes\n {\n first_name: \"Robin\",\n last_name: \"Dunlop\",\n gender: \"Male\",\n user_id: @user.id,\n birthday: Date.new(1982, 01, 19),\n contact_detail_attributes: {\n address: \"123 Fake Street\",\n city: \"Madison\",\n state: \"WI\",\n country_residence: \"US\",\n zip: \"12345\",\n club: \"TCUC\",\n club_contact: \"Connie\",\n usa_member_number: \"12345\",\n volunteer: false,\n emergency_name: \"Caitlin\",\n emergency_relationship: \"Sig. Oth.\",\n emergency_attending: true,\n emergency_primary_phone: \"306-222-1212\",\n emergency_other_phone: \"911\",\n responsible_adult_name: \"Andy\",\n responsible_adult_phone: \"312-555-5555\"\n }\n }\n end", "def ransortable_attributes(auth_object = nil)\n %w(id cn name surname sex birthdate id_card_no created_at)\n end", "def map_user_attributes(omniauth)\n info = omniauth.info\n raw_info = omniauth.extra.raw_info\n\n self.login = info.nickname\n self.name = info.name || ''\n self.email = info.email || ''\n self.avatar_url = info.image || ''\n\n self.company = raw_info.company\n self.location = raw_info.location\n self.followers = raw_info.followers\n self # return self\n end", "def new_with_session(params, session)\n if session[\"devise.user_attributes\"]\n # we already trust this isn't mass assignment attack, so use without protection\n new(session[\"devise.user_attributes\"], without_protection: true) do |user|\n user.attributes = params\n user.identities.build(session[\"identity_attributes\"]) if session[\"identity_attributes\"]\n # sets user.errors, which will be present when we return the user to the form with validation errors\n user.valid?\n end\n else\n # create and return new User instance\n super\n end \n end", "def initialize(params)\n @first_name = params[:user][:first_name]\n @last_name = params[:user][:last_name]\n @company_name = params[:user][:company][:company_name]\n @email = params[:user][:email]\n @password = params[:user][:password]\n end", "def init\n self.followers ||= {} if self.has_attribute? :followers\n self.friends ||= {} if self.has_attribute? :friends\n self.statuses ||= {} if self.has_attribute? :statuses\n end", "def first_or_initialize(attributes={}, &block)\n result = first\n unless result\n attributes = @options[:hash].merge(attributes) if @options[:hash]\n result = @model_class.new(attributes, &block)\n end\n result\n end", "def find_or_create_provider!(attrs)\n provider = Provider.find_by(name: attrs[:name])\n if provider.blank?\n provider = Provider.create!(\n name: attrs[:name],\n firm_agfs_supplier_number: attrs[:firm_agfs_supplier_number],\n api_key: attrs[:api_key],\n provider_type: attrs[:provider_type],\n vat_registered: attrs[:vat_registered],\n roles: attrs[:roles],\n lgfs_supplier_numbers: attrs[:lgfs_supplier_numbers] || []\n )\n end\n provider\n end", "def set_attrs_from_params\n sanitize_params\n @transaction.updated_by_user = current_user\n @transaction.user = User.yr(@year).where(email: params[:user_email]).first\n end", "def default_attrs\n attrs = model_class.column_names.collect(&:to_sym)\n attrs - [:id, :position, :password]\n end", "def valid_attributes\n {\"contenders_attributes\" => {\n \"0\"=> {\n \"side\"=>\"0\",\n \"user_id\"=>\"4ebdf7ca34017011e4000004\",\n \"set1\"=>\"1\",\n \"set2\"=>\"6\",\n \"set3\"=>\"6\"},\n \"1\"=> {\n \"side\"=>\"1\",\n \"user_id\"=>\"4ebf533b34017004dc000009\",\n \"set1\"=>\"6\",\n \"set2\"=>\"2\",\n \"set3\"=>\"3\"}\n },\n \"competition_id\" => test_competition.id\n }\n end", "def find_by_unconfirmed_phone_with_errors(attributes = {})\n inactivated_required_attributes = activation_keys.map { |k| k == :phone ? :unconfirmed_phone : k }\n inactivated_attributes = attributes.symbolize_keys\n inactivated_attributes[:unconfirmed_phone] = inactivated_attributes.delete(:phone)\n find_or_initialize_with_errors(inactivated_required_attributes, inactivated_attributes, :not_found)\n end", "def assign_registration_attributes!(registration)\n { :login => 'nickname', :email => 'email' }.each do |model_attribute, registration_attribute|\n unless registration[registration_attribute].blank?\n @user.send(\"#{model_attribute}=\", registration[registration_attribute])\n end\n end\n @user.save!\n end", "def find_or_create(auth)\n user = User.joins(:social_networks)\n .where(\"social_networks.provider = ?\", auth.provider)\n .where(\"social_networks.uid = ?\", auth.uid)\n .first\n\n unless user\n user = User.new(email: auth.info.email, password: Devise.friendly_token[0,20])\n\n user.social_networks.build(\n provider: auth.provider,\n token: auth.credentials.token,\n uid: auth.uid,\n raw_info: auth.to_hash\n )\n\n if user.save\n user.attributes = {\n gender: auth.extra.raw_info.gender.present? ? auth.extra.raw_info.gender : \"male\",\n full_name: auth.info.name,\n introduction: auth.extra.raw_info.bio.present? ? auth.extra.raw_info.bio : \"\"\n }\n user.save\n end\n end\n\n # return user\n user\n end", "def first_or_new(conditions, attributes = {})\n first(conditions) || new(conditions.merge(attributes))\n end", "def initialize_base_attributes_getters attributes_hash\n\n @base_attributes ||= {}\n\n attributes_hash.each do |key, value| \n\n attribute = key.underscore.to_sym \n if !self.class::LOOKUPS.include? attribute.to_s.singularize\n\n @base_attributes[ attribute ] = value \n define_base_method attribute if !defined? attribute\n\n else\n initialize_lookup attribute, value\n end \n end\n end", "def cas_extra_attributes=(attributes)\n self.username = attributes['uid']\n self.email = attributes['email']\n self.given_name = attributes['givenName']\n self.surname = attributes['surname']\n self.lnumber = attributes['lnumber']\n\n update_roles_from_attributes(attributes)\n end", "def create_attributes(klass, members); end", "def ldap_before_save\n self.email = Devise::LDAP::Adapter.get_ldap_param(self.username, \"mail\").first\n self.encrypted_password = Devise::LDAP::Adapter.get_ldap_param(self.username, \"userPassword\").first\n display_name = Devise::LDAP::Adapter.get_ldap_param(self.username, \"displayName\" )\n if display_name.present?\n display_name = display_name.first.split(' ')\n self.firstname = display_name[1]\n self.lastname = display_name.shift\n end\n end", "def person\n @person ||= Person.find_or_initialize_by email: @auth[:info][:email] do |p|\n if %i(first_name last_name).all? { |f| @auth[:info].key? f }\n # If the oauth provider gave us first and last name, use them\n p.first_name = @auth[:info][:first_name]\n p.last_name = @auth[:info][:last_name]\n else\n p.name = @auth[:info][:name]\n end\n end\n end", "def initialize(params)\n require_keys([:email], params)\n merge!(params)\n end", "def user_attributes\n {\n email: \"[email protected]\",\n username: \"Test\",\n bio: \"bio\",\n url: \"https://example.com\",\n twitter: \"djensenius\",\n portrait: \"head.jpg\"\n }\nend", "def find_or_create_user(extractor)\n Email.find_by_email(extractor.email).try(:user) ||\n IclaSignature.find_by_email(extractor.email).try(:user) ||\n User.create! do |user|\n user.first_name = extractor.first_name\n user.last_name = extractor.last_name\n end\n end", "def initialize(attributes={})\n @extras = {}\n @first_name = attributes[:first_name]\n @middle_name = attributes[:middle_name]\n @last_name = attributes[:last_name]\n @email = attributes[:email]\n @title = attributes[:title]\n end", "def create_record(attr = nil, force_id: false, no_raise: false, **)\n # noinspection RubyScope, RubyMismatchedReturnType\n super do |attr|\n unless administrator?\n org = current_org&.id or raise \"no org for #{current_user}\"\n attr[:org_id] = org\n end\n attr[:org_id] = nil if attr.key?(:org_id) && (attr[:org_id].to_i == 0)\n end\n end", "def update_or_create(attributes = {})\n id = attributes.delete(:id)\n conditions = attributes.delete(:conditions)\n\n returning (id && find_by_id(id)) || find(:first, :conditions => conditions) || new do |record|\n attributes.each_pair { |key, value| record[key] = value }\n record.save\n end\n end", "def find_or_create_for_omniauth auth, &block\n email = auth.info.email\n # This is just a placeholder for indexes and validations etc.\n # (twitter doesn't give us an email)\n email ||= \"#{auth.info.nickname || auth.uid}@#{auth.provider}.auth\"\n\n user = find_for_omniauth auth\n user ||= find_or_initialize_by email: email\n\n user.omniauth!(auth, &block) and user\n end", "def new_with_session(params, session)\n if session['devise.google_oauth2_data']\n super.tap do |user|\n if data = session[\"devise.google_oauth2_data\"] && session[\"devise.google_oauth2_data\"][\"info\"]\n user.email = data[\"email\"] if user.email.blank?\n user.first_name = data['first_name']\n user.last_name = data['last_name']\n user.identity.first_or_initialize(\n provider: session[\"devise.google_oauth2_data\"]['provider'],\n uid: session[\"devise.google_oauth2_data\"]['uid']\n )\n end\n end\n\n elsif session['devise.facebook_data']\n super.tap do |user|\n if data = session[\"devise.facebook_data\"] && session[\"devise.facebook_data\"][\"extra\"][\"raw_info\"]\n user.email = data[\"email\"] if user.email.blank?\n user.first_name = data['first_name']\n user.last_name = data['last_name']\n user.identity.first_or_initialize(\n provider: session[\"devise.facebook_data\"]['provider'],\n uid: session[\"devise.facebook_data\"]['uid']\n )\n end\n end\n else\n new(params)\n end\n end" ]
[ "0.6655809", "0.62144685", "0.6041626", "0.60329175", "0.57984674", "0.57666576", "0.5523748", "0.5471685", "0.54408455", "0.5405633", "0.5379418", "0.5366346", "0.53491294", "0.53023577", "0.5281282", "0.52773625", "0.52766174", "0.5272325", "0.5270333", "0.5268133", "0.5264072", "0.52552354", "0.52506256", "0.52438945", "0.5231644", "0.5229356", "0.52169573", "0.5212367", "0.5210756", "0.51886296", "0.51775116", "0.5171959", "0.5164255", "0.5162812", "0.5162434", "0.51619905", "0.5161315", "0.51547915", "0.514318", "0.51375926", "0.5127051", "0.5121963", "0.51208234", "0.51170576", "0.51114833", "0.5109926", "0.51054555", "0.50980204", "0.50900507", "0.50893027", "0.5087939", "0.5079922", "0.50772494", "0.5072559", "0.5072495", "0.5068749", "0.5068229", "0.50605446", "0.5052735", "0.5050279", "0.50469995", "0.5046406", "0.50328314", "0.5027231", "0.502372", "0.50142545", "0.50121367", "0.49997717", "0.49988782", "0.4995863", "0.49957532", "0.49931946", "0.49871486", "0.49663806", "0.49620846", "0.49551588", "0.49531737", "0.49517715", "0.49408436", "0.49405113", "0.4940089", "0.49362087", "0.493454", "0.49214455", "0.49162647", "0.49158108", "0.49154454", "0.4914326", "0.49142787", "0.49085012", "0.49028814", "0.48988116", "0.4898405", "0.48933607", "0.48875272", "0.48855972", "0.48851955", "0.48814726", "0.48785642", "0.4876461" ]
0.57472324
6
Overwrites active_for_authentication? for confirmation by verifying whether a user is active to sign in or not. If the user is already confirmed, it should never be blocked. Otherwise we need to calculate if the confirm time has not expired for this user.
def active_for_authentication?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end", "def active_for_authentication?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def confirmed_for_authentication?\n !confirmation_required? || confirmed? || confirmation_period_valid?\n end", "def active?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def confirmation_period_valid?\n self.class.allow_inactivated_access_for.nil? || (confirmation_sent_at && confirmation_sent_at.utc >= self.class.allow_inactivated_access_for.ago)\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !suspended_account\n end", "def confirmation_period_expired?\n self.class.activate_within && self.confirmation_sent_at && (Time.now > self.confirmation_sent_at + self.class.activate_within)\n end", "def better_to_confirm\n ! (self.confirmed && (((Time.zone.now - self.confirmed).to_i / 86400) < 365))\n end", "def active_for_authentication?\n super && !expired?\n end", "def two_factor_confirmed?\n #current_user.two_factor_confirmed_at && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n current_user.two_factor_confirmed_at_valid? && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n end", "def active_for_authentication?\n !deactivated? && super\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && un_blocked?\n end", "def active_for_authentication? \n super && approved? \n end", "def activated?\n activation_token && activation_token.confirmed?\n end", "def active_for_authentication?\n super && account_active?\n end", "def active_for_authentication? \n super && is_approved? \n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication?\n super && self.approved?\n end", "def active_for_authentication?\n super && activation_status == true\nend", "def active_for_authentication?\n super && !self.deactivated # i.e. super && self.is_active\n end", "def account_confirmed?\n confirmed?\n end", "def active_for_authentication?\n super && (!sms_confirmation_required? || confirmed_sms? || confirmation_sms_period_valid?)\n end", "def account_active?\n blocked_at.nil?\n end", "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "def active?\n !expired? && !revoked?\n end", "def activated_current_user?\n unless current_user.activated?\n flash[:warning] = \"please activate your account first\"\n redirect_to help_path(anchor: 'activation')\n end\n end", "def active_for_authentication?\n super && isActive\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def verify_active\n account = Account.find(params[:id])\n if account.active_until < Time.now.utc\n if account.stripe_customer_id\n flash[:subscription_expired] = \"Your subscription has expired! Don't worry, your data is perfectly fine, but you'll need to update your payment information -- it looks like there was a problem charging your card on file.\"\n session[\"preferred_account_id\"] = account.id\n redirect_to edit_subscription_path\n else\n flash[:subscription_expired] = \"Your subscription has expired! Don't worry, your data is perfectly fine, but you'll need to enter your payment information and become a paying subscriber.\"\n session[\"preferred_account_id\"] = account.id\n redirect_to new_subscription_path\n end\n end\n end", "def check_if_needs_approval\r\n self.suspended_at = Time.now if Setting.user_signup == :needs_approval && !self.admin\r\n end", "def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && [email protected]?\n end", "def active_for_authentication?\n # User is approved when harp_id is assigned.\n # Approved flag is set programmatically when harp_id is set by an admin.\n super && is_approved?\n end", "def confirm_now\n confirm_user(params[:confirmation_code])\n unless request.xhr?\n if @user and @user.confirmed?\n unless logged_in?\n @current_user_session = FrontendUserSession.new\n render({:template => 'frontend/users/confirmed'})\n else\n flash[:info] = c_t(:success_message, {:domain_name => @host_name})\n redirect_to(frontend_user_account_url) \n end\n else\n render({:template => 'frontend/users/confirm_now'})\n end\n else\n render({:template => 'frontend/users/confirm_now.js.rjs'})\n end\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n active? && super\n end", "def active_for_authentication?\r\n super && active_status?\r\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def password_valid?\n user &&\n user.authenticate(password) &&\n user.confirmated_at?\n end", "def activatable?\n token = activation_token\n !!(token && !token.expired? && !token.confirmed?)\n end", "def signed_in_and_unconfirmed\n resource = resource_class.to_adapter.get((send(:\"current_#{resource_name}\") || MnoEnterprise::User.new).to_key)\n return true if resource && !resource.confirmed?\n\n redirect_to MnoEnterprise.router.dashboard_path\n return false\n end", "def active_for_authentication? \n \tsuper && approved?\n \t\n\tend", "def active_for_authentication?\n super && active\n end", "def active_for_authentication?\n super && bloqueado == 0\n end", "def active_for_authentication?\n super && !banned?\n end", "def active_for_authentication?\n self.active?\n end", "def active_for_authentication?\n super && is_active?\n end", "def active_for_authentication?\n super && !banned\n end", "def active_for_authentication?\n super && self.is_active?\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def confirmation_token_valid?\n (self.confirmation_sent_at + 30.days) > Time.now.utc\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && !deleted_at && self.enabled?\n end", "def require_confirmation\n if account_signed_in? and !current_account.confirmed?\n redirect_to waiting_pages_path\n end\n end", "def active_for_authentication?\n super && !disabled_at\n end", "def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end", "def set_to_activate\n if REQUIRES_ACCOUNT_CONFIRMATION_TO_ACTIVATE && owner.parent && !owner.parent.account_confirmed\n self.status = Status::PENDING_ACCOUNT_CONFIRMATION\n elsif owner.requires_parental_guidance? && owner.parent.nil?\n self.status = Status::PENDING\n else\n self.status = Status::OPEN\n owner.update_friends_new_item\n end\n self.activated_at = Time.now\n end", "def is_confirmed?\n if self.confirmed == true\n return true\n else\n return false\n end\n end", "def confirmed?\n memoized_info[:confirmed]\n end", "def toggle_confirmation\n if user_params[:to_confirm] == 'true'\n @user.confirm\n elsif user_params[:to_confirm] == 'false'\n @user.confirmed_at = nil\n @user.save\n end\n head :ok\n end", "def activate\n if @user.inactive? && @user.created_by_admin?\n if @user.is_regular? && @user.profile.penultimate_step_complete?\n @user.activate!\n @user.save_profinda_profile\n render json: { status: 'active' }\n elsif @user.is_external? && @user.profile.first_step_completed?\n @user.activate!\n render json: { status: 'active' }\n else\n render json: { status: 'user can\\'t be activate' }\n end\n else\n render json: { status: 'user is active' }\n end\n end", "def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end", "def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def verify_and_activate!\n self.verify! unless self.verified?\n \n # hack to make sure people who come in via yammer get their verified_at column\n # set properly\n self.update_column(:verified_at, Time.now) if self.verified_at.blank?\n\n #this used to be in signups controller and password resets controller\n #but moving to here, because we use this method in more spots\n #and i made management of perishable token manual(instead of authlogic handling it)\n #so be safe and reset it whenever we verify\n self.reset_perishable_token!\n \n #activate if all the info is good\n self.set_status!(:active) if self.ok_to_login?\n end", "def confirmation_period_expired?; end", "def check_for_pending_account\n user = User.pending.find_by_login(params[:login]) || User.pending.find_by_identity_url(params[:openid_identifier])\n user = nil unless (user && user.authenticated?(params[:password])) unless params[:openid_identifier]\n flash.now[:notice] = 'Please activate your account first by clicking on the link emailed to you' if user\n end", "def confirmation_required?\n !confirmed?\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end" ]
[ "0.8066356", "0.7587792", "0.7512572", "0.7223848", "0.71491134", "0.70174843", "0.70073014", "0.6947345", "0.6947345", "0.6947345", "0.69133943", "0.68636346", "0.68183196", "0.67996675", "0.67599505", "0.6736072", "0.6643456", "0.6643456", "0.6643456", "0.6643456", "0.6643456", "0.6643456", "0.6643456", "0.66028583", "0.6579478", "0.65761185", "0.6556495", "0.6543863", "0.6499065", "0.64896107", "0.64896107", "0.6484067", "0.6459584", "0.6440638", "0.6439235", "0.6436946", "0.6436589", "0.6421583", "0.6413673", "0.63957906", "0.63884306", "0.63785875", "0.63785875", "0.6370763", "0.6356288", "0.6356288", "0.6346969", "0.63223714", "0.63075453", "0.628848", "0.62804645", "0.628027", "0.628027", "0.628027", "0.6279869", "0.6277529", "0.62735295", "0.62735295", "0.6271165", "0.6256175", "0.6254098", "0.62510794", "0.62455773", "0.62424386", "0.62066466", "0.6204515", "0.61987674", "0.6198193", "0.61947864", "0.6194025", "0.61920285", "0.618863", "0.61765313", "0.61765313", "0.61765313", "0.6168539", "0.61664945", "0.61596984", "0.6152126", "0.6151094", "0.6144486", "0.6141903", "0.613976", "0.6136086", "0.6128383", "0.6116841", "0.6115838", "0.61008096", "0.6099657", "0.6078143", "0.60729563", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306", "0.6071306" ]
0.0
-1
Confirm a user by setting it's confirmed_at to actual time. If the user is already confirmed, add an error to email field. If the user is invalid add errors source://devise//lib/devise/models/confirmable.rb79
def confirm(args = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def confirm!\n update!(confirmed_at: DateTime.now)\n end", "def confirm!\n update(confirmed_at: Time.now.utc, status: :confirmed)\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def confirm_user\n @user = User.find_by_confirmation_token(params[:user][:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n return\n end \n # Slim down the hash I send to Devise to avoid Mass-Update-problems:\n params_user = {'name' => params[:user][:name], \n 'password' => params[:user][:password], \n 'password_confirmation' => params[:user][:password_confirmation]\n }\n if @user.update_attributes(params_user) and @user.password_match?\n @user = User.confirm_by_token(@user.confirmation_token)\n set_flash_message :notice, :confirmed \n sign_in_and_redirect(\"user\", @user)\n else\n render :confirm_user_failed\n return\n end # if\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def mark_as_confirmed!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def call(user:)\n if user.needs_confirmation?\n User.transaction(requires_new: true) do\n confirm_user(user)\n end\n elsif user.confirmed_at.present?\n user.errors.add(:email, user_already_confirmed)\n response.status = :errors\n end\n\n response.success = true if response.status == :success\n\n response\n end", "def activate\n @user = User.find(params[:id])\n\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'confirmed', :id => params[:id])\n else\n\t\t\trespond_to do |format|\n\t\t\t\tif @user.update_attributes(params[:user])\n\t\t \t\[email protected]_state = \"confirmed\"\n\t\t\t\t\[email protected]_at = Time.now\n\n\t\t\t\t\tif @user.update_attributes(params[:user])\t\t\t\t\t\t\n\t\t\t\t\t\tNotifier.user_confirmed(@user).deliver\n\t\t\t\t\t\tflash[:notice] = \"You're all set, \" + @user.first_name + \"!\"\n\t\t\t\t\t\tformat.html { redirect_to(:action => 'completed', :id => params[:id]) }\n\t\t\t\t\telse\n\t\t\t\t\t\tflash[:error] = 'Failed to set user state to confirmed. Please try again.'\n\t\t\t\t\t\tformat.html { render :action => \"invitation\", :layout => \"activate\" }\n\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = 'User was not updated.'\n\t\t\t\t\tformat.html { render :action => \"invitation\", :layout => \"activate\" }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n end", "def account_confirmed(user)\n @notify_subject = strip_tags( \"USER CONFIRMED ACCOUNT AT #{ENV['APPLICATION_CONFIG_name']}\")\n @user = user\n mail( :to => ENV['APPLICATION_CONFIG_admin_notification_address'], :subject => @notify_subject)\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def already_confirmed\n @user = User.find_by_id(params[:id])\n confirmed_at = @user.confirmed_at\n @formatted_confirmed_at = confirmed_at.strftime(\"%A, %B %d, %Y at %I:%M%P\")\n \trender :layout => \"activate\"\n end", "def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end", "def confirm_account(user)\n @name = user.first_name\n @confirm_url = confirm_url(user.token)\n\n mail to: user.email, subject: 'Account confirmation'\n end", "def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end", "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end", "def verify\n update(confirmed_at: Time.current)\n end", "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "def after_save(user)\n if user.confirmed_at_changed?\n Invitation.where(friend_id: user.id).each do |invitation|\n invitation.confirm!\n end\n end\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def confirm\n @doctor = Doctor.find_by_confirmation_token(params[:confirmation_token])\n \n if @doctor.present?\n @doctor.update_attributes(confirmed_at: DateTime.now)\n render json: {message: \"Your account has been confirmed at #{@doctor.confirmed_at}.You can Sign in Now!\"}\n else \n render json: {alert: \"Confirmation Link has Expired.\"}\n end\n\n end", "def activate_email\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def triggerConfirmation\n\n user = getUserByAuthToken(request)\n user.resend_confirmation_instructions\n\n if(user.errors.blank?)\n logger.info \"Email confirmation instructions were sent for user #{user.email}\\n\"\n raw_token = user.instance_variable_get(\"@raw_confirmation_token\")\n\n the_response = { :confirmation_sent_at => user.confirmation_sent_at }\n\n enable_test_hooks = Rails.application.config.enable_test_hooks\n if(enable_test_hooks)\n # Assume we're in test environment - add hook in response to enable testing\n logger.info \"Including raw confirmation token in response: #{raw_token}\\n\"\n the_response[:confirmation_token] = raw_token\n end\n\n render :status => 201, :json => the_response\n else\n if(!user.errors.messages[:email].blank?)\n logger.error \"Devise said: \\\"#{user.errors.messages[:email]}\\\". Interpret as no email confirmation pending for #{user.email} (user id: #{user.id}), instructions will not be emailed.\\n\"\n render :status => 412, :json => {:error => \"No email confirmation pending\"}.to_json\n else\n logger.error \"Unexpected error encountered when attempting to send confirmation instructions for #{user.email}. Error: #{user.errors.inspect}.\\n\"\n render :status => 500, :json => {:error => I18n.t(\"500response_internal_server_error\")}.to_json\n end\n end\n end", "def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def check_schedule_confirmed\n\t\t# Picked a random 'check' user service and temporary set it's status to schedule_confirmed\n\t\tuser_service \t\t= UserService.find_by(relationship_type: 'check')\n\t\tuser_service.date \t= Time.now\n\t\tuser_service.status = 'schedule_confirmed'\n\t\tUserServicesMailer.check_updated(user_service)\n\tend", "def toggle_confirmation\n if user_params[:to_confirm] == 'true'\n @user.confirm\n elsif user_params[:to_confirm] == 'false'\n @user.confirmed_at = nil\n @user.save\n end\n head :ok\n end", "def confirm_email\n logger.info \"Loading MemberUser confirm_email action\" \n token = params[:token]\n logger.debug \"Token - param: #{token.inspect}\"\n email = params[:email]\n logger.debug \"Email - param: #{email.inspect}\"\n member = Member.find_by_access_key(token)\n logger.debug \"Member found from token - attributes hash: #{member.attributes.inspect}\"\n @confirmed_status = false\n if member && member.user.try(:email) == email\n member.email_confirmed = true\n if member.save\n @confirmed_status = true\n end\n else\n logger.debug \"Error: Invalid request attributes when confirming email\"\n flash[:alert] = t(:security_error, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n end\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end", "def confirmed_it\n #look up user\n url = request.fullpath\n id = url[9]\n u = User.find(:id => user_id)\n # check code to paramater code\n if u.confirmation_code == confirmation_code then\n u.confirmed = true\n u.save\n #if all clear log them in and go to dashboard\n session[:user] = User.authenticate(u.email, u.password)\n redirect_to :action => \"dashboard\", :controller => 'sessions' \n end\n redirect_to :action => \"signup\", :controller => 'prelogins' \n end", "def show \n @user.confirmed = true\n @user.save!\n Session.create(@user)\n flash[:notice] = \"Thanks, your email address has been confirmed.\" \n redirect_to dashboard_url \n end", "def do_confirm\n if current_user.type == \"User\" || current_attendee.affiliate == current_user\n if registration = current_attendee.event_registrations.for_event(current_object).first\n registration.confirm!\n # log confirmation activity\n log_checkin_activity(\"Confirmed for '#{current_object.display_name}'\")\n \n @attendee_id = current_attendee.id\n @event_id = params[:id]\n end\n end\n\n render :text => \"Confirmed\"\n end", "def user_confirm_email(current_user)\n @current_user = current_user\n mail(to: current_user.email, subject: 'Confirm Email', from:\"PawBookings <[email protected]>\")\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def reconfirm_notification(user)\n setup_email(user)\n subject 'Confirm new email'\n\n body :user => user, :host => FROM_HOST\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def assert_account_is_confirmed\n expect(page).to have_selector(\n '.alert.alert-success strong',\n text: t('devise.confirmations.confirmed')\n )\n\n logged_in_user.reload\n expect(logged_in_user).to be_confirmed_at\n end", "def create\n @user = User.new(params[:user])\n @user.confirmed_at = Time.now\n @user.skip_confirmation!\n [email protected] && (redirect_to new_user_session_path)\n end", "def validate_confirm_email\n service = AccountDetails::UpdateEmail.call(\n password: params.dig(:passwords, :password),\n password_confirmation: params.dig(:passwords, :password_confirmation),\n token: params[:token]\n )\n if service.valid?\n sign_in_and_redirect(service)\n else\n render_confirm_email(service.errors)\n end\n end", "def confirmed?\n flash[:alert] = 'Check your email to confirm yourself.(You are not allowed to create posts)' unless current_user&.email_confirmed?\n end", "def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!\n # save!(:validate => false)\n # validate for password validation, done on front end\n end", "def confirmed_at\n Time.now.utc\n end", "def account_already_confirmed_email(user, is_mid_registration)\n @is_mid_registration = is_mid_registration\n from_address = \"#{Rails.configuration.registrations_service_emailName} <#{Rails.configuration.registrations_service_email}>\"\n subject = I18n.t('registration_mailer.account_already_confirmed.title')\n mail(to: user.email, subject: subject, from: from_address)\n end", "def confirm_email_change(user, new_email)\n @user = user\n @new_email = new_email\n @autogen_msg = AUTOGEN_MSG\n\n @change_email_url = confirm_email_change_user_url(id: @user.id,\n confirmation_token: @user.confirmation_token,\n new_email: new_email,\n host: Rails.env.production? ? PROD_URL : DEV_URL,\n protocol: \"http\")\n mail(to: @new_email, subject: \"Confirm Change in Email Address\")\n end", "def update\n if @user.update_attributes user_params\n # check if we need to re-sent an confirmation email\n if @user.maybe_deliver_email_confirmation! self\n flash[:success] = \"Votre compte a été mise à jour, un email de confirmation vous a été envoyé.\"\n else\n flash[:success] = \"Votre compte a été mise à jour.\"\n end\n redirect_to @user\n else\n flash[:danger] = \"Une erreur est survenue.\"\n render 'edit'\n end\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def user_event_confirmed(user, event)\n @user = user\n @event = event\n meeting = user.meetings.find_by(event: event)\n attachments.inline['prenotazione.ics'] = meeting.ical.to_ical if meeting.confirmed?\n mail(to: @user.email, subject: t('user_event_modified', scope: 'message.email.subjects') + ' ' + (l event.date_on)) if user.email.present?\n end", "def confirm_now\n confirm_user(params[:confirmation_code])\n unless request.xhr?\n if @user and @user.confirmed?\n unless logged_in?\n @current_user_session = FrontendUserSession.new\n render({:template => 'frontend/users/confirmed'})\n else\n flash[:info] = c_t(:success_message, {:domain_name => @host_name})\n redirect_to(frontend_user_account_url) \n end\n else\n render({:template => 'frontend/users/confirm_now'})\n end\n else\n render({:template => 'frontend/users/confirm_now.js.rjs'})\n end\n end", "def confirmable\n apply_schema :confirmation_token, String\n apply_schema :confirmed_at, DateTime\n apply_schema :confirmation_sent_at, DateTime\n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def confirm_email(user)\n @user = user\n @confirm_url = \"http://www.yscalumni.org/confirm/\" + user.confirmation_code\n mail(:to => user.email, :subject => \"Welcome to yscalumni.org! Please confirm your email!\")\n end", "def confirm_friend(user)\n friendships_unique = pending_accept.where(user_id: user.id).first\n friendships_unique.confirmed = true\n row = Friendship.new(user_id: friendships_unique.friend_id, friend_id: friendships_unique.user_id, confirmed: true)\n row.save\n friendships_unique.save\n end", "def send_confirmation_email\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = SendConfirmationEmailCommand.new(user, current_user,\n request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = 'Confirmation email sent.'\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def check_mail_confirmation\n return if current_user.client?\n\n unless current_user.confirmed?\n flash[:danger] = tf('common.flash.unconfirmed_mail')\n redirect_to :root\n end\n end", "def confirm_new_user(token)\n user = PublicEarth::Db::User.new\n begin\n user.attributes = one.confirm_new_user(token)\n rescue\n # Check with the PostgreSQL exception message to see what kind of error we generated.\n if $! =~ /invalid user/i\n user.errors.add(:email, \"An account for #{email} does not exist.\")\n else\n user.errors.add_to_base(\"The given token does not match the one on record.\")\n end\n end\n user\n end", "def correct_email_confirmation\n return if email == email_confirmation\n\n error_message = I18n.t('email.errors.email_equality')\n errors.add(:email, :invalid, message: error_message)\n errors.add(:email_confirmation, :invalid, message: error_message)\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def confirm\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = ConfirmUserCommand.new(user, params[:code], request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n redirect_to signin_url\n else\n render 'confirmed'\n end\n end", "def confirmation(user)\n @user = user\n @user.generate_confirmation_code\n mail(to: @user.email, subject: \"Confirmation\") do |f|\n f.html\n end\n\n end", "def show_warning_if_not_confirmed!\n unless current_user.confirmed_at?\n flash.now['warning_persist'] = \"#{I18n.t('flash.warning.confirm_email.text')} <a href=\\\"#{resend_confirmation_email_dashboard_users_path}\\\">#{I18n.t('flash.warning.confirm_email.button')}</a>\".html_safe\n end\n end", "def signup_confirmation(user)\n @user = user\n\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def signup_confirmation(user)\n @user = user\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "def add_email\n if params[:user] && params[:user][:email]\n current_user.email = params[:user][:email]\n current_user.skip_reconfirmation! # don't forget this if using Devise confirmable\n respond_to do |format|\n if current_user.save\n # TODO: i18n this notice\n format.html { redirect_to current_user, notice: 'Your email address was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def confirm\n confirmation_hash = params[:confirmation_hash]\n if confirmation_hash.nil?\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n confirmed_address = AliasAddress.find_by_confirmation_hash(confirmation_hash)\n\n # No address with the given hash key was found,\n # or the address was already activated:\n if confirmed_address.nil? || confirmed_address.confirmed\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n # If there was already a user with the specified e-mail address,\n # merge his meetings into the \"master\" account:\n other_user = AliasAddress.find_by_address_and_confirmed(confirmed_address.address, true)\n\n confirmed_address.confirmed = true\n confirmed_address.save!\n\n new_user = confirmed_address.owner\n\n if other_user\n other_user = other_user.owner\n meetings = other_user.meetings\n meetings.each do |meeting|\n # Is the \"master\" user invited to this meeting as well?\n double_invite = meeting.participants.include?(new_user)\n\n meeting.suggestions.each do |suggestion|\n\n # If both are participants, simply delete all votes by the other user:\n if double_invite\n to_delete = suggestion.votes.select { |vote| vote.voter == other_user }\n suggestion.votes.delete(to_delete)\n else\n # Otherwise, replace the voter of the vote if neccessary:\n suggestion.votes.each do |vote|\n if vote.voter == other_user\n vote.voter = new_user\n vote.save!\n break\n end\n end\n end\n\n # Replace the creator of the suggestion if neccessary:\n if suggestion.creator == other_user\n suggestion.creator = new_user\n end\n suggestion.save!\n end\n meeting.comments.select{ |c| c.author == other_user }.each do |comment|\n # Replace the comment author if neccessary:\n comment.author = new_user\n comment.save!\n end\n # Switch the initiator of the meeting if neccessary:\n meeting.initiator = new_user if meeting.initiator == other_user\n\n # Switch the participants of the meeting:\n meeting.participants.delete(other_user)\n meeting.participants << new_user unless double_invite\n\n meeting.save!\n end\n\n # Also, make all the alias addresses of other_user over\n # to new_user (by copying them - this is neccessay as\n # the \"alias_addresses\" accociation has the\n # \":dependent => :destroy\" option and all aliases would\n # therefore be lost when the other_user is deleted):\n other_user.alias_addresses.each do |address|\n new_user.alias_addresses << AliasAddress.new(\n :owner_id => new_user.id,\n :address => address.address,\n :confirmation_hash => address.confirmation_hash,\n :confirmed => address.confirmed\n )\n end\n\n # And finally, delete the now redundant other user:\n other_user.destroy\n\n # Delete the now obsolete alias (one for its address\n # has already been taken over from the other user):\n confirmed_address.destroy\n\n # And don't forget to save the manipulated user:\n new_user.save!\n\n end\n\n @alias_address = confirmed_address\n\n I18n.locale = @alias_address.owner.language\n\n end", "def create\n @user = User.new(user_params.merge({confirm: false}))\n respond_to do |format|\n if @user.save\n UserMailer.registration_confirmation(@user).deliver!\n format.html { redirect_to new_user_path, notice: 'User was successfully created.' }\n format.json { render json: {notice: \"Please confirm your emai #{@user.email}\"} }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def mail_confirm(email, date)\n \t\t@date = date\n \t\tmail(to: email, subject: \"Appointment Confirmed!\")\n \tend", "def send_confirmation_email(user, last_sent_at = nil)\n # send one email every 2 minutes\n # TODO: upgrade timestamp to Redis\n last_sent_at = session[:last_validation_email_at] if last_sent_at.nil? and session and session[:last_validation_email_at]\n meta = { :to => user.email, :from => $settings.customer_service_email, :last_sent_at => last_sent_at }\n return meta if test?\n return meta if last_sent_at and Time.at(last_sent_at) >= 2.minutes.ago\n\n Email::Sender.send(:validation, {\n :to => user.email,\n :email_token => user.smart_token.to_s,\n :name => user.login_name,\n :subject => 'Confirmation Email',\n :now => true\n })\n\n # update timestamp\n meta[:last_sent_at] = Time.new.to_i\n session[:last_validation_email_at] = meta[:last_sent_at]\n\n meta\n end", "def activate\n if params[:id]\n @user = User.find_by_confirmation_token(params[:id])\n if @user.present?\n @user.activate\n flash[:notice] = \"User activated successfully.\"\n Notifier.confirm_user(@user).deliver\n else\n flash[:notice] = \"User already activated.\"\n end\n else\n flash[:notice] = \"You do not have Activation Code.\"\n end\n redirect_to :action => \"home\"\n end", "def finalize\n @confirmation_token = params[:user].delete(:confirmation_token)\n self.resource = resource_class.find_for_confirmation(@confirmation_token)\n\n # Exit action and redirect if user is already confirmed\n if resource && resource.confirmed?\n yield(:already_confirmed, resource) if block_given?\n redirect_to after_confirmation_path_for(resource_name, resource)\n return\n end\n\n if resource.errors.empty?\n if params[:tos] == \"accept\"\n params[:user][:meta_data] = resource.meta_data.merge(tos_accepted_at: Time.current)\n end\n resource.assign_attributes(params[:user]) unless resource.confirmed?\n resource.perform_confirmation(@confirmation_token)\n resource.save\n sign_in resource, bypass: true\n set_flash_message(:notice, :confirmed) if is_flashing_format?\n yield(:success,resource) if block_given?\n MnoEnterprise::EventLogger.info('user_confirm', resource.id, 'User confirmed', resource)\n respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource, new_user: true) }\n else\n yield(:error,resource) if block_given?\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n end\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def activation_success_email(user)\n # TODO: Implement actual functionality -- Wed Jun 13 15:26:53 2012\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def registration_confirmation(user)\n @user = user\n\n mail to: \"[email protected]\", subject: \"Success! You did it.\"\n end", "def valid_user\n unless (@user && @user.activated? &&\n @user.authenticated?(:email_change, params[:id]))\n flash[:danger] = \"Invalid credentials\"\n redirect_to root_path\n end\n end", "def send_confirmation_to(user)\n token_link = \"http://localhost:9292/validate/\" + user.validation_token\n template_locals = { :user => user, :token_url => token_link}\n send_email_to_user(user,\"Frank requests that you verify your email address.\" ,:'mail/new_registration', template_locals)\n end", "def create\n @resource = current_user\n\n unless params[:confirm_success_url]\n return render json: {\n status: 'error',\n data: @resource,\n errors: [\"Missing `confirm_success_url` param.\"]\n }, status: 403\n end\n\n unless @resource.confirmed? \n return render json: {\n status: 'error',\n data: @resource,\n errors: [\"email already confirmed\"]\n }, status: 403\n end\n \n errors = nil\n\n if @resource\n # send email in seperate thread\n Thread.new do\n @resource.send_confirmation_instructions({\n redirect_url: params[:confirm_success_url],\n client_config: params[:config_name]\n })\n end\n else\n errors = [\"Unable to find user with email '#{email}'.\"]\n end\n\n if errors\n render json: {\n success: false,\n errors: errors\n }, status: 400\n else\n render json: {\n status: 'success',\n data: @resource.as_json\n }\n end\n end", "def confirm_user(user)\n confirmed_interpreter_requests.create(user_id: user.id)\n end", "def confirmation(user)\n \n @user = user\n\n if Rails.env.production?\n @root_path = \"http://allianz-community.com/\"\n else\n @root_path = \"http://localhost:3000/\"\n end\n\n @confirm_path = @root_path + users_confirm_path + \"?id=\"[email protected]_s+\"&hash=\" + @user.confirm_hash\n mail to: @user.mail, subject: 'Email confiramtion'\n end", "def activation_needed_email(user)\n @user = user\n @url = users_activate_path(id: user.activation_token)\n mail(to: user.email, subject: \"#{User.model_name.human}登録を完了しましょう!\")\n end", "def confirmed?; end", "def confirm(token = nil)\n if ActiveSupport::SecurityUtils.secure_compare(token, confirmation_token)\n self.confirmation_token = nil\n self.password = SecureRandom.hex(8) unless password_digest.present?\n self.confirmed_at = Time.now.utc\n end\n end" ]
[ "0.7190637", "0.704028", "0.6920364", "0.68805087", "0.67831683", "0.6629971", "0.65588295", "0.65426916", "0.6514636", "0.64676744", "0.6421647", "0.6399638", "0.6387724", "0.6376101", "0.63692003", "0.63453925", "0.63421077", "0.6319554", "0.63035977", "0.62956697", "0.6286081", "0.6263656", "0.62519413", "0.621415", "0.6198404", "0.617242", "0.61562073", "0.6136631", "0.6096014", "0.60869503", "0.6086019", "0.60475725", "0.5990335", "0.5981689", "0.59764946", "0.59745246", "0.5945762", "0.59277093", "0.59193337", "0.5910011", "0.5900315", "0.58987516", "0.58630115", "0.5861257", "0.5851971", "0.5851537", "0.58480465", "0.58480465", "0.5840683", "0.5840355", "0.5834716", "0.5834716", "0.5828925", "0.58273864", "0.5821308", "0.5808255", "0.5806514", "0.5784066", "0.57611144", "0.57558763", "0.5738343", "0.5736132", "0.5727391", "0.57254225", "0.57118756", "0.5689617", "0.5671227", "0.565039", "0.5637596", "0.5631662", "0.5614499", "0.5611463", "0.5603662", "0.55982953", "0.55979097", "0.5597109", "0.557809", "0.55747294", "0.55665314", "0.5566342", "0.5554493", "0.5545424", "0.55417234", "0.55349964", "0.5531202", "0.5525555", "0.5523632", "0.5515059", "0.55112207", "0.5510571", "0.551034", "0.5500827", "0.5493631", "0.5482084", "0.54813117", "0.54791117", "0.5478401", "0.5475299", "0.54722756", "0.54709995", "0.54704666" ]
0.0
-1
Verifies whether a user is confirmed or not
def confirmed?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmed?\n confirmation == 'yes'\n end", "def confirmed?\n confirmation == 'Confirmed'\n end", "def account_confirmed?\n confirmed?\n end", "def confirmed?\n confirmation == 'yes'\n end", "def is_confirmed?\n if self.confirmed == true\n return true\n else\n return false\n end\n end", "def confirmed?\n flash[:alert] = 'Check your email to confirm yourself.(You are not allowed to create posts)' unless current_user&.email_confirmed?\n end", "def confirmed?\n state == 'confirmed'\n end", "def confirmed?(user)\n confirmed_interpreters.include?(user)\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "def confirmation_required?\n !confirmed?\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def confirmation_required?\n !confirmed?\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def verify\n update(confirmed_at: Time.current)\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def confirmed?\n memoized_info[:confirmed]\n end", "def confirmed_for_authentication?\n !confirmation_required? || confirmed? || confirmation_period_valid?\n end", "def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end", "def unconfirmed?\n !confirmed?\n end", "def confirmed?\n self.status >= 0\n end", "def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def confirm!\n update(confirmed_at: Time.now.utc, status: :confirmed)\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def confirmed?\n\t\tUser.find(user_id).friends.include?(User.find(friend_id)) && User.find(friend_id).friends.include?(User.find(user_id)) \n\tend", "def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end", "def confirm_account\n confirm\n end", "def confirmed?\n live?\n end", "def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end", "def confirmation?(user)\n Contact.find_by_user_id_and_friend_id_and_status(user.id,self.id, 1) ? true : false\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def confirm!\n return false if purchased?\n confirmed!\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def toggle_confirmation\n if user_params[:to_confirm] == 'true'\n @user.confirm\n elsif user_params[:to_confirm] == 'false'\n @user.confirmed_at = nil\n @user.save\n end\n head :ok\n end", "def assert_account_is_confirmed\n expect(page).to have_selector(\n '.alert.alert-success strong',\n text: t('devise.confirmations.confirmed')\n )\n\n logged_in_user.reload\n expect(logged_in_user).to be_confirmed_at\n end", "def confirm_user\n @user = User.find_by_confirmation_token(params[:user][:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n return\n end \n # Slim down the hash I send to Devise to avoid Mass-Update-problems:\n params_user = {'name' => params[:user][:name], \n 'password' => params[:user][:password], \n 'password_confirmation' => params[:user][:password_confirmation]\n }\n if @user.update_attributes(params_user) and @user.password_match?\n @user = User.confirm_by_token(@user.confirmation_token)\n set_flash_message :notice, :confirmed \n sign_in_and_redirect(\"user\", @user)\n else\n render :confirm_user_failed\n return\n end # if\n end", "def confirmed_it\n #look up user\n url = request.fullpath\n id = url[9]\n u = User.find(:id => user_id)\n # check code to paramater code\n if u.confirmation_code == confirmation_code then\n u.confirmed = true\n u.save\n #if all clear log them in and go to dashboard\n session[:user] = User.authenticate(u.email, u.password)\n redirect_to :action => \"dashboard\", :controller => 'sessions' \n end\n redirect_to :action => \"signup\", :controller => 'prelogins' \n end", "def two_factor_confirmed?\n #current_user.two_factor_confirmed_at && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n current_user.two_factor_confirmed_at_valid? && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n end", "def do_confirm\n if current_user.type == \"User\" || current_attendee.affiliate == current_user\n if registration = current_attendee.event_registrations.for_event(current_object).first\n registration.confirm!\n # log confirmation activity\n log_checkin_activity(\"Confirmed for '#{current_object.display_name}'\")\n \n @attendee_id = current_attendee.id\n @event_id = params[:id]\n end\n end\n\n render :text => \"Confirmed\"\n end", "def is_confirmed?\n return self.status == Erp::QuickOrders::Order::STATUS_CONFIRMED\n end", "def confirmed?\n [:confirmed, :in_progress, :done].include?(self.status)\n end", "def must_be_completely_verified\n unless current_user.sms_code.to_i == current_user.confirm_code.to_i\n redirect_to root_path, notice: \"You need to be verified!\"\n end\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def confirming?\n self.status == 'confirming'\n end", "def confirm!\n update!(confirmed_at: DateTime.now)\n end", "def check_mail_confirmation\n return if current_user.client?\n\n unless current_user.confirmed?\n flash[:danger] = tf('common.flash.unconfirmed_mail')\n redirect_to :root\n end\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def is_unconfirmed_user?(user)\n return false if Access::Core.is_guest?(user)\n\n !user.confirmed?\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def user_verified?; end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end", "def confirm!\n @@api.post(endpoint: self.endpoint + ['confirm'])\n end", "def user_should_receive_registration_email?\n return true if user.nil?\n return false unless user.confirmed?\n return false if email_address_record.confirmed?\n true\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def better_to_confirm\n ! (self.confirmed && (((Time.zone.now - self.confirmed).to_i / 86400) < 365))\n end", "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def recently_confirmed?\n @recently_confirmed\n end", "def is_confirmable?\n true\n end", "def activate\n @user = User.find(params[:id])\n\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'confirmed', :id => params[:id])\n else\n\t\t\trespond_to do |format|\n\t\t\t\tif @user.update_attributes(params[:user])\n\t\t \t\[email protected]_state = \"confirmed\"\n\t\t\t\t\[email protected]_at = Time.now\n\n\t\t\t\t\tif @user.update_attributes(params[:user])\t\t\t\t\t\t\n\t\t\t\t\t\tNotifier.user_confirmed(@user).deliver\n\t\t\t\t\t\tflash[:notice] = \"You're all set, \" + @user.first_name + \"!\"\n\t\t\t\t\t\tformat.html { redirect_to(:action => 'completed', :id => params[:id]) }\n\t\t\t\t\telse\n\t\t\t\t\t\tflash[:error] = 'Failed to set user state to confirmed. Please try again.'\n\t\t\t\t\t\tformat.html { render :action => \"invitation\", :layout => \"activate\" }\n\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = 'User was not updated.'\n\t\t\t\t\tformat.html { render :action => \"invitation\", :layout => \"activate\" }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n end", "def confirm\n token = params[:confirmation_token].to_s\n user = TempUser.find_by(confirmation_token: token)\n if user.present? && user.confirmation_token_valid?\n user.mark_as_confirmed!\n auth_token = JsonWebToken.encode({uuid: user.uuid})\n # render json: { auth_token: auth_token }, status: :ok\n redirect_to Rails.application.secrets.confirm_redirect\n else\n render json: { status: 'Invalid token' }, status: :not_found\n end\n end", "def operational?\n @user1_confirmed && @user2_confirmed\n end", "def confirmation_required?\n true\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def buyer_confirmed\n end", "def confirm_email\n logger.info \"Loading MemberUser confirm_email action\" \n token = params[:token]\n logger.debug \"Token - param: #{token.inspect}\"\n email = params[:email]\n logger.debug \"Email - param: #{email.inspect}\"\n member = Member.find_by_access_key(token)\n logger.debug \"Member found from token - attributes hash: #{member.attributes.inspect}\"\n @confirmed_status = false\n if member && member.user.try(:email) == email\n member.email_confirmed = true\n if member.save\n @confirmed_status = true\n end\n else\n logger.debug \"Error: Invalid request attributes when confirming email\"\n flash[:alert] = t(:security_error, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n end\n end", "def verify_register_conclusion\n if [email protected]_confirmed?\n flash[:notice] = \"Insira um e-mail pessoal para receber nossos avisos.\"\n redirect_to email_completar_path\n return false\n end\n if [email protected]_completed?\n flash[:notice] = \"Conclua sua inscrição para acessar todas as funções do sistema\"\n #flash[:notice] = \"Não é possível finalizar seu cadastro. Aguarde até o dia 20 para se inscrever novamente!\"\n redirect_to cadastro_completar_path\n return false\n end\n end", "def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && [email protected]?\n end", "def confirmation_required?\n return true\n end", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def confirmed\n confirmed_date.present?\n end", "def confirmation_required?; end", "def show \n @user.confirmed = true\n @user.save!\n Session.create(@user)\n flash[:notice] = \"Thanks, your email address has been confirmed.\" \n redirect_to dashboard_url \n end", "def confirm_event\n @event.update(confirmed: true)\n end", "def unconfirmed_user_only!\n unless current_user.email_confirmed?\n redirect_to root_path, alert: t('application.unconfirmed_user_only')\n end\n end", "def confirm_friend(user)\n friendships_unique = pending_accept.where(user_id: user.id).first\n friendships_unique.confirmed = true\n row = Friendship.new(user_id: friendships_unique.friend_id, friend_id: friendships_unique.user_id, confirmed: true)\n row.save\n friendships_unique.save\n end", "def confirm_user(user)\n confirmed_interpreter_requests.create(user_id: user.id)\n end", "def confirm\n\n end", "def confirm_event(event)\n participant_event = get_participant_event(event)\n return false if participant_event.nil? or not events_in_period(event.start, event.finish).empty?\n\n relation_user_route(event)\n participant_event.confirmed = true\n participant_event.save\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def confirm\n \t@delegation = current_user.employee_delegations.find_by(token: params[:delegation_id])\n \tif @delegation.nil?\n \t\tflash[:alert] = 'You are not authorised to access this page'\n \t\tredirect_to root_path and return\n \telse\n \t\[email protected]\n \t\tflash[:notice] = 'Request confirmed! Your account is now controlled by ' + @delegation.manager.full_identity\n redirect_to root_path and return\n \tend\n end", "def confirmed?\n request.cookies[cookie_name] && area.valid_code?(request.cookies[cookie_name])\n end", "def confirm_friend(user)\n friendship = inverse_friendships.find { |friendship| friendship.user == user }\n friendship.confirmed = true\n friendship.save\n end", "def require_confirmation\n if account_signed_in? and !current_account.confirmed?\n redirect_to waiting_pages_path\n end\n end", "def cofirm!\n confirmation_token=params[:header][:confirmation_token]\n @current_user=User.confirm confirmation_token if confirmation_token\n end", "def confirm\n end", "def confirm\n end", "def password_confirmed?\n params[:password] != params[:user][:password]\n end", "def confirmable?\n status.to_sym.in? [:done]\n end", "def user_verified; end", "def confirm_registration\n @user = User.find(params[:user_id])\n if @user.registration_token.eql?(params[:registration_token])\n #tokens match.. change user status and destroy token\n @user.status = true\n @user.registration_token = \"\"\n @user.save\n flash[:notice] = \"Congratulations \" + @user.login + \". Your account was successfully activated!\"\n else\n flash[:error] = \"Sorry the tokens mismatch, please make sure that you are accessing the correct link.\" \n end\n end", "def confirm_invitation\n @teammate = Teammate.find(params[:teammate_id])\n return redirect_to forbidden_path unless @teammate.user_id == @current_user.id\n\n if params[:confirm] == 'accept'\n verified = @teammate.verify\n verified ? msg = 'Bem-vindo ao Time de Tripulantes!' : msg = 'Oops! Ocorreu um erro, tente novamente. Caso o erro persista peça para ser adicionado novamente ao time.'\n return redirect_to pitch_teammate_path(@pitch, @teammate), flash: { notice: msg }\n elsif params[:confirm] == 'decline'\n @teammate.destroy\n msg = \"Convite do time #{@teammate.pitch.name} Rejeitado com Sucesso.\"\n return redirect_to root_path, flash: { notice: msg }\n end\n end", "def confirm\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = ConfirmUserCommand.new(user, params[:code], request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n redirect_to signin_url\n else\n render 'confirmed'\n end\n end", "def confirmation_required?\n false\n end" ]
[ "0.78469753", "0.7830473", "0.7784846", "0.77408576", "0.7716661", "0.76457757", "0.75980616", "0.75683516", "0.7557578", "0.7520796", "0.75201774", "0.7513385", "0.7513385", "0.7498532", "0.7427572", "0.7396396", "0.7350113", "0.7329889", "0.7323699", "0.73075587", "0.7290944", "0.72902584", "0.72276413", "0.7199569", "0.71945477", "0.71875364", "0.7172615", "0.713527", "0.7114892", "0.7105275", "0.7085122", "0.7078674", "0.7058426", "0.70445454", "0.70187277", "0.7010415", "0.6987947", "0.6986935", "0.6963146", "0.6956063", "0.6953578", "0.69385654", "0.69353944", "0.69346976", "0.6918656", "0.69171643", "0.6896814", "0.6895944", "0.68689096", "0.6852579", "0.6852162", "0.6819311", "0.681891", "0.68014437", "0.6790654", "0.67906284", "0.6789759", "0.67705333", "0.67624855", "0.6759748", "0.6754266", "0.67428017", "0.6734326", "0.6718891", "0.6708617", "0.6703358", "0.6703069", "0.66946405", "0.6684259", "0.6683455", "0.6670936", "0.66570824", "0.66493", "0.6648754", "0.6647668", "0.66461545", "0.6635072", "0.6624466", "0.66096705", "0.66067195", "0.6594888", "0.6594212", "0.6592787", "0.65904146", "0.65833354", "0.65695196", "0.6566211", "0.6549631", "0.65394974", "0.6531868", "0.65296674", "0.652604", "0.652604", "0.6525829", "0.6525138", "0.6517204", "0.650881", "0.6503661", "0.6487626", "0.64843404" ]
0.7725756
4
The message to be shown if the account is inactive. source://devise//lib/devise/models/confirmable.rb149
def inactive_message; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inactive_message\n \"This account has been deactivated or doesn't have account.\"\n end", "def inactive_message\n !confirmed? ? :unconfirmed : super\n end", "def inactive_message\n 'Sorry, this account has been deactivated.'\n end", "def inactive_message\n !deactivated_at ? super : :deactivated_account\n end", "def inactive_message\n\t\t\"Sorry, this account not active by admin. Will Contact you soon.\"\n\tend", "def inactive_message\n deactivated_at.present? ? 'Account has been deactivated' : super\n end", "def inactive_message\n isActive ? super : :inative_account\n end", "def inactive_message\n deactivated? ? :deactivated : super\n end", "def inactive_message\n !disabled ? super : :account_has_been_disabled\n end", "def inactive_message\n !active? ? :inactive : super\n end", "def inactive_message\n login_email = multi_email.login_email_record\n\n if login_email && !login_email.primary? && !login_email.confirmed?\n :unconfirmed\n else\n super\n end\n end", "def inactive_message\n # this method actually is not implemented by devise_token_auth\n # instead, use devise_token_auth locales file or override #render_create_error_not_confirmed in controller\n # still not sure why it uses not_confirmed anyway, but at least I'm not the only one. See below\n #\n # This incomplete PR corrects it:\n # https://github.com/lynndylanhurley/devise_token_auth/pull/533\n # https://github.com/lynndylanhurley/devise_token_auth/pull/533/files\n end", "def inactive_message\n !disabled_at ? super : :deleted_account\n end", "def inactive_message\n\t\t\t!delete_flag ? super : :deleted_account\n\t\tend", "def inactive_message\n \t!deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !self.deleted_at ? super : :deleted_account\n end", "def inactive_message\n if !approved?\n :not_approved\n else\n super # mensaje\n end\n end", "def inactive_message \n !is_deleted ? super : :deleted_account \n end", "def inactive_message\n sms_confirmation_required? && !confirmed_sms? ? :unconfirmed_sms : super\n end", "def inactive_message\n if !approved?\n :not_approved\n else\n super\n end\n end", "def inactive_message\n\n date_restricted? ? :account_date_restricted : super\n\n end", "def inactive_message\n if !approved?\n :not_approved\n else\n super # Use whatever other message\n end\n end", "def inactive_message\n disabled? ? :disabled : super\n end", "def inactive_message\n # In order of priority\n if pending_deletion_since\n :pending_deletion\n elsif suspended_account\n :suspended\n else\n super\n end\n end", "def inactive_message\n \t!deleted_at ? super : :deleted_account\n end", "def inactive_message\n \t!deleted_at ? super : :deleted_account\n end", "def inactive_message\n \t!delete_flag ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account\n end", "def inactive_message\n !deleted_at ? super : :deleted_account \n end", "def inactive_message \n if !is_approved? \n :not_approved \n else \n super # Use whatever other message \n end \n end", "def inactive_message \n approved? ? super : :not_approved\n end", "def inactive_message \n if !approved? \n :not_approved \n else \n super # Use whatever other message \n end \n end", "def inactive_message \n \t!deleted_at ? super : :deleted_account \n end", "def inactive_message \n !deleted_at ? super : :deleted_account \n end", "def show_warning_if_not_confirmed!\n unless current_user.confirmed_at?\n flash.now['warning_persist'] = \"#{I18n.t('flash.warning.confirm_email.text')} <a href=\\\"#{resend_confirmation_email_dashboard_users_path}\\\">#{I18n.t('flash.warning.confirm_email.button')}</a>\".html_safe\n end\n end", "def inactive_message\n access_locked? ? :locked : super\n end", "def inactive_message\n deleted_at ? :deleted : super\n end", "def message\n unregistered = \"\"\n if self.status == STATES[:unregistered]\n unregistered = \"and unregistered #{self.updated_at.strftime(\"on %d.%m.%Y at %H:%M Uhr\")}\"\n end\n\n \"#{self.user.name} has enrolled to #{self.course.title} #{unregistered}\"\n end", "def inactive_notification(user)\n setup_email(user)\n \n @subject += subject_from_sym :inactive_notification\n @body[:name] = user.full_name || 'Eternos user'\n @body[:link] = account_setup_url(:id => user.perishable_token)\n add_category_header \"Inactive Account Notice\"\n end", "def banned?\r\n if current_user.present? && !current_user.activated?\r\n sign_out current_user\r\n flash[:error] = \"This account has been suspended....\"\r\n redirect_to new_user_session_path\r\n end\r\n end", "def bounce_notice_text(reason)\n case reason\n when :invalid\n 'Invalid e-mail or password'\n when :expired\n 'Password expired. Please click \"Forget password\"'\n when :blocked\n 'Account blocked. Please verify your e-mail address'\n end\n end", "def unconfirmed?\n !confirmed?\n end", "def is_confirmable?\n true\n end", "def inactive?\n\t\t\treturn account_life_cycle_status == INACTIVE \n\t\tend", "def status_message\n if self.deleted_at\n return \"Cancelled\"\n else\n if self.chosen_presenter == nil\n if self.help_required\n return \"Help Required\"\n elsif self.presenters.present?\n return \"Bids Pending\"\n else\n return \"Awaiting Bids\"\n end\n else\n if self.booking_date < Time.now\n return \"Completed\"\n else\n return \"Locked in\"\n end\n end\n end\n end", "def confirmed?\n flash[:alert] = 'Check your email to confirm yourself.(You are not allowed to create posts)' unless current_user&.email_confirmed?\n end", "def invalid_message\r\n @invalid_message ||= 'Please enter Yes or No.'\r\n end", "def accounts_not_available\n flash[:warning] = I18n.t(:user_system_down)\n redirect_to root_url\n end", "def booked_not_confirmed\n NotificationMailer.booked_not_confirmed\n end", "def inactive_user?\n self.status == \"Inactive\"\n end", "def canceled?\n (confirmations.last.try(:confirmed) == false)\n end", "def verify_banned_message\n if sender.banned?\n self.body = \"This user’s messages have been removed because #{sender.the_sex_prefix} activities violates the LoveRealm community standards. Do not correspond with #{sender.the_sex_prefix}\"\n self.kind = 'text'\n end\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def banned?\n if current_user.present? && current_user.banned?\n sign_out current_user\n flash[:error] = \"This account has been suspended.\"\n root_path\n end\n end", "def account_confirmed?\n confirmed?\n end", "def unconfirmed_user_only!\n unless current_user.email_confirmed?\n redirect_to root_path, alert: t('application.unconfirmed_user_only')\n end\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def confirm_account\n confirm\n end", "def unsubscribed_reason\n @attributes[:unsubscribed_reason]\n end", "def inactive?\n self.status == \"Inactive\"\n end", "def redirect_for_inactive\n if @connection.contact.deactivated?\n flash[:error] = t('connections.flash.error.invalid')\n redirect_to home_url\n end\n end", "def check_mail_confirmation\n return if current_user.client?\n\n unless current_user.confirmed?\n flash[:danger] = tf('common.flash.unconfirmed_mail')\n redirect_to :root\n end\n end", "def check_user_status\n if current_user.is_a?(User) && (current_user.suspended? || current_user.banned?)\n if current_user.suspended? \n flash[:error] = t('suspension_notice', :default => \"Your account has been suspended. You may not add or edit content until your suspension has been resolved. Please contact us for more information.\")\n else\n flash[:error] = t('ban_notice', :default => \"Your account has been banned. You are not permitted to add or edit archive content. Please contact us for more information.\")\n end\n redirect_to current_user\n end\n end", "def block_if_on_hold\n raise \"Account is currently on hold. Messaging is disabled.\" if current_account.on_hold?\n end", "def redirect_for_inactive\n if @connection.contact.deactivated?\n flash[:error] = \"Invalid connection request: person deactivated\"\n redirect_to home_url\n end\n end", "def confirming?\n self.status == 'confirming'\n end", "def camaleon_mailchimp_on_inactive(plugin)\n end", "def confirm_msg\n amt = CalcTotal::get_amt\n msg = amt && amt > 0 ? \"Your credit card \" : \"Your order \"\n msg += \"will be processed. Would you like to proceed?\"\n end", "def confirmation_period_expired?; end", "def message\n return MSG_NOT_ENROLLED unless enrolled?\n return MSG_FULL_ACCESS if registered?\n return MSG_LIMITED_ACCESS if twenty_percent_cnp_exception?\n MSG_FEES_UNPAID\n end", "def atest_ID_25861_suspended_user_notification()\n # Need suspended account\n end", "def atest_ID_25861_suspended_user_notification()\n # Need suspended account\n end", "def user_status(activated_date)\n if activated_date.blank?\n return \"Inactive\"\n else\n return \"Active\"\n end \n end", "def contact_form_on_inactive(plugin)\n\n end", "def verify_active\n account = Account.find(params[:id])\n if account.active_until < Time.now.utc\n if account.stripe_customer_id\n flash[:subscription_expired] = \"Your subscription has expired! Don't worry, your data is perfectly fine, but you'll need to update your payment information -- it looks like there was a problem charging your card on file.\"\n session[\"preferred_account_id\"] = account.id\n redirect_to edit_subscription_path\n else\n flash[:subscription_expired] = \"Your subscription has expired! Don't worry, your data is perfectly fine, but you'll need to enter your payment information and become a paying subscriber.\"\n session[\"preferred_account_id\"] = account.id\n redirect_to new_subscription_path\n end\n end\n end", "def redirect_for_inactive\n #if @friendship.friend.deactivated?\n # flash[:error] = \"Invalid connection request: person deactivated\"\n # redirect_to people_url\n #end\n end", "def disable_inactivity_email\n @user.update_attributes(:is_receiving_inactivity_email => false)\n @notice = \"You have disabled inactivity notifications.\"\n \n respond_to do |format|\n format.html {\n redirect_to(manage_email_notifications_path, notice: @notice) and return\n return \n }\n format.js {\n render :unsubscribe\n }\n end\n end", "def inactive_status?\n status.type.abbreviation == 'inactive' rescue false\n end", "def account_activated\n participant = Participant.first\n ParticipantMailer.account_activated(participant)\n end", "def msg\n 'Are you sure? All your changes will be lost.'\n end", "def is_activated\r\n\t\tif !current_user.activated\r\n\t\t\tlog_out\r\n\t\t\tredirect_to root_path\r\n\t\t\tflash[:error] = \"You have been logged out.\"\r\n\t\tend\r\n\tend", "def check_access\n redirect_to billing_path, flash: { error: \"Your account is inactive. Access will be restored once payment succeeds.\" } if current_account.try(:inactive?)\n end" ]
[ "0.8679988", "0.8592619", "0.8471468", "0.83412904", "0.83224565", "0.8293807", "0.8217918", "0.8154596", "0.81055176", "0.80198264", "0.8008656", "0.8002959", "0.7838289", "0.77385694", "0.77076703", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.76792544", "0.7637967", "0.76339775", "0.76220196", "0.76170176", "0.7614854", "0.7596154", "0.7588078", "0.7580899", "0.7561415", "0.7527011", "0.7527011", "0.74729604", "0.74620223", "0.737793", "0.73320216", "0.7328607", "0.73229176", "0.73161435", "0.7308316", "0.69302726", "0.67170966", "0.66857266", "0.660741", "0.64164835", "0.6296803", "0.6177279", "0.61018443", "0.60788065", "0.5946689", "0.59127176", "0.58977437", "0.5889029", "0.5876298", "0.5847897", "0.5847466", "0.58463603", "0.57681036", "0.5767382", "0.5767382", "0.5763634", "0.5742689", "0.5738516", "0.57318884", "0.57202554", "0.5708862", "0.5684348", "0.56802267", "0.5678403", "0.56744224", "0.567394", "0.5672755", "0.5665744", "0.56620747", "0.5632422", "0.5627781", "0.56188077", "0.5611414", "0.5611414", "0.5610911", "0.55858546", "0.55849314", "0.5565715", "0.55483663", "0.5545858", "0.5539718", "0.55262053", "0.55204237", "0.55163175" ]
0.7390174
45
Resend confirmation token. Regenerates the token if the period is expired. source://devise//lib/devise/models/confirmable.rb134
def resend_confirmation_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def resend_token\n @user = TempUser.find_by(username: params[:username])\n if @user.present?\n @user.generate_confirmation_instructions\n @user.save\n send_confirmation_email\n render json: { status: 'Confirmation token was resent to your email' }, status: :ok\n else\n render json: { status: 'Invalid username' }, status: :not_found\n end\n end", "def resend_confirmation_token\n if accepted_or_not_invited?\n # User was not invited or has already accepted (in the latter case we are probably dealing with a reconfirmation e-mail), simply resend confirmation e-mail:\n super\n else\n # User was invited. Do not (re)send confirmation e-mail, but resend invitation e-mail instead:\n self.invite!\n end\n end", "def resend_sms_token\n unless_sms_confirmed { send_sms_token }\n end", "def generate_confirmation_token\n if self.confirmation_token && !confirmation_period_expired?\n @raw_confirmation_token = self.confirmation_token\n else\n raw, _ = Devise.token_generator.generate(self.class, :confirmation_token)\n self.confirmation_token = @raw_confirmation_token = raw\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def confirm_by_token(confirmation_token); end", "def confirm!\n update_attribute('portal_last_confirm_date__c', Time.now)\n settings.update_attribute('token',generate_token)\n end", "def update\n return render status: :unprocessable_entity, json: {errors: [I18n.t('errors.insufficient_params')]} unless params[:token]\n confirmation = UserConfirmation.find_by(c_type: :reset_password, status: :pending, token: params[:token])\n return render status: :unauthorized, json: {errors: [I18n.t('errors.invalid_token')]} if confirmation.nil?\n confirmation.user.update(confirmed_at: Time.zone.now) unless confirmation.user.confirmed?\n return render status: :unauthorized, json: {errors: [I18n.t('errors.late_token')]} if confirmation.created_at + RESET_TOKEN_LIFETIME < Time.zone.now\n confirmation.update(status: :approved)\n session = Session.create(user: confirmation.user)\n token = JsonWebToken.encode({user_id: confirmation.user.id, uid: session.uid, exp: 1.hours.from_now.to_i})\n redirect_to EMAIL_RESET_SITE + \"?token=#{token}\"\n end", "def confirmation_period_expired?; end", "def generate_confirm_email_token!\n self.confirm_email_token = SecureRandom.hex(10)\n self.email_confirmed_at = nil\n self.save!\n end", "def send_confirmation_token\n generate_token(:confirmation_token)\n self.confirmation_token_sent_at = Time.zone.now\n save!\n UserMailer.delay.account_confirmation(self)\n end", "def confirmation_token\n self.confirm_token = SecureRandom.urlsafe_base64.to_s if confirm_token.blank?\n end", "def resend\n @invitation = Invitation.with_token!(params[:id])\n\n authorize! @invitation\n\n InvitationMailer.delay.invitation_email(@invitation)\n\n redirect_to :back, notice: \"Successfully resent\n invitation for #{@invitation.email}\"\n end", "def confirm(token = nil)\n if ActiveSupport::SecurityUtils.secure_compare(token, confirmation_token)\n self.confirmation_token = nil\n self.password = SecureRandom.hex(8) unless password_digest.present?\n self.confirmed_at = Time.now.utc\n end\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def confirmation_token\n if self.confirm_token.blank?\n self.confirm_token = SecureRandom.urlsafe_base64.to_s\n end\n end", "def confirmation_token\n if self.confirm_token.blank?\n self.confirm_token = SecureRandom.urlsafe_base64.to_s\n end\n end", "def generate_confirmation_token; end", "def resend_confirmation_email\n WEPAY.call('/user/resend_confirmation', self.wepay_access_token, {\n email_message: 'Thank you for signing up with WeCrowd. In order to process payments, you will need to confirm your email address and set a secure payment password. Click the \"confirm\" button below to begin.'\n })\n end", "def confirm_email\n @token = params[:token]\n end", "def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def reset_confirmation\n self.confirmed_at = nil\n end", "def generate_confirmation_token\n end", "def invalidate_token(user)\n user.renew_token\n user.save\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def generate_confirmation_token\n unless self.confirmation_token\n self.confirmation_token = generate_unique_secure_confirmation_token()\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def expiring_token(token)\n @token = token\n @access_token = token.oauth_access_token\n\n mail(to: @token.user.email, from: Settings.mailer.from)\n end", "def confirm_password_reset!\n if password_resettable?\n password_reset_token.confirm!\n self\n else\n raise Pillowfort::TokenStateError\n end\n end", "def send_confirmation_email\n sleep(10)\n self.confirmation_token = SecureRandom.hex(16)\n self.save\n UserMailer.confirmation_email(self).deliver\n end", "def generate_confirmation_token\n self.confirmation_token = new_confirmation_token\n self.confirmation_sent_at = Time.now.utc\n end", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def cofirm!\n confirmation_token=params[:header][:confirmation_token]\n @current_user=User.confirm confirmation_token if confirmation_token\n end", "def refreshToken\n # is there a token? (and is it's timestamp not older than 24h?)\n if @token.nil? or @tokenTimeStamp < Time.now - 86400\n @token = getToken(@email,@password)\n @tokenTimeStamp = Time.now\n end\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def confirm\n @doctor = Doctor.find_by_confirmation_token(params[:confirmation_token])\n \n if @doctor.present?\n @doctor.update_attributes(confirmed_at: DateTime.now)\n render json: {message: \"Your account has been confirmed at #{@doctor.confirmed_at}.You can Sign in Now!\"}\n else \n render json: {alert: \"Confirmation Link has Expired.\"}\n end\n\n end", "def perform_confirmation(confirmation_token)\n self.confirm if self.persisted?\n self.confirmation_token = confirmation_token\n end", "def set_confirmation_token\n SecureRandom.hex(16)\n end", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def confirm_registration\n @user = User.find(params[:user_id])\n if @user.registration_token.eql?(params[:registration_token])\n #tokens match.. change user status and destroy token\n @user.status = true\n @user.registration_token = \"\"\n @user.save\n flash[:notice] = \"Congratulations \" + @user.login + \". Your account was successfully activated!\"\n else\n flash[:error] = \"Sorry the tokens mismatch, please make sure that you are accessing the correct link.\" \n end\n end", "def confirm\n token = params[:confirmation_token].to_s\n user = TempUser.find_by(confirmation_token: token)\n if user.present? && user.confirmation_token_valid?\n user.mark_as_confirmed!\n auth_token = JsonWebToken.encode({uuid: user.uuid})\n # render json: { auth_token: auth_token }, status: :ok\n redirect_to Rails.application.secrets.confirm_redirect\n else\n render json: { status: 'Invalid token' }, status: :not_found\n end\n end", "def renew_token\n body_params = token_request_body\n body_params << [\"refresh_token\", current_user.refresh_token]\n body_params << [\"grant_type\", \"refresh_token\"]\n\n get_token(body_params)\n redirect_to sage_accounting_data_path\n end", "def invalidate_token\n update_attribute(:token, nil)\n update_attribute(:token_created_at, Time.now)\n end", "def token\n refresh_token! if token_expired?\n super\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def reset_token!\n token = Devise.friendly_token[0,20]\n self.password = self.password_confirmation = token\n self.email = \"#{name}@scribe\"\n save! validate: false\n token\n end", "def resend_confirmation_instructions\n pending_any_confirmation do\n send_confirmation_instructions\n end\n end", "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end", "def remind \n touch :reminded_at\n\n UserMailer.access_token_renewal_reminder(user).deliver\n end", "def expire\n touch :expires_at\n\n user.subscriptions.facebook.each do |subscription|\n subscription.deactivate\n end\n\n UserMailer.access_token_expired_email(user).deliver\n end", "def password_reset\n\t token = params.first[0]\n\t @user = User.find_by_confirm_token(token)\n\n\t if @user.nil?\n\t flash[:error] = 'You have not requested a password reset.'\n\t return redirect_to :root\t \n\t end\n\n\t if @user.password_expires_after < DateTime.now\n\t clear_password_reset(@user)\n\t @user.save\n\t flash[:error] = 'Password reset has expired. Please request a new password reset.'\n\t redirect_to :forgot_password\n\t end\n\tend", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def revoke!\n self.class.transaction do\n update_attribute :revoked, Time.now\n client.increment! :tokens_revoked\n end\n end", "def check_token_expiration\n return unless @person.password_reset_expired?\n\n flash[:danger] = I18n.t('password_reset.expired_token')\n redirect_to new_password_reset_url\n end", "def resend_activation_email\n create_activation_digest\n save\n send_activation_email\n end", "def confirm_by_token(confirmation_token)\n activatable = find_first_by_auth_conditions(confirmation_token: confirmation_token)\n unless activatable\n confirmation_digest = Devise.token_generator.digest(self, :confirmation_token, confirmation_token)\n activatable = find_or_initialize_with_error_by(:confirmation_token, confirmation_digest)\n end\n\n # TODO: replace above lines with\n # confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n # after enough time has passed that Devise clients do not use digested tokens\n\n activatable.confirm if activatable.persisted?\n activatable\n end", "def mark_as_confirmed!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save\n end", "def revoke!\n return if revoked?\n update(revoked_at: Time.now)\n tokens.update_all(revoked_at: Time.now, updated_at: Time.now)\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def send_password_reset\n\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def refresh_auth_token\n generate_token(:auth_token)\n save!\n end", "def revoke!\n self[:revoked] = Time.now\n save\n Client[client_id].token_revoked\n end", "def send_reconfirmation_instructions\n end", "def refresh_access_token\n self.expires_at = Time.now + 3600 \n save\n end", "def refresh_token\n authorize current_user\n original = current_user.api_token\n current_user.generate_token!\n @success = current_user.api_token != original\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def regenerate_token\n self.auth_token = nil\n generate_token\n save!\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm_reset\n \n new_pass = params[:password]\n token = params[:token]\n if User.confirm_reset token, new_pass\n head :no_content\n else\n render json: {message: error_messages[:incorrect_reset_token]},\n status: :unprocessable_entity\n end\n end", "def suspend_account\n if pending_deletion_since\n # Overwrite the value sent by the client with our server time\n self.pending_deletion_since = DateTime.now\n self.suspended_account = true\n regenerate_authentication_token\n end\n end", "def deliver_activation_confirmation!\n reset_perishable_token!\n Mailer.deliver_activation_confirmation(self)\n end", "def invalidate_token\n \tupdate_columns(token: '')\n \ttouch(:token_created_at)\n \tend", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def create_or_renew_token()\n calculate_expiry_time()\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def send_confirmation\n self.update_column(:password_reset_token, SecureRandom.urlsafe_base64)\n self.update_column(:password_sent_at, Time.zone.now)\n UserMailer.send_confirmation_mail(self).deliver\n end", "def reset_email_token!\n reset_email_token\n save_without_session_maintenance(validate: false)\n end", "def resend_activation\n current_user.send_activation!\n\n flash[:notice] = \"Activation email delivered successfully.\"\n redirect_to user_url\n end", "def renew\n req_body = { grant_type: 'refresh_token', refresh_token: @token.refresh_token }\n\n response = JSON.parse(request_token(req_body).body)\n\n @token.update!(response['access_token'], response['expires_in'], response['refresh_token'])\n\n save\n rescue StandardError => e\n puts \"Unable to refresh token\\n#{e.message}\"\n end", "def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end", "def expire!\n token = nil\n save!\n end", "def regenerate_auth_token!\n generate_auth_token\n set_auth_token_expiry\n\n save\n end", "def skip_reconfirmation!; end", "def confirm!\n update!(confirmed_at: DateTime.now)\n end", "def renew access_token, expires_at\n update_attributes token: access_token, expires_at: expires_at, reminded_at: nil\n\n user.subscriptions.facebook.unscoped.each do |subscription|\n subscription.activate\n end\n end", "def reset_password_with_token\n user = User.first(:perishable_token => params[:token])\n if user.nil? || user.password_reset_sent.to_time < 2.days.ago\n flash[:notice] = \"Your link is no longer valid, please request a new one.\"\n redirect_to \"/forgot_password\"\n else\n @token = params[:token]\n @user = user\n render \"login/password_reset\"\n end\n end", "def revert\n user = UserRevertsEmailConfirmation.new(:token => params[:token]).call\n\n if current_user == user\n redirect_to profile_url\n else\n redirect_to profile_url, :notice => \"There was a problem reverting the email change - try again?\"\n end\n end", "def invalidate_token \n self.update_columns(auth_token: nil)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver \n end", "def clear_reset_password_token; end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def new_confirmation_token\n #It's only in Ruby 1.9\n #see https://github.com/rails/rails/commit/b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5\n SecureRandom.base64.gsub(\"/\",\"_\").gsub(/=+$/,\"\")\n end", "def refresh_token\n return if token\n refresh_token!\n end", "def expire!\n Freemium.mailer.deliver_expiration_notice(self)\n # downgrade to a free plan\n self.expire_on = Date.today\n self.subscription_plan = Freemium.expired_plan if Freemium.expired_plan\n self.destroy_credit_card\n self.save!\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now \n save!\n UserMailer.password_reset(self).deliver\n end" ]
[ "0.7557223", "0.72840583", "0.7198983", "0.7076125", "0.7062729", "0.69289696", "0.69039595", "0.6817808", "0.67837936", "0.6746653", "0.67450845", "0.67295027", "0.67222977", "0.66302145", "0.66185296", "0.65969205", "0.65094525", "0.6508794", "0.64993095", "0.6438987", "0.64326483", "0.641293", "0.6385765", "0.6345639", "0.63306284", "0.632373", "0.632194", "0.63204986", "0.630877", "0.63071597", "0.629858", "0.625746", "0.62230253", "0.6213988", "0.6213794", "0.6196562", "0.61918867", "0.61880946", "0.61810184", "0.6180852", "0.61716074", "0.6168913", "0.61624825", "0.6113721", "0.61120975", "0.6111608", "0.6077749", "0.6068222", "0.60645664", "0.60593677", "0.6053338", "0.6016375", "0.6016346", "0.6004418", "0.5971996", "0.597137", "0.595702", "0.59525675", "0.59496814", "0.59486264", "0.5926522", "0.58534056", "0.584821", "0.5843995", "0.5830178", "0.5826787", "0.5826707", "0.5825532", "0.581819", "0.58153504", "0.5815063", "0.58100104", "0.58035976", "0.58026636", "0.5796312", "0.5795401", "0.57907844", "0.5790746", "0.5783943", "0.57822216", "0.57722026", "0.5766725", "0.57425135", "0.5737793", "0.5729272", "0.572351", "0.5719165", "0.57177055", "0.5696011", "0.5691125", "0.5688148", "0.5684023", "0.5680532", "0.5679831", "0.56777406", "0.5666581", "0.56608045", "0.5659376", "0.5655658", "0.564715" ]
0.64793414
19
Send confirmation instructions by email source://devise//lib/devise/models/confirmable.rb115
def send_confirmation_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_confirmation_instructions\n ConfirmationMailer.confirmation_instructions(self).deliver\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def send_confirmation_instructions\n generate_confirmation_token! if self.confirmation_token.nil?\n ::Devise.mailer.confirmation_instructions(self).deliver\n end", "def confirmation_instructions(record)\n devise_mail(record, :confirmation_instructions)\n end", "def confirmation_instructions(record, opts={})\n devise_mail(record, :confirmation_instructions)\n end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def email_confirm\n end", "def confirmation_instructions\n [send_email(MailPart.new_subject(I18n.t('email.confirmation_instructions_subject', home_parish: Visitor.home_parish)),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:confirmation_instructions],\n conf_insts_call),\n @candidate_mailer_text.token]\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def send_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def confirmation_instructions(user, token, somethingElse)\n AccountMailer.default_url_options[:host] = \"tep-lending-library.herokuapp.com\"\n @resource = user\n @password = user.password\n @token = token\n @name = user.first_name\n @email = user.email\n mail(to: @resource.email, subject: \"Confirm Email\", :tag => \"Welcome to the TEP Lending Library!\")\n mail.delivery_method.settings.merge! @@smtp_settings\n mail\n end", "def confirm!\n welcome_email\n super\n end", "def confirmation(user)\n @user = user\n @user.generate_confirmation_code\n mail(to: @user.email, subject: \"Confirmation\") do |f|\n f.html\n end\n\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n RolloverMailer.confirmation_instructions(self, @raw_confirmation_token).deliver_now\n end", "def send_confirmation\n send_message(\"confirmation\")\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def confirmation_instructions(record, token, opts={})\n update_email = record.confirmed? && record.unconfirmed_email?\n template = update_email ? 'reconfirmation-instructions' : 'confirmation-instructions'\n email = update_email ? record.unconfirmed_email : record.email\n MnoEnterprise::MailClient.deliver(template,\n default_sender,\n recipient(record).merge(email: email),\n user_vars(record).merge(confirmation_link: user_confirmation_url(confirmation_token: token))\n )\n if update_email\n MnoEnterprise::MailClient.deliver('email-change',\n default_sender,\n recipient(record),\n user_vars(record).merge(unconfirmed_email: record.unconfirmed_email)\n )\n end\n end", "def send_free_confirmation\n send_free_message(\"confirmation\")\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def send_confirmation\n reply 'confirmation'\n end", "def send_confirmation_email\n return false if /\\w@(example)\\.com/.match(self.email)\n UserMailer.confirmation(self).deliver unless confirmed?\n end", "def resend_confirmation_instructions; end", "def confirmation_instructions(record, token, _opts = {})\n url = confirmation_url(record, confirmation_token: token)\n set_template('04e87e44-5fcf-4cc2-b7b8-776beb6da4e5')\n set_personalisation(\n token_url: url\n )\n mail(to: record.email)\n end", "def confirmation\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def host_confirmation\n \t#binding.pry\n \tSendMailToHost.host_confirmation(self).deliver!\n end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def confirm_email(user)\n @user = user\n @confirm_url = \"http://www.yscalumni.org/confirm/\" + user.confirmation_code\n mail(:to => user.email, :subject => \"Welcome to yscalumni.org! Please confirm your email!\")\n end", "def confirm_request\n @email = params[:email]\n @confirmation_code = params[:confirmation_code]\n mail to: @email\n end", "def send_confirmation_email\n # Do Nothing\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def confirm\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def confirmarCotizEscCam\n GeneradorCorreoMailer.confirmarCotizEscCam\n end", "def confirmarCotizMesExp\n GeneradorCorreoMailer.confirmarCotizMesExp\n end", "def adminConfirmation\n ContactMailer.adminConfirmation\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def sendmail_confirm(greeting, text, address, subject)\n @greeting = greeting\n\n @text = text\n mail to: address, subject: subject\n end", "def reservation_confirmation\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def send_confirmation\n @visit=Visit.find(params[:id])\n begin\n PandaMailer.visit_confirmation(@visit, params[:email]).deliver\n flash[:notice] = \"Email was succesfully sent.\"\n rescue StandardError => error\n logger.info error\n flash[:error] = \"Sorry, your email was not delivered: \" + error.to_s\n end\n redirect_to @visit\n end", "def send_confirmation\n @visit=Visit.find(params[:id])\n begin\n PandaMailer.visit_confirmation(@visit, params[:email]).deliver\n flash[:notice] = \"Email was succesfully sent.\"\n rescue StandardError => error\n logger.info error\n flash[:error] = \"Sorry, your email was not delivered: \" + error.to_s\n end\n redirect_to @visit\n end", "def send_confirmation\n @visit=Visit.find(params[:id])\n begin\n PandaMailer.visit_confirmation(@visit, params[:email]).deliver\n flash[:notice] = \"Email was succesfully sent.\"\n rescue StandardError => error\n logger.info error\n flash[:error] = \"Sorry, your email was not delivered: \" + error.to_s\n end\n redirect_to @visit\n end", "def send_confirmation_instructions(attributes = T.unsafe(nil)); end", "def triggerConfirmation\n\n user = getUserByAuthToken(request)\n user.resend_confirmation_instructions\n\n if(user.errors.blank?)\n logger.info \"Email confirmation instructions were sent for user #{user.email}\\n\"\n raw_token = user.instance_variable_get(\"@raw_confirmation_token\")\n\n the_response = { :confirmation_sent_at => user.confirmation_sent_at }\n\n enable_test_hooks = Rails.application.config.enable_test_hooks\n if(enable_test_hooks)\n # Assume we're in test environment - add hook in response to enable testing\n logger.info \"Including raw confirmation token in response: #{raw_token}\\n\"\n the_response[:confirmation_token] = raw_token\n end\n\n render :status => 201, :json => the_response\n else\n if(!user.errors.messages[:email].blank?)\n logger.error \"Devise said: \\\"#{user.errors.messages[:email]}\\\". Interpret as no email confirmation pending for #{user.email} (user id: #{user.id}), instructions will not be emailed.\\n\"\n render :status => 412, :json => {:error => \"No email confirmation pending\"}.to_json\n else\n logger.error \"Unexpected error encountered when attempting to send confirmation instructions for #{user.email}. Error: #{user.errors.inspect}.\\n\"\n render :status => 500, :json => {:error => I18n.t(\"500response_internal_server_error\")}.to_json\n end\n end\n end", "def confirmation_instructions(user, token, opts)\n my_mail = Mailjet::Send.create(messages: [{\n 'From'=> {\n 'Email'=> Rails.application.credentials.default_email,\n 'Name'=> 'Alim-Alo'\n },\n 'To'=> [{\n 'Email'=> user.email,\n 'Name'=> \"User <3\"\n }],\n 'Subject'=> 'Merci de votre inscription.',\n 'HTMLPart'=> \"<h1>Merci de votre inscription!</h1>\n <a href= '#{user_confirmation_url(@resource, confirmation_token: token)}'>Confirmer mon compte</a>\"\n }]\n )\n\n end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def send_confirmation_instructions(opts=nil)\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts ||= {}\n\n # fall back to \"default\" config name\n opts[:client_config] ||= \"default\"\n\n if pending_reconfirmation?\n opts[:to] = unconfirmed_email\n end\n\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def sendmail_confirm\n @greeting = \"元気ー?\"\n\n mail to: \"[email protected]\"\n end", "def confirmarCotizMesCam\n GeneradorCorreoMailer.confirmarCotizMesCam\n end", "def custConfirmation\n ContactMailer.custConfirmation\n end", "def confirmation_instructions(record, token, opts={})\n\t\t@user_name = record.full_name\n \t\t@confirmation_link = \"#{ENV['DOMAIN']}/users/confirmation?confirmation_token=#{token}\"\n\t\tp \"-----------------------------------------------------------------------------\"\n\t\tp \"Confirmation mail for new user - #{record.email}\"\n\t\tp \"-----------------------------------------------------------------------------\"\n \t\t# mail(\"user-mail-confirmation\",email: record.email)\n \t\tmail(to: \"[email protected]\", from: \"[email protected]\", subject: \"Sample Registration\")\n\tend", "def send_confirmation_instructions(opts=nil)\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts ||= {}\n\n # fall back to \"default\" config name\n opts[:client_config] ||= \"default\"\n\n if pending_reconfirmation?\n opts[:to] = unconfirmed_email\n end\n opts[:redirect_url] ||= DeviseTokenAuth.default_confirm_success_url\n\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def send_reconfirmation_instructions\n end", "def confirmation_instructions(record, token, opts={})\n @token = token\n @resource = record\n @resource = record\n require 'mailgun'\n mg_client = Mailgun::Client.new \"key-a2ba6d81aa1687b45c6ea03b82221013\"\n\n html = render_to_string template: \"devise/mailer/confirmation_instructions.html.erb\"\n # Define your message parameters\n message_params = {:from => 'Articity <[email protected]>',\n :to => record.email,\n :subject => 'Welcome to Articity!',\n :html => html.to_str}\n\n # Send your message through the client\n mg_client.send_message \"mail.articity.in\", message_params\n end", "def send_confirmation_to(user)\n token_link = \"http://localhost:9292/validate/\" + user.validation_token\n template_locals = { :user => user, :token_url => token_link}\n send_email_to_user(user,\"Frank requests that you verify your email address.\" ,:'mail/new_registration', template_locals)\n end", "def sendmail_confirm(user)\n @user = user\n mail(to: user.email,\n subject: \"会計よりお知らせ\")\n end", "def send_confirmation_email\n BetaMailer.send_beta_confirmation_email(self).deliver_later\n end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def confirm_account(user)\n @name = user.first_name\n @confirm_url = confirm_url(user.token)\n\n mail to: user.email, subject: 'Account confirmation'\n end", "def account_confirmed(user)\n @notify_subject = strip_tags( \"USER CONFIRMED ACCOUNT AT #{ENV['APPLICATION_CONFIG_name']}\")\n @user = user\n mail( :to => ENV['APPLICATION_CONFIG_admin_notification_address'], :subject => @notify_subject)\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def user_confirm_email(current_user)\n @current_user = current_user\n mail(to: current_user.email, subject: 'Confirm Email', from:\"PawBookings <[email protected]>\")\n end", "def confirmation\n @order = params[:order]\n mail to: @order.client.email, subject: \"Ordem de Serviço para #{@order.client.razao_social}\"\n end", "def user_new_item_confirmation\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\", subject: \"Item Confirmation\"\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def registration_confirmation(user)\n @user = user\n\n mail to: \"[email protected]\", subject: \"Success! You did it.\"\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def email_activation_confirmation(email)\n setup_email(email.user, email.address)\n @subject += 'A new email address has been activated'\n @body[:url] = \"#{SITE_URL}/\"\n end", "def confirmation_instructions(record, token, _opts = {})\n options = {\n to: record.email,\n subject: 'Welcome to Railway',\n template_id: 'f025ac9f-bcd3-41d7-a46a-fe8c43e3f27a',\n substitutions: {\n '-url-': confirmation_url(record, confirmation_token: token)\n }\n }\n sendgrid_send options\n end", "def generate_confirmation_instructions\n self.confirmation_token = SecureRandom.hex(10)\n self.confirmation_sent_at = Time.now.utc\n end", "def signup_confirmation_advisee(user)\n @user = user\n mail to: @user.email, subject: \"Advisee new registration\"\n end", "def send_confirmation_email\n sleep(10)\n self.confirmation_token = SecureRandom.hex(16)\n self.save\n UserMailer.confirmation_email(self).deliver\n end", "def referral_confirmation_email\n\n end", "def confirmation_instructions(record)\n headers['X-SMTPAPI'] = '{\"category\": \"FF-Rails-DeviseConfirmation\"}'\n super\n end", "def activation_confirmation(user)\n user_login_link(user)\n\n @greeting = \"Thank you for choosing Contractor\"\n @name = user.name\n\n mail to: user.email\n end", "def register_confirmation(address)\n \tmail to: address\n # mail to: '[email protected]'\n end", "def signup_confirmation(user_id)\n # Will make the newly registered user available to the view that will generate the email content\n @user = User.find(user_id)\n\n mail to: @user.email, subject: \"Sign up confirmation\"\n end", "def send_on_create_confirmation_instructions\n if self.email.match /tu-dresden.de$/\n send_devise_notification(:confirmation_instructions)\n else\n false\n end\n end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def signup_confirmation user\n @user = user\n mail to: user.email, subject: \"Welcome to the Clone\"\n end", "def send_confirmation_email\n\t\tRentersConfirmationJob.perform_later self\n OwnersConfirmationJob.perform_later self\n\tend", "def send_on_create_confirmation_instructions\n end", "def send_confirmation_email\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = SendConfirmationEmailCommand.new(user, current_user,\n request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = 'Confirmation email sent.'\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end", "def order_confirmation_email(customer)\n @customer = customer\n\n mail to: @customer.email, subject: 'Your Order Confirmation'\n end", "def order_confirmation\n user = User.first\n order = Order.last\n UserMailer.order_confirmation(user, order)\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def activation_confirmation(user)\n @root_url = root_url\n mail(:subject => setup_subject(I18n.t('activation_complete')),\n :to => user.email)\n end", "def signup_confirmation(user)\n @user = user\n\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def send_on_create_confirmation_instructions\n end", "def send_confirmation_email\n begin\n UserMailer.registration_email(self).deliver\n rescue Exception => e\n logger.error \"Mail delivery failed: #{e}\"\n return false\n end\n return true\n end", "def confirmation_instructions(admin, candidate_mailer_text)\n token = generate_confirmation_token\n candidate_mailer_text.token = token\n devise_mailer.confirmation_instructions(self, token, admin: admin)\n end", "def registration_confirm\n mail = RegistrationMailer.confirm(temporary_registration)\n destroy_fixtures\n mail\n end" ]
[ "0.8230418", "0.8221189", "0.7924435", "0.7915788", "0.7755201", "0.77465117", "0.7712627", "0.7629362", "0.75799805", "0.74976224", "0.7480876", "0.7476036", "0.7473577", "0.743971", "0.7435824", "0.74258417", "0.74232", "0.73813874", "0.7340702", "0.7339354", "0.7315351", "0.7313311", "0.72947705", "0.72890663", "0.7285587", "0.7272095", "0.72472996", "0.7238578", "0.71800256", "0.71786", "0.71726316", "0.71723384", "0.7168951", "0.7145792", "0.7145792", "0.71317184", "0.7121053", "0.7094311", "0.70848995", "0.70753753", "0.70412517", "0.7035946", "0.70302063", "0.70145035", "0.70069623", "0.70069623", "0.70069623", "0.6996423", "0.6989328", "0.6986167", "0.6976256", "0.6974279", "0.6965492", "0.69635975", "0.6951078", "0.69509995", "0.69424427", "0.69324887", "0.6927891", "0.69145834", "0.6912027", "0.69013596", "0.6894355", "0.6888453", "0.68826973", "0.68826", "0.68764544", "0.68764544", "0.68683815", "0.68587154", "0.6845476", "0.68417525", "0.6840105", "0.6838866", "0.6832507", "0.68318284", "0.68296", "0.6816972", "0.6814222", "0.68107045", "0.67997825", "0.6794666", "0.67826957", "0.67762345", "0.6772606", "0.67706454", "0.6761651", "0.6760955", "0.6756586", "0.67556095", "0.6749928", "0.67479426", "0.67447674", "0.6734841", "0.6728738", "0.67274344", "0.67253584", "0.6725213", "0.67241955", "0.67209136" ]
0.8221119
2
If you don't want confirmation to be sent on create, neither a code to be generated, call skip_confirmation! source://devise//lib/devise/models/confirmable.rb155
def skip_confirmation!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n send_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n end", "def skip_confirmation_notification!; end", "def send_confirmation_instructions; end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def skip_reconfirmation!; end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def skip_reconfirmation_in_callback!; end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirmation_required?\n false\n end", "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def confirmation_required?; end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def send_confirmation_email\n # Do Nothing\n end", "def confirmation_required?\n true\n end", "def send_on_create_confirmation_instructions\n if self.email.match /tu-dresden.de$/\n send_devise_notification(:confirmation_instructions)\n else\n false\n end\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def after_confirmation; end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def pending_any_confirmation; end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def confirmation_required?\n return true\n end", "def confirmation_required?\n super\n end", "def confirmation_required?\n super\n end", "def resend_confirmation_instructions; end", "def confirmation_required?\n !confirmed?\n end", "def after_confirmation\n end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def is_confirmable?\n true\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def confirmation_required?\n !confirmed?\n end", "def confirm!\n welcome_email\n super\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def generate_confirmation_instructions\n self.confirmation_token = SecureRandom.hex(10)\n self.confirmation_sent_at = Time.now.utc\n end", "def confirmation\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def after_confirmation\n activate\n end", "def validates_confirmation_of(*attr_names)\n super\n end", "def send_confirmation_instructions\n generate_confirmation_token! if self.confirmation_token.nil?\n ::Devise.mailer.confirmation_instructions(self).deliver\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def confirmation_attribute; end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def confirmation_instructions(record)\n devise_mail(record, :confirmation_instructions)\n end", "def send_free_confirmation\n send_free_message(\"confirmation\")\n end", "def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end", "def send_confirmation_notification?\n false\n end", "def create\n @user = User.new(params[:user])\n @user.confirmed_at = Time.now\n @user.skip_confirmation!\n [email protected] && (redirect_to new_user_session_path)\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def payment_confirmation_required?\n true\n end", "def generate_confirmation_token\n end", "def generate_confirmation_token; end", "def send_confirmation\n reply 'confirmation'\n end", "def confirmed?; end", "def generate_confirmation_token\n unless self.confirmation_token\n self.confirmation_token = generate_unique_secure_confirmation_token()\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n RolloverMailer.confirmation_instructions(self, @raw_confirmation_token).deliver_now\n end", "def send_confirmation\n send_message(\"confirmation\")\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def send_confirmation_instructions(attributes = T.unsafe(nil)); end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def confirmation_form\n end", "def email_confirm\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def confirmation_required?\n Rails.configuration.confirmation_required\n end", "def confirm!\n self.pending = false\n self.save\n self.createDebts\n end", "def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def send_create_instructions\n\n ActiveSupport::Deprecation.warn \"send_create_instructions\"\n opts = { }\n send_devise_notification(:create, opts)\n end", "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def skip_sms_confirmation!\n self.sms_confirmed_at = Time.now\n end" ]
[ "0.842295", "0.8392203", "0.8392203", "0.81079024", "0.81079024", "0.7880406", "0.78740686", "0.7842516", "0.7757842", "0.7520245", "0.744613", "0.744613", "0.7445574", "0.7445574", "0.73635924", "0.73489285", "0.7139675", "0.7137997", "0.7091031", "0.70840335", "0.7068473", "0.706259", "0.7061081", "0.7061081", "0.7061081", "0.7061081", "0.7061081", "0.7059789", "0.70243025", "0.6987159", "0.6980455", "0.6976655", "0.69563556", "0.6947538", "0.6923714", "0.68879014", "0.68555343", "0.6828019", "0.6828019", "0.6782027", "0.6758922", "0.67442805", "0.67442805", "0.6724294", "0.67104125", "0.6701456", "0.6684136", "0.6671712", "0.66690063", "0.6630059", "0.6621369", "0.65975904", "0.6589226", "0.6571232", "0.65460205", "0.654598", "0.6531459", "0.65309995", "0.6519079", "0.6516334", "0.65041983", "0.65029144", "0.6500294", "0.6481783", "0.64616644", "0.64537203", "0.64527154", "0.64493537", "0.6444103", "0.64430106", "0.64296347", "0.63939077", "0.637987", "0.6369772", "0.636233", "0.63527864", "0.6331989", "0.63282096", "0.63276285", "0.63112307", "0.6306927", "0.63045734", "0.6291356", "0.6279323", "0.6278204", "0.6270925", "0.62700444", "0.6265361", "0.62393403", "0.6224297", "0.62088615", "0.62047887", "0.62047887", "0.61939615", "0.6192798", "0.61862046", "0.61862046", "0.6178685", "0.61659765", "0.6162187" ]
0.8051209
5
Skips sending the confirmation/reconfirmation notification email after_create/after_update. Unlike skip_confirmation!, record still requires confirmation. source://devise//lib/devise/models/confirmable.rb161
def skip_confirmation_notification!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!; end", "def skip_reconfirmation!; end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def skip_reconfirmation_in_callback!; end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_confirmation_email\n # Do Nothing\n end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def skip_sms_confirmation!\n self.sms_confirmed_at = Time.now\n end", "def skip_email_changed_notification!; end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def maybe_deliver_email_confirmation!(controller)\n if email_changed_previously?\n deliver_email_confirmation! controller\n true\n else\n false\n end\n end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def resend_confirmation_instructions\n pending_any_confirmation do\n send_confirmation_instructions\n end\n end", "def resend_confirmation_instructions; end", "def send_confirmation_instructions; end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def after_confirmation; end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def send_confirmation_notification?\n false\n end", "def reset_confirmation\n self.confirmed_at = nil\n end", "def send_on_create_confirmation_instructions\n send_confirmation_instructions\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def confirmation_instructions(record)\n devise_mail(record, :confirmation_instructions)\n end", "def send_confirmation_email\n return false if /\\w@(example)\\.com/.match(self.email)\n UserMailer.confirmation(self).deliver unless confirmed?\n end", "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def after_confirmation\n if unconfirmed_wca_id.present?\n WcaIdClaimMailer.notify_delegate_of_wca_id_claim(self).deliver_later\n end\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n RolloverMailer.confirmation_instructions(self, @raw_confirmation_token).deliver_now\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def send_on_create_confirmation_instructions\n end", "def confirmation_instructions(record, token, opts={})\n update_email = record.confirmed? && record.unconfirmed_email?\n template = update_email ? 'reconfirmation-instructions' : 'confirmation-instructions'\n email = update_email ? record.unconfirmed_email : record.email\n MnoEnterprise::MailClient.deliver(template,\n default_sender,\n recipient(record).merge(email: email),\n user_vars(record).merge(confirmation_link: user_confirmation_url(confirmation_token: token))\n )\n if update_email\n MnoEnterprise::MailClient.deliver('email-change',\n default_sender,\n recipient(record),\n user_vars(record).merge(unconfirmed_email: record.unconfirmed_email)\n )\n end\n end", "def pending_any_confirmation; end", "def send_on_create_confirmation_instructions\n end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def after_confirmation\n end", "def send_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def do_notify_disabled(transition)\n if user && Rails.application.settings.enforce_rules\n UserMailer.access_revoked(user, self).deliver_later\n end\n end", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def nullify_jabber_confirmation\n unconfirm_jabber if saved_change_to_attribute?(:jabber)\n end", "def email_confirm\n end", "def send_free_confirmation\n send_free_message(\"confirmation\")\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def confirmation_required?\n false\n end", "def send_reconfirmation_instructions\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def send_on_create_confirmation_instructions\n if self.email.match /tu-dresden.de$/\n send_devise_notification(:confirmation_instructions)\n else\n false\n end\n end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def confirm!\n welcome_email\n super\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def send_confirmation_email\n\t\tRentersConfirmationJob.perform_later self\n OwnersConfirmationJob.perform_later self\n\tend", "def confirmation_instructions(record, opts={})\n devise_mail(record, :confirmation_instructions)\n end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def send_confirmation_instructions\n generate_confirmation_token! if self.confirmation_token.nil?\n ::Devise.mailer.confirmation_instructions(self).deliver\n end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def triggerConfirmation\n\n user = getUserByAuthToken(request)\n user.resend_confirmation_instructions\n\n if(user.errors.blank?)\n logger.info \"Email confirmation instructions were sent for user #{user.email}\\n\"\n raw_token = user.instance_variable_get(\"@raw_confirmation_token\")\n\n the_response = { :confirmation_sent_at => user.confirmation_sent_at }\n\n enable_test_hooks = Rails.application.config.enable_test_hooks\n if(enable_test_hooks)\n # Assume we're in test environment - add hook in response to enable testing\n logger.info \"Including raw confirmation token in response: #{raw_token}\\n\"\n the_response[:confirmation_token] = raw_token\n end\n\n render :status => 201, :json => the_response\n else\n if(!user.errors.messages[:email].blank?)\n logger.error \"Devise said: \\\"#{user.errors.messages[:email]}\\\". Interpret as no email confirmation pending for #{user.email} (user id: #{user.id}), instructions will not be emailed.\\n\"\n render :status => 412, :json => {:error => \"No email confirmation pending\"}.to_json\n else\n logger.error \"Unexpected error encountered when attempting to send confirmation instructions for #{user.email}. Error: #{user.errors.inspect}.\\n\"\n render :status => 500, :json => {:error => I18n.t(\"500response_internal_server_error\")}.to_json\n end\n end\n end", "def send_email_confirmation\n SiteMailer.delay.confirm_product_registration(self)\n end", "def send_confirmations_to_owner\n return @send_confirmations_to_owner\n end", "def unconfirmed?\n !confirmed?\n end", "def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && [email protected]?\n end", "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n !confirmed?\n end", "def unconfirmed_user_only!\n unless current_user.email_confirmed?\n redirect_to root_path, alert: t('application.unconfirmed_user_only')\n end\n end", "def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end", "def skip_password_change_notification!; end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end" ]
[ "0.81659913", "0.7926748", "0.7926748", "0.7920582", "0.7721695", "0.7699532", "0.75848436", "0.7378999", "0.7279764", "0.7229184", "0.69781554", "0.69781554", "0.6966053", "0.6966053", "0.6945851", "0.6937888", "0.6870924", "0.6812748", "0.67420644", "0.6684555", "0.6684555", "0.6636281", "0.66087806", "0.6558267", "0.65246785", "0.65204763", "0.6504543", "0.65031576", "0.6471547", "0.64607364", "0.6452819", "0.6452819", "0.6441136", "0.64312035", "0.63929963", "0.6388912", "0.6354809", "0.63524806", "0.6294326", "0.6287254", "0.6277604", "0.62697315", "0.6257051", "0.62133145", "0.6202869", "0.6198549", "0.6197877", "0.6190924", "0.6187852", "0.6185746", "0.61820674", "0.61794794", "0.61792564", "0.6175443", "0.61749184", "0.61651015", "0.61526585", "0.6144539", "0.61372304", "0.61238706", "0.6121869", "0.61188555", "0.61050695", "0.6100824", "0.6091888", "0.6090998", "0.6090998", "0.6073178", "0.6072482", "0.6068164", "0.6068164", "0.6068164", "0.6068164", "0.6068164", "0.6066771", "0.6065527", "0.60536367", "0.60469556", "0.6046361", "0.6027474", "0.6023588", "0.60109794", "0.5991614", "0.59779847", "0.5964061", "0.59564686", "0.5945563", "0.59165025", "0.59163415", "0.5898032", "0.5896631", "0.58880043", "0.5887443", "0.58805025", "0.58743453", "0.58648545", "0.5862898", "0.5841199", "0.5836306", "0.58350635" ]
0.82485986
0
If you don't want reconfirmation to be sent, neither a code to be generated, call skip_reconfirmation! source://devise//lib/devise/models/confirmable.rb167
def skip_reconfirmation!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip_reconfirmation_in_callback!; end", "def skip_confirmation!; end", "def send_reconfirmation_instructions\n end", "def skip_confirmation_notification!; end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def resend_confirmation_instructions; end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def send_confirmation_instructions; end", "def resend_confirmation_instructions\n pending_any_confirmation do\n send_confirmation_instructions\n end\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def pending_any_confirmation; end", "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def after_confirmation; end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def reconfirmation_required?\n self.class.reconfirmable && @reconfirmation_required # && !self.email.blank?\n end", "def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end", "def send_confirmation_email\n # Do Nothing\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def resend_confirmation_token\n if accepted_or_not_invited?\n # User was not invited or has already accepted (in the latter case we are probably dealing with a reconfirmation e-mail), simply resend confirmation e-mail:\n super\n else\n # User was invited. Do not (re)send confirmation e-mail, but resend invitation e-mail instead:\n self.invite!\n end\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def confirm!\n welcome_email\n super\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def after_confirmation\n end", "def send_confirmation\n reply 'confirmation'\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def confirmation_required?; end", "def send_free_confirmation\n send_free_message(\"confirmation\")\n end", "def reset_confirmation\n self.confirmed_at = nil\n end", "def confirmation_required?\n false\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def resend_confirmation_email\n WEPAY.call('/user/resend_confirmation', self.wepay_access_token, {\n email_message: 'Thank you for signing up with WeCrowd. In order to process payments, you will need to confirm your email address and set a secure payment password. Click the \"confirm\" button below to begin.'\n })\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def send_confirmation_notification?\n false\n end", "def confirmed?; end", "def confirmation_required?\n !confirmed?\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end", "def email_confirm\n end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def confirmation\n end", "def after_confirmation\n activate\n end", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def confirmation_required?\n true\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n RolloverMailer.confirmation_instructions(self, @raw_confirmation_token).deliver_now\n end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def update_needs_confirmation?(resource, previous)\n resource.respond_to?(:pending_reconfirmation?) &&\n resource.pending_reconfirmation? &&\n previous != resource.unconfirmed_email\n end", "def skip_sms_confirmation!\n self.sms_confirmed_at = Time.now\n end", "def confirmation_required?\n !confirmed?\n end", "def buyer_confirmed\n end", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def confirm_account\n confirm\n end", "def is_confirmable?\n true\n end", "def reconfirmation(request)\n @request = request\n mail to: request.email, subject: \"C'est bientôt ton tour\"\n end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end", "def send_confirmation\n send_message(\"confirmation\")\n end", "def unconfirmed?\n !confirmed?\n end", "def send_code_again\n current_user.send_confirmation_sms\n end", "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "def confirm\n end", "def confirm\n end", "def send_reset_password_instructions \n if self.confirmed?\n super \n else\n errors.add :base, \"You must receive an invitation before you set your password.\" \n end\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm_order\n end", "def confirm!\n return false if purchased?\n confirmed!\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def confirm!\n @@api.post(endpoint: self.endpoint + ['confirm'])\n end", "def confirm( code )\n if (code == self.confirm_code)\n self.confirm_code = nil\n self.state = 'C'\n self.save!\n # check and store new data for recipient\n if self.recipient.new_data\n data = YAML.load( recipient.new_data )\n if data\n recipient.update_attributes( data )\n recipient.new_data = nil\n recipient.confirmed_real = true\n recipient.save\n end\n end\n else\n raise \"Confirmation code not valid for this recipient!\"\n end\n return true\n end", "def send_confirmation_instructions(opts=nil)\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts ||= {}\n\n # fall back to \"default\" config name\n opts[:client_config] ||= \"default\"\n\n if pending_reconfirmation?\n opts[:to] = unconfirmed_email\n end\n\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def payment_confirmation_required?\n true\n end", "def confirmation_instructions(record, token, opts = {})\n opts[:subject] = 'VReel account confirmation instructions'\n super\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end" ]
[ "0.83792806", "0.8159487", "0.81189394", "0.79885703", "0.7969083", "0.7906337", "0.76855886", "0.7624127", "0.748768", "0.7445311", "0.7379494", "0.7379494", "0.72594994", "0.72460395", "0.7194614", "0.7149812", "0.7131394", "0.71279997", "0.6977111", "0.6958081", "0.69548225", "0.6936203", "0.6923743", "0.69194496", "0.6909945", "0.6890047", "0.6890047", "0.68674767", "0.68663436", "0.68663436", "0.6863171", "0.68610954", "0.68477994", "0.6823447", "0.68205106", "0.6800592", "0.67999256", "0.6776179", "0.6728624", "0.67185587", "0.67185587", "0.6687938", "0.6687938", "0.66823214", "0.6677946", "0.6668419", "0.66465497", "0.66274863", "0.6609599", "0.6609599", "0.6609599", "0.6609599", "0.6609599", "0.66083133", "0.6590205", "0.6573206", "0.6554948", "0.6549398", "0.6538838", "0.65356994", "0.65334076", "0.6508783", "0.6507028", "0.6499494", "0.6497862", "0.64870304", "0.64782876", "0.6476408", "0.6473836", "0.64726335", "0.64558846", "0.64558655", "0.6448624", "0.6448385", "0.6447076", "0.64321417", "0.6421405", "0.6418738", "0.6414234", "0.64137954", "0.64002603", "0.6397061", "0.6392315", "0.63916355", "0.63893366", "0.6386384", "0.6386384", "0.6385882", "0.638545", "0.637651", "0.63753074", "0.6372341", "0.636711", "0.63565063", "0.63481", "0.6346777", "0.63450235", "0.6337982", "0.632916", "0.63284165" ]
0.87889063
0
A callback initiated after successfully confirming. This can be used to insert your own logic that is only run after the user successfully confirms. Example: def after_confirmation self.update_attribute(:invite_code, nil) end source://devise//lib/devise/models/confirmable.rb308
def after_confirmation; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_confirmation\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def resend_confirmation_instructions; end", "def on_confirm_failed( &block )\n @on_confirm_failed = block\n end", "def after_confirmation\n if unconfirmed_wca_id.present?\n WcaIdClaimMailer.notify_delegate_of_wca_id_claim(self).deliver_later\n end\n end", "def send_confirmation_instructions; end", "def confirm!\n welcome_email\n super\n end", "def skip_reconfirmation_in_callback!; end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def after_confirmation\n activate\n end", "def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end", "def confirm_event\n @event.update(confirmed: true)\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def confirm_code\n if current_user.phone_confirmation_code == params[:code]\n current_user.has_confirmed_phone = true\n current_user.save\n end\n end", "def confirmed?; end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def after_save(user)\n if user.confirmed_at_changed?\n Invitation.where(friend_id: user.id).each do |invitation|\n invitation.confirm!\n end\n end\n end", "def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def after_confirmation # Send welcome mail after user is successfully registered\n send_user_mail\n end", "def confirm( code )\n if (code == self.confirm_code)\n self.confirm_code = nil\n self.state = 'C'\n self.save!\n # check and store new data for recipient\n if self.recipient.new_data\n data = YAML.load( recipient.new_data )\n if data\n recipient.update_attributes( data )\n recipient.new_data = nil\n recipient.confirmed_real = true\n recipient.save\n end\n end\n else\n raise \"Confirmation code not valid for this recipient!\"\n end\n return true\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def confirm_account\n confirm\n end", "def after_confirmation\n # rubocop:disable Rails/SkipsModelValidations\n update_attribute(:active, true)\n # rubocop:enable Rails/SkipsModelValidations\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def confirm!\n update(confirmed_at: Time.now.utc, status: :confirmed)\n end", "def email_confirm\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def finalize\n @confirmation_token = params[:user].delete(:confirmation_token)\n self.resource = resource_class.find_for_confirmation(@confirmation_token)\n\n # Exit action and redirect if user is already confirmed\n if resource && resource.confirmed?\n yield(:already_confirmed, resource) if block_given?\n redirect_to after_confirmation_path_for(resource_name, resource)\n return\n end\n\n if resource.errors.empty?\n if params[:tos] == \"accept\"\n params[:user][:meta_data] = resource.meta_data.merge(tos_accepted_at: Time.current)\n end\n resource.assign_attributes(params[:user]) unless resource.confirmed?\n resource.perform_confirmation(@confirmation_token)\n resource.save\n sign_in resource, bypass: true\n set_flash_message(:notice, :confirmed) if is_flashing_format?\n yield(:success,resource) if block_given?\n MnoEnterprise::EventLogger.info('user_confirm', resource.id, 'User confirmed', resource)\n respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource, new_user: true) }\n else\n yield(:error,resource) if block_given?\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n end\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def confirm\n end", "def confirm\n end", "def on_confirm_open( &block )\n @on_confirm_open = block\n end", "def pending_any_confirmation; end", "def confirm!\n update!(confirmed_at: DateTime.now)\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def waiting\n code = params[:user] ? params[:user][:promo_code] : nil\n if code and Doers::Config.promo_codes.include?(code)\n current_account.update_attributes(user_params.merge(:confirmed => true))\n notice = _(\"Code worked! Please don't forget to leave your feedback.\")\n redirect_to root_path, :notice => notice\n else\n flash[:alert] =\n _(\"Sorry, but we couldn't validate that promo code.\") if code\n end\n end", "def mark_as_confirmed!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save\n end", "def do_confirm\n if current_user.type == \"User\" || current_attendee.affiliate == current_user\n if registration = current_attendee.event_registrations.for_event(current_object).first\n registration.confirm!\n # log confirmation activity\n log_checkin_activity(\"Confirmed for '#{current_object.display_name}'\")\n \n @attendee_id = current_attendee.id\n @event_id = params[:id]\n end\n end\n\n render :text => \"Confirmed\"\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def call_confirm_handler\n call_handler(:confirm)\n end", "def confirmed_it\n #look up user\n url = request.fullpath\n id = url[9]\n u = User.find(:id => user_id)\n # check code to paramater code\n if u.confirmation_code == confirmation_code then\n u.confirmed = true\n u.save\n #if all clear log them in and go to dashboard\n session[:user] = User.authenticate(u.email, u.password)\n redirect_to :action => \"dashboard\", :controller => 'sessions' \n end\n redirect_to :action => \"signup\", :controller => 'prelogins' \n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end", "def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end", "def confirmation_required?; end", "def confirmation\n end", "def after_confirmation\n welcome_email\n queue_matches\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def send_confirmation_email\n # Do Nothing\n end", "def skip_confirmation_notification!; end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def buyer_confirmed\n end", "def resend_confirmation_instructions\n pending_any_confirmation do\n send_confirmation_instructions\n end\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def send_code_again\n current_user.send_confirmation_sms\n end", "def after_confirmation\n\t\tschool = self.school\n\t\tschool.principles.update_all(status: false)\n\t\tself.update_attribute(:status, true)\n\tend", "def do_confirm_failed( reason_code, description, language )\n @local_id = nil\n @connection = nil\n callback :confirm_failed, self, reason_code, description, language\n end", "def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def send_faculty_confirmation\n\n if approved?\n if self.confirmation_token.nil?\n self.send_confirmation_instructions\n end\n end\n end", "def resend_confirmation_email\n WEPAY.call('/user/resend_confirmation', self.wepay_access_token, {\n email_message: 'Thank you for signing up with WeCrowd. In order to process payments, you will need to confirm your email address and set a secure payment password. Click the \"confirm\" button below to begin.'\n })\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def maybe_deliver_email_confirmation!(controller)\n if email_changed_previously?\n deliver_email_confirmation! controller\n true\n else\n false\n end\n end", "def confirm\r\n # Change user status to active\r\n update(status: :active)\r\n # Update all pending company_roles to active\r\n company_roles.update_all(status: 1)\r\n NotifyMailer.welcome_mail(self).deliver_later\r\n super\r\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def confirm\n\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def confirm_now\n confirm_user(params[:confirmation_code])\n unless request.xhr?\n if @user and @user.confirmed?\n unless logged_in?\n @current_user_session = FrontendUserSession.new\n render({:template => 'frontend/users/confirmed'})\n else\n flash[:info] = c_t(:success_message, {:domain_name => @host_name})\n redirect_to(frontend_user_account_url) \n end\n else\n render({:template => 'frontend/users/confirm_now'})\n end\n else\n render({:template => 'frontend/users/confirm_now.js.rjs'})\n end\n end", "def send_reconfirmation_instructions\n end", "def confirm\n @definition = Definition.where(:code => params[:code]).first\n\n if @definition\n @definition.status = 'confirmed'\n @definition.save!\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!\n # save!(:validate => false)\n # validate for password validation, done on front end\n end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm!\n response.write 'Success'\n response.set_cookie(cookie_name, {:value => supplied_code, :path => \"/\"})\n end", "def skip_confirmation!; end", "def perform_confirmation(confirmation_token)\n self.confirm if self.persisted?\n self.confirmation_token = confirmation_token\n end", "def resend_confirmation_token\n if accepted_or_not_invited?\n # User was not invited or has already accepted (in the latter case we are probably dealing with a reconfirmation e-mail), simply resend confirmation e-mail:\n super\n else\n # User was invited. Do not (re)send confirmation e-mail, but resend invitation e-mail instead:\n self.invite!\n end\n end", "def confirm!\n @@api.post(endpoint: self.endpoint + ['confirm'])\n end", "def after_password_reset\n accept_invitation! if invitation_token.present?\n end", "def sms_confirm_with(code)\n if txter_sms_confirmation_code.to_s.downcase == code.downcase\n # save the phone number into the 'confirmed phone number' attribute\n self.txter_sms_confirmed_phone_number = txter_sms_phone_number\n save\n else\n false\n end\n end", "def confirmation_attribute; end", "def on_reactivation_success\n redirect_to(action: :index) \n end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def confirmed\n render text: 'Confirmation success you can login on Mobile App'\n end", "def skip_reconfirmation!; end", "def final_confirmation\n if session[:all_free_shipping]\n carrier = \"Free Shipping\"\n method = \"Free Shipping\"\n else\n order_id = params[:order][:id]\n carrier = params[:order][:carrier]\n method = params[:order][:shipping_method]\n end\n\n coupon_code = session[:coupon]\n\n @cart = find_cart\n @order = session[:order]\n\n @order.set_freight_ship_to session[:ship_to]\n @order.set_freight_options session\n\n if valid_coupon_code?(coupon_code, @order.totalize_items)\n @order.coupon = coupon_code\n end\n\n @order.carrier = carrier\n @order.taxes = round(@cart.totalize_products * state_tax(@order.billing_state)).to_f\n @order.shipping_method = shipping_method(method)\n @order.shipping_approx = shipping_approx(@order.carrier, method)\n session[:order] = @order\n end", "def do_pending\n make_activation_code\n # send the user an email with an activation code\n UserMailer.deliver_signup_notification(self)\n end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def reset_confirmation\n self.confirmed_at = nil\n end", "def send_on_create_confirmation_instructions\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end" ]
[ "0.70184463", "0.68008286", "0.669751", "0.6517184", "0.64459676", "0.64301", "0.63456684", "0.6324701", "0.6301598", "0.62659293", "0.6252924", "0.6211426", "0.6162149", "0.6158638", "0.6152191", "0.6151686", "0.61042213", "0.60637754", "0.60476106", "0.60315216", "0.6030847", "0.60115826", "0.59948826", "0.59916097", "0.5982112", "0.5982112", "0.5974969", "0.5957844", "0.592015", "0.589848", "0.589848", "0.5890298", "0.58789134", "0.5847422", "0.5847422", "0.5833693", "0.583184", "0.58237517", "0.5820813", "0.5816318", "0.5809982", "0.5806506", "0.5803975", "0.5791889", "0.57915884", "0.5765261", "0.57524174", "0.57256275", "0.5717005", "0.5700193", "0.5688069", "0.56797457", "0.5676082", "0.5676082", "0.56751", "0.5673176", "0.56638277", "0.5641972", "0.5639946", "0.5628846", "0.5622488", "0.5621936", "0.56157136", "0.56098646", "0.5573403", "0.5565844", "0.5559566", "0.5559566", "0.5547445", "0.5542786", "0.55313003", "0.55295056", "0.55263716", "0.5521685", "0.55212605", "0.55202115", "0.55160326", "0.55124295", "0.55100626", "0.5507248", "0.54934186", "0.5492602", "0.5477285", "0.5470239", "0.5469353", "0.54586047", "0.54551363", "0.54411316", "0.5426263", "0.54233134", "0.542112", "0.5421117", "0.54095334", "0.54051256", "0.5404154", "0.54037994", "0.54011685", "0.5398601", "0.5396032", "0.5390733" ]
0.71881324
0
Checks if the user confirmation happens before the token becomes invalid Examples: confirm_within = 3.days and confirmation_sent_at = 2.days.ago confirmation_period_expired? returns false confirm_within = 3.days and confirmation_sent_at = 4.days.ago confirmation_period_expired? returns true confirm_within = nil confirmation_period_expired? will always return false
def confirmation_period_expired?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmation_token_valid?\n (self.confirmation_sent_at + 30.days) > Time.now.utc\n end", "def confirmation_period_expired?\n self.class.activate_within && self.confirmation_sent_at && (Time.now > self.confirmation_sent_at + self.class.activate_within)\n end", "def confirmation_period_valid?\n self.class.allow_inactivated_access_for.nil? || (confirmation_sent_at && confirmation_sent_at.utc >= self.class.allow_inactivated_access_for.ago)\n end", "def confirmation_period_valid?; end", "def confirmation_sms_period_valid?\n confirmation_sms_sent_at && confirmation_sms_sent_at.utc >= self.class.sms_confirm_within.ago\n end", "def better_to_confirm\n ! (self.confirmed && (((Time.zone.now - self.confirmed).to_i / 86400) < 365))\n end", "def confirmed_for_authentication?\n !confirmation_required? || confirmed? || confirmation_period_valid?\n end", "def require_token\n valid = params[:token].present? && current_user.confirmation_token.present?\n valid = valid && ActiveSupport::SecurityUtils.secure_compare(params[:token], current_user.confirmation_token)\n valid = valid && !current_user.confirmation_token_expired?\n deny_user(\"Invalid token\", root_path) unless valid\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end", "def reset_password_period_valid?\n reset_password_within = 3.days\n reset_password_sent_at && reset_password_sent_at.utc >= reset_password_within.ago\n end", "def confirmable?(token=false)\n persisted_token = auth_meta_data.confirmation_token\n\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n return false unless auth_meta_data.confirmation_sent_at > 2.weeks.ago\n\n return compare_token(token) if token\n true\n end", "def verification_token_valid?\n (self.verification_sent_at + 4.hours) > Time.now.utc\n end", "def validate_token\n if self.transaction_token_created_at + 720.minutes > Time.now\n true\n else\n false\n end\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def activation_token_expired?\n activation_sent_at < 7.days.ago\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def confirm_by_token(confirmation_token); end", "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n !confirmed?\n end", "def two_factor_confirmed_at_valid_for\n 12.hours\n end", "def token_valid?(client_nonce, token)\n gen_time, _dontcare = encryptor(client_nonce).decode(token)\n\n time_diff = Time.now - Time.at(time_to_block(gen_time))\n time_diff < valid_interval && time_diff > 0\n rescue ArgumentError\n false\n end", "def reset_password_period_valid?\n reset_password_sent_at && Time.at(reset_password_sent_at).to_datetime.utc >= self.class.reset_password_within.ago\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def ensure_eligible_for_confirmation\n unless @offering.confirmations_allowed?\n flash[:error] = \"We're sorry, but the confirmation process is currently disabled.\"\n redirect_to apply_url(@offering) and return\n end\n unless @user_application.passed_status?(\"fully_accepted\") || @user_application.passed_status?(\"fully_accepted_vad\")\n flash[:error] = \"You cannot go through the confirmation process until your application has been fully accepted.\"\n redirect_to apply_url(@offering) and return\n end\n end", "def active?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def confirmable?(token=false)\n persisted_token = confirmation_token\n\n # TODO: add expiry etc.\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n\n return compare_token(token) unless token==false\n true\n end", "def confirmed?\n confirmation == 'yes'\n end", "def verify\n update(confirmed_at: Time.current)\n end", "def payment_confirmation_required?\n true\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def password_token_valid?\n (self.reset_password_sent_at + 4.hours) > Time.now.utc\n end", "def reset_password_period_valid?\n reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago.utc\n end", "def suspended?\n next_payment_at \\\n && (next_payment_at + UserSystem.account_grace_period).to_date < Date.today\n end", "def confirmation_required?\n true\n end", "def confirmed?\n confirmation == 'Confirmed'\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirmation_required?\n return true\n end", "def confirmable?(token=false)\n persisted_token = auth_meta_data.confirmation_token\n\n # TODO: add expiry etc.\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n\n return compare_token(token) unless token==false\n true\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def confirmation_required?; end", "def expired?\n Time.now > valid_until\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def confirm(token = nil)\n if ActiveSupport::SecurityUtils.secure_compare(token, confirmation_token)\n self.confirmation_token = nil\n self.password = SecureRandom.hex(8) unless password_digest.present?\n self.confirmed_at = Time.now.utc\n end\n end", "def password_reset_token_expired?\n sent_reset_at < 1.hour.ago\n end", "def confirmation_required?\n yaml['confirmation_required']\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def validate_token_no_tmp_datetime(token)\n valid_vals = []\n valid_vals << ROTP::TOTP.new(self.get_qr).at(Time.now)\n (1..self.class.ga_timedrift).each do |cc|\n valid_vals << ROTP::TOTP.new(self.get_qr).at(Time.now.ago(30*cc))\n valid_vals << ROTP::TOTP.new(self.get_qr).at(Time.now.in(30*cc))\n end\n\n if valid_vals.include?(token.to_i)\n return true\n else\n return false\n end\n end", "def is_token_expired?\n (Time.now - self.updated_at) > 3300\n end", "def password_token_valid?\n (updated_at + 4.hours) > Time.now.utc\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def confirmation_required?\n false\n end", "def require_confirmation\n if account_signed_in? and !current_account.confirmed?\n redirect_to waiting_pages_path\n end\n end", "def token_verification\n user = User.with_reset_password_token(params[:user][:reset_password_token])\n if user && user.email == params[:user][:email] && user.reset_password_period_valid?\n render_success_response({},\"Token is valid\")\n else\n json_response({\n success: false,\n message: \"Invalid Token\"\n }, 400)\n end\n end", "def confirmed?\n flash[:alert] = 'Check your email to confirm yourself.(You are not allowed to create posts)' unless current_user&.email_confirmed?\n end", "def token_expired?\r\n begin\r\n conditions_element = REXML::XPath.first(document,\"/p:Response/a:Assertion/a:Conditions\", { \"p\" => PROTOCOL, \"a\" => ASSERTION })\r\n raise SA1012Exception if conditions_element.nil?\r\n raise SA1003Exception if conditions_element.attribute('NotBefore') and Time.now.utc < Time.parse(conditions_element.attribute('NotBefore').value)\r\n raise SA1004Exception if conditions_element.attribute('NotOnOrAfter') and Time.now.utc >= Time.parse(conditions_element.attribute('NotOnOrAfter').value)\r\n rescue RuntimeError => exp\r\n Rails.logger.error \"#{exp.class} - #{exp.message}\"\r\n return true\r\n else\r\n return false\r\n end\r\n end", "def password_reset_expired?\n # < \"earlier than\"\n reset_sent_at < 2.hours.ago\n end", "def expired?\n !converted_to_recipient? && months_remaining == 0\n end", "def book_request_decline_confirm\n booking_staff = BookingStaff.find_by_confirm_token(params[:id])\n\n if booking_staff\n staff_id = booking_staff.id\n declined_status = STATUS_DECLINED\n\n if self.book_request_response(staff_id, declined_status)\n booking_staff.send_email_booking_declined\n booking_staff.update(:confirm_token => nil)\n render 'request_decline_confirm'\n return\n end\n end\n\n # NOTE - IF FOR WHATEVER REASON GETTING THE BookingStaff MODEL FAILS\n # WE SHOULD TELL THE USER TO TRY AGAIN ?\n end", "def generate_confirmation_token\n if self.confirmation_token && !confirmation_period_expired?\n @raw_confirmation_token = self.confirmation_token\n else\n raw, _ = Devise.token_generator.generate(self.class, :confirmation_token)\n self.confirmation_token = @raw_confirmation_token = raw\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def before_period?\n if Time.now >= self.orderDate \n errors.add(:orderDate, \"Can't be in the past\")\n end\n end", "def unconfirmed?\n !confirmed?\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def token_expired?\n return true\n expires_at < Time.now if expires_at?\n end", "def token_valid?\n @session_token and @toodle_token_death > Time.now\n end", "def check_validity\n if @expires_at == nil\n raise OAuthSessionError, \"Expiration not properly initialized.\"\n end\n if @expires_at < Time.new\n if not do_refresh\n raise OAuthSessionError, \"Token could not be refreshed.\"\n end\n end\n return true\n end", "def validate_confirm_email\n service = AccountDetails::UpdateEmail.call(\n password: params.dig(:passwords, :password),\n password_confirmation: params.dig(:passwords, :password_confirmation),\n token: params[:token]\n )\n if service.valid?\n sign_in_and_redirect(service)\n else\n render_confirm_email(service.errors)\n end\n end", "def booking_request_expired?\n created_at < 48.hours.ago\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def token_expired?\n self.expires < Time.zone.now.to_i\n end", "def reset_password_period_valid?; end", "def confirm\n @doctor = Doctor.find_by_confirmation_token(params[:confirmation_token])\n \n if @doctor.present?\n @doctor.update_attributes(confirmed_at: DateTime.now)\n render json: {message: \"Your account has been confirmed at #{@doctor.confirmed_at}.You can Sign in Now!\"}\n else \n render json: {alert: \"Confirmation Link has Expired.\"}\n end\n\n end", "def password_reset_expired?\n reset_sent_at < 15.days.ago\n end", "def expired?\n not valid?\n end", "def valid_token?\n five_minutes_ago = DateTime.now - 5.minutes\n params[:timestamp].to_i > five_minutes_ago.to_i &&\n params[:token] == Scalingo::SsoController.generate_authentication_token(params[:id], params[:timestamp])\n end", "def confirmed\n confirmed_date.present?\n end", "def check_if_needs_approval\r\n self.suspended_at = Time.now if Setting.user_signup == :needs_approval && !self.admin\r\n end", "def require_token\n today = Time.now\n today_string = today.to_date.to_s\n yesterday_string = today.yesterday.to_date.to_s\n return false unless [today_string, yesterday_string].include?(params[:salt])\n params[:token] == token_with_salt(params[:salt])\n end", "def password_reset_expired?\n reset_sent_at < 2.weeks.ago\n end", "def must_be_completely_verified\n unless current_user.sms_code.to_i == current_user.confirm_code.to_i\n redirect_to root_path, notice: \"You need to be verified!\"\n end\n end", "def validate!(strict = true)\n bounds = time_bounds\n raise Mobius::Client::Error::TokenExpired unless time_now_covers?(bounds)\n raise Mobius::Client::Error::TokenTooOld if strict && too_old?(bounds)\n true\n end", "def confirm!\n update_attribute('portal_last_confirm_date__c', Time.now)\n settings.update_attribute('token',generate_token)\n end", "def canceled?\n #if canceled_on && approved_on && canceled_on.to_time > approved_on.to_time\n if canceled_on != nil\n return true\n else\n return false\n end\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago rescue true\n end", "def account_confirmed?\n confirmed?\n end", "def cofirm!\n confirmation_token=params[:header][:confirmation_token]\n @current_user=User.confirm confirmation_token if confirmation_token\n end", "def token_expired?\n @token.nil? || Time.now >= @token_expires_on + expiration_threshold\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def confirm!\n update!(confirmed_at: DateTime.now)\n end" ]
[ "0.76182497", "0.75351524", "0.75350523", "0.7481272", "0.72654027", "0.7165115", "0.6816782", "0.66417545", "0.66375834", "0.66285944", "0.65572894", "0.6485789", "0.6425022", "0.6389488", "0.6373782", "0.62857157", "0.6263163", "0.6240804", "0.6231065", "0.62182945", "0.6197414", "0.6133961", "0.61331415", "0.6131407", "0.6098535", "0.60703874", "0.6037594", "0.60194874", "0.5991648", "0.5977893", "0.5971882", "0.5971882", "0.59698343", "0.5966213", "0.5933145", "0.59156156", "0.5912922", "0.5911504", "0.5905831", "0.590364", "0.5891929", "0.58743274", "0.5871148", "0.5840898", "0.5822892", "0.5822892", "0.5822892", "0.5822892", "0.5822892", "0.582251", "0.58219093", "0.581812", "0.5816519", "0.58163416", "0.5813411", "0.5802333", "0.5800215", "0.5798949", "0.5791901", "0.57837343", "0.57795525", "0.5773921", "0.57678306", "0.57501227", "0.5739117", "0.5715929", "0.5711975", "0.5700003", "0.56919515", "0.5684994", "0.5684507", "0.56784713", "0.56782573", "0.5662188", "0.56571436", "0.5655799", "0.5646875", "0.56422186", "0.564131", "0.5621019", "0.5617275", "0.56136984", "0.561172", "0.56076425", "0.5599026", "0.55924606", "0.55922395", "0.5589337", "0.5581826", "0.5578582", "0.5578454", "0.55781466", "0.55695415", "0.55695415", "0.55624586", "0.5558373", "0.55534154", "0.5539629", "0.55375034", "0.55372375" ]
0.76926863
0
Checks if the confirmation for the user is within the limit time. We do this by calculating if the difference between today and the confirmation sent date does not exceed the confirm in time configured. allow_unconfirmed_access_for is a model configuration, must always be an integer value. Example: allow_unconfirmed_access_for = 1.day and confirmation_sent_at = today confirmation_period_valid? returns true allow_unconfirmed_access_for = 5.days and confirmation_sent_at = 4.days.ago confirmation_period_valid? returns true allow_unconfirmed_access_for = 5.days and confirmation_sent_at = 5.days.ago confirmation_period_valid? returns false allow_unconfirmed_access_for = 0.days confirmation_period_valid? will always return false allow_unconfirmed_access_for = nil confirmation_period_valid? will always return true
def confirmation_period_valid?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmation_period_valid?\n self.class.allow_inactivated_access_for.nil? || (confirmation_sent_at && confirmation_sent_at.utc >= self.class.allow_inactivated_access_for.ago)\n end", "def confirmation_sms_period_valid?\n confirmation_sms_sent_at && confirmation_sms_sent_at.utc >= self.class.sms_confirm_within.ago\n end", "def better_to_confirm\n ! (self.confirmed && (((Time.zone.now - self.confirmed).to_i / 86400) < 365))\n end", "def confirmation_period_expired?\n self.class.activate_within && self.confirmation_sent_at && (Time.now > self.confirmation_sent_at + self.class.activate_within)\n end", "def confirmation_token_valid?\n (self.confirmation_sent_at + 30.days) > Time.now.utc\n end", "def confirmation_period_expired?; end", "def eligible?(order)\n eligible = true\n eligible &&= Time.now >= start_at if start_at\n eligible &&= Time.now <= end_at if end_at\n eligible &&= user = order.user\n eligible &&= self.users.include?(user)\n if self.usage_limit\n eligible &&= self.usage_limit > PromotionCredit.count_used(user.id, self.id)\n end\n eligible &&= in_zone?(order)\n return(eligible)\n end", "def payment_cadence_allowed?\n begin\n config_payment_cadence = SystemConfiguration::Variable.get_value('booking.payment_cadence').to_i\n _date_from_str = \"#{self.date_from.strftime('%Y-%m-%d')}T#{self.time_from}:00#{self.date_from.strftime(\"%:z\")}\"\n _date_from = DateTime.strptime(_date_from_str,'%Y-%m-%dT%H:%M:%S%:z')\n diff_in_hours = ((_date_from.to_time - self.creation_date.to_time).to_f * 24).to_i\n allowed = diff_in_hours > 0 && (diff_in_hours >= config_payment_cadence)\n allowed || force_allow_payment\n rescue => error\n p \"Error #{id} #{date_from} #{time_from} #{date_to} #{time_to} #{driver_date_of_birth} #{driver_driving_license_date}\"\n return false\n end\n end", "def reset_password_period_valid?\n reset_password_sent_at && Time.at(reset_password_sent_at).to_datetime.utc >= self.class.reset_password_within.ago\n end", "def two_factor_confirmed_at_valid_for\n 12.hours\n end", "def ensure_eligible_for_confirmation\n unless @offering.confirmations_allowed?\n flash[:error] = \"We're sorry, but the confirmation process is currently disabled.\"\n redirect_to apply_url(@offering) and return\n end\n unless @user_application.passed_status?(\"fully_accepted\") || @user_application.passed_status?(\"fully_accepted_vad\")\n flash[:error] = \"You cannot go through the confirmation process until your application has been fully accepted.\"\n redirect_to apply_url(@offering) and return\n end\n end", "def reset_password_period_valid?\n reset_password_within = 3.days\n reset_password_sent_at && reset_password_sent_at.utc >= reset_password_within.ago\n end", "def reset_password_period_valid?\n reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago.utc\n end", "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end", "def pending?(allow_unconfirmed: false)\n params = {\n include_only_confirmed: !allow_unconfirmed,\n _access: :exists\n }\n\n rpc(:pending_exists, :hash, params) == 1\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def allowed_to_pay_member_fee?\n return false if admin?\n\n if current_member? || in_grace_period?\n allowed_to_pay_renewal_member_fee?\n else\n allowed_to_pay_new_membership_fee?\n end\n end", "def confirmed_for_authentication?\n !confirmation_required? || confirmed? || confirmation_period_valid?\n end", "def can_show_invite_friends?\n (Date.today - (invited_friends_at || created_at).to_date).to_i >= 30\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def waits_too_long?(account)\n is?(:asked) and self.asked <= 4.days.ago.to_date\n end", "def ensure_user_plan_limit_not_reached\n if @current_user.is_employee? || @person.is_employee?\n return\n end\n\n userplanservice = UserPlanService::Api.new\n @current_user_max_trusted_users = userplanservice.get_plan_feature_level(@current_user, :company_trusted_users)[:value]\n @other_company_max_trusted_users = userplanservice.get_plan_feature_level(@person, :company_trusted_users)[:value]\n current_user_followed_count = @current_user.followed_people.count\n other_company_followers_count = @person.followers.count\n\n # current user has reached followed limit\n if current_user_followed_count >= @current_user_max_trusted_users\n #@max_followed_reached = true\n flash[:error] = t('people.show.followed_limit_reached2', :link => get_wp_url('pricing')).html_safe\n respond_to do |format|\n format.html { redirect_to :back }\n format.js { render :partial => \"people/max_followers_reached\" }\n end\n return\n end\n\n # other company has reached followers limit\n if other_company_followers_count >= @other_company_max_trusted_users\n #@max_follower_reached = true\n flash[:error] = t('people.show.followers_limit_reached').html_safe\n respond_to do |format|\n format.html { redirect_to :back }\n format.js { render :partial => \"people/max_followers_reached\" }\n end\n end\n return\n end", "def check_if_needs_approval\r\n self.suspended_at = Time.now if Setting.user_signup == :needs_approval && !self.admin\r\n end", "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "def time_allow(get_time, min_period_time, max_period_time)\n to_time = Time.parse(get_time)\n now_time = Time.now\n return to_time - now_time < max_period_time - min_period_time && to_time - now_time > min_period_time\n end", "def suspended?\n next_payment_at \\\n && (next_payment_at + UserSystem.account_grace_period).to_date < Date.today\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def check_total_charges_limit\n check_charges_limit([validate_total_limit])\n end", "def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end", "def date_restricted?\n\n now = Date.today\n\n !((valid_from.nil? or now >= valid_from) and (valid_until.nil? or now <= valid_until))\n\n end", "def membership_expired_in_grace_period?(this_date = Date.current)\n memberships_manager.membership_in_grace_period?(self, this_date)\n end", "def verification_token_valid?\n (self.verification_sent_at + 4.hours) > Time.now.utc\n end", "def revokable?\n\t\tstatus == \"pending\" && created_at >= Donation.revoke_time.ago\n\tend", "def confirmable?(token=false)\n persisted_token = auth_meta_data.confirmation_token\n\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n return false unless auth_meta_data.confirmation_sent_at > 2.weeks.ago\n\n return compare_token(token) if token\n true\n end", "def active?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def validate_token\n if self.transaction_token_created_at + 720.minutes > Time.now\n true\n else\n false\n end\n end", "def two_factor_confirmed?\n #current_user.two_factor_confirmed_at && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n current_user.two_factor_confirmed_at_valid? && session[:two_factor_confirmed_at] == current_user.two_factor_confirmed_at\n end", "def can_be_canceled?\n return true if actionable_date.nil?\n\n cancel_by = actionable_date - SolidusSubscriptions.configuration.minimum_cancellation_notice\n cancel_by.future? || cancel_by.today?\n end", "def is_banned\n \tif (nil == banned_until) then\n \t false\n elsif (Time.now <= banned_until) then\n true\n else\n false\n end\n end", "def valid_coupon?\n (coupon.unique == false || available?) && (coupon.expired_at == nil || coupon.expired_at > Time.now)\n end", "def still_valid?\n return false if self.reply_type == 'conversation'\n participation_request = ParticipationRequest.find self.participation_request_id\n\n return false if participation_request.state != 'pending'\n return false if participation_request.date < Time.current\n\n !used\n end", "def check_schedule_unconfirmed\n\t\t# Picked a random 'check' user service and temporary set it's status to scheduled_unconfirmed\n\t\tuser_service \t\t= UserService.find_by(relationship_type: 'check')\n\t\tuser_service.date \t= Time.now\n\t\tuser_service.status = 'schedule_unconfirm'\n\t\tUserServicesMailer.check_updated(user_service)\n\tend", "def verify\n update(confirmed_at: Time.current)\n end", "def can_pay_deposit?\n\n conf_payment_enabled = SystemConfiguration::Variable.get_value('booking.payment', 'false').to_bool\n conf_payment_deposit = (['deposit','deposit_and_total'].include?(SystemConfiguration::Variable.get_value('booking.payment_amount_setup', 'deposit')))\n\n if self.status == :pending_confirmation\n (conf_payment_enabled or force_allow_payment) and conf_payment_deposit and self.total_paid == 0 and ((!expired? and payment_cadence_allowed?) or force_allow_payment)\n elsif self.status == :confirmed # Confirmed in the back-office without payment\n (conf_payment_enabled or force_allow_payment) and conf_payment_deposit and self.total_paid == 0 and self.total_pending > 0\n else\n return false\n end\n\n end", "def is_grace_period?\n self.weekly_tasks.where(:is_weekly_payment_approved_by_cashier => true ).count == self.total_weeks \n end", "def active\n (ends_at.nil? || on_grace_period) &&\n stripe_status != 'incomplete' &&\n stripe_status != 'incomplete_expired' &&\n stripe_status != 'unpaid' &&\n (!Reji.deactivate_past_due || stripe_status != 'past_due')\n end", "def authorize_time_check(user)\n\n if (user.access_token_expiry < Time.now)\n refresh_authorisation(user)\n end\n end", "def resendable?\n (self.sent_at + 15.minutes) < Time.current\n end", "def has_trialed?\n current_user.subscriptions.any? {|s| !s.canceled_at.nil? && s.canceled_at > s.created_at + 13.days }\n end", "def overlimit_protection\n reqs = customer.current_contract_clearinghouse_requests\n message = \"has passed the allowed limit for clearinghouse submissions for current contract\"\n errors.add(:customer_id, message) if reqs.size >= customer.clearinghouse_number_of_submissions_allowed\n end", "def is_valid?\n # Expiration date is nil, or equal to or greater than today?\n (self.expiration.nil? || self.expiration >= Date.current) &&\n # Limit is set to 0 (for unlimited) or limit is greater than the current used count.\n (self.limit == 0 || self.limit > self.used)\n\tend", "def allowed_to_pay_renewal_member_fee?\n return false if admin?\n\n (current_member? || in_grace_period?) &&\n RequirementsForRenewal.requirements_excluding_payments_met?(self)\n end", "def confirmed_at\n Time.now.utc\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def time_to_accept\n if Time.now > accept_deadline\n 0\n else\n accept_deadline - Time.now\n end\n end", "def check_schedule_confirmed\n\t\t# Picked a random 'check' user service and temporary set it's status to schedule_confirmed\n\t\tuser_service \t\t= UserService.find_by(relationship_type: 'check')\n\t\tuser_service.date \t= Time.now\n\t\tuser_service.status = 'schedule_confirmed'\n\t\tUserServicesMailer.check_updated(user_service)\n\tend", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def only_if_unconfirmed\n pending_any_confirmation {yield}\n end", "def allow_easy_notifiaction?\n this_and_closer_members_count <= self.user.max_easy_notification_count\n end", "def eligible?(order, _options = {})\n return false unless order.user\n\n last_order = last_completed_order(order.user)\n return false unless last_order\n\n last_order.completed_at < preferred_days_ago.days.ago\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def period_range_valid?\n return if self[:period]&.between?(provider_account.created_at.to_date.beginning_of_month, Time.zone.now + 12.months)\n\n errors.add(:period, :invalid_range)\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def membership_past_grace_period_end?(this_date = Date.current)\n memberships_manager.date_after_grace_period_end?(self, this_date)\n end", "def charge_is_allowed?\n\t\tif not customer_has_authorized_payment?\n\t\t\terrors.add :base, I18n.t('views.customer_file.new_charge.you_are_not_authorized')\n\t\t\tfalse\n\t\telsif valid? and charge_amount.present? and authorized_amount and charge_amount.to_i <= authorized_amount\n\t\t\ttrue\n\t\telse\n\t\t\terrors.add :charge_amount, I18n.t('views.customer_file.new_charge.invalid', amount: charge_amount_usd) if errors.empty?\n\t\t\tfalse\n\t\tend\n\tend", "def only_if_unconfirmed\n pending_any_confirmation { yield }\n end", "def only_if_unconfirmed\n pending_any_confirmation { yield }\n end", "def only_if_unconfirmed\n pending_any_confirmation { yield }\n end", "def only_if_unconfirmed\n pending_any_confirmation { yield }\n end", "def only_if_unconfirmed\n pending_any_confirmation { yield }\n end", "def account_confirmed?\n confirmed?\n end", "def commenting_allowed?\n return false if owner.commenting_banned == true\n return true if owner.commenting_allowed\n\n if owner.supporter?\n set commenting_allowed: true\n save_changes validate: false\n return true\n else\n return false if owner.commenting_too_much?\n end\n\n if (account_sites_events_dataset.exclude(site_change_id: nil).count >= COMMENTING_ALLOWED_UPDATED_COUNT || (created_at < Date.new(2014, 12, 25).to_time && changed_count >= COMMENTING_ALLOWED_UPDATED_COUNT )) &&\n created_at < Time.now - 604800\n owner.set commenting_allowed: true\n owner.save_changes validate: false\n return true\n end\n\n false\n end", "def withdraw_using_check(amount)\n @minimum_balance = -10\n if (@balance - amount - @withdraw_fee) >= @minimum_balance\n @checks_used += 1\n\n # user is allowed 3 free checks in a month; any subsequent use adds $2 fee\n if @checks_used < 4\n @withdraw_fee = 0\n else\n @withdraw_fee = 1\n end\n\n withdraw(amount)\n @minimum_balance = 0 #reset the minimum_balance\n else\n puts \"Sorry, that's beyond the overdraft allowance.\"\n @minimum_balance = 0\n end\n show_current_balance\n end", "def over_limit?\n self.plan.limit.to_i > 0 && self.sms_usage >= self.plan.limit\n end", "def account_active?\n blocked_at.nil?\n end", "def can_be_unconfirmed? \n # the reverse adjustment will always increase ready item \n \n return true \n end", "def eligible?(order)\n eligible = true\n eligible &&= Time.now >= start_at if start_at\n eligible &&= Time.now <= end_at if end_at\n eligible &&= in_zone?(order)\n\n return(eligible)\n end", "def can_be_unconfirmed?\n \n if self.purchase_receival_entries.count != 0\n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada penerimaan barang\")\n return false \n end\n \n if self.purchase_return_entries.count != 0 \n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada pengembalian barang\")\n return false\n end\n\n \n \n reverse_adjustment_quantity = -1*quantity \n \n final_item_quantity = item.pending_receival + reverse_adjustment_quantity\n final_warehouse_item_quantity = warehouse_item.pending_receival + reverse_adjustment_quantity\n \n if final_item_quantity < 0 or final_warehouse_item_quantity < 0 \n msg = \"Tidak bisa unconfirm karena akan menyebabkan jumlah #{item.name} pending receival menjadi #{final_item_quantity} \" + \n \" dan jumlah item gudang menjadi :#{final_warehouse_item_quantity}\"\n self.errors.add(:generic_errors, msg )\n return false \n end\n \n return true \n end", "def pre_bill_can_be_confirmed?(pre_bill)\n pre_bill_reading_not_billed?(pre_bill) && bills_with_this_attributes(pre_bill).count <= 0\n end", "def minimum_time_passed_since_last_warning_email?\n return true if user.last_notif_email_sent.nil?\n hours_since_last_email >= MIN_HOURS_BETWEEN_EMAILS\n end", "def dean_approved?\n !approved_at.blank?\n end", "def token_valid?(client_nonce, token)\n gen_time, _dontcare = encryptor(client_nonce).decode(token)\n\n time_diff = Time.now - Time.at(time_to_block(gen_time))\n time_diff < valid_interval && time_diff > 0\n rescue ArgumentError\n false\n end" ]
[ "0.754835", "0.6807691", "0.64428186", "0.64119107", "0.6386525", "0.588011", "0.5855288", "0.5794542", "0.5780219", "0.5749314", "0.56916416", "0.5683438", "0.56746185", "0.5658556", "0.5633641", "0.56192154", "0.56192154", "0.5602257", "0.55334425", "0.55286765", "0.5518392", "0.5515992", "0.5487283", "0.5467588", "0.54398227", "0.5428882", "0.5428882", "0.53871554", "0.5380879", "0.5379007", "0.5366889", "0.53653175", "0.5341349", "0.5338164", "0.532636", "0.532547", "0.5317008", "0.5313156", "0.5299422", "0.5294485", "0.5284261", "0.5283361", "0.5235574", "0.52353036", "0.52174044", "0.52098256", "0.51977086", "0.5195738", "0.5192518", "0.5191687", "0.5183027", "0.5160987", "0.5159984", "0.5144331", "0.513667", "0.51322544", "0.5131867", "0.51279145", "0.5124506", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.51186043", "0.5117892", "0.5104949", "0.50966716", "0.5092829", "0.5087831", "0.5082626", "0.5064395", "0.50537014", "0.50537014", "0.50537014", "0.50537014", "0.50537014", "0.5045199", "0.50445175", "0.5039058", "0.50348157", "0.5034328", "0.50338537", "0.50232047", "0.50150156", "0.50041944", "0.49996224", "0.49987066", "0.49968097" ]
0.58280516
7
Callback to overwrite if confirmation is required or not.
def confirmation_required?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmation_required?\n super\n end", "def confirmation_required?\n super\n end", "def skip_confirmation!; end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def skip_reconfirmation_in_callback!; end", "def confirmation_required?\n true\n end", "def confirmation_required?\n return true\n end", "def skip_reconfirmation!; end", "def skip_confirmation_notification!; end", "def confirm\n options.fetch(:confirm, nil)\n end", "def after_confirmation; end", "def confirmation\n end", "def after_confirmation\n end", "def confirmed?; end", "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n !confirmed?\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirm\n end", "def confirm\n end", "def proceed_to_confirm(params = {})\n self.status = 'confirming'\n if self.update(params)\n true\n else\n false\n end\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def resend_confirmation_instructions; end", "def confirm!\n welcome_email\n super\n end", "def send_confirmation_instructions; end", "def confirm\n\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def confirm!\n welcome_message\n super\n end", "def confirm!\n welcome_message\n super\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def pending_any_confirmation; end", "def confirm_placement\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def confirm!\n # add if else here in case user already existed and is updating/changing data (email etc),\n # shouldn't add_profile again if profile already exists. can determine with a user db 'nil' value...\n unless self.profile\n add_profile\n end\n super\n end", "def confirm!\n return false if purchased?\n confirmed!\n end", "def validates_confirmation_of(*attr_names)\n super\n end", "def is_confirmable?\n true\n end", "def confirm!\n @@api.post(endpoint: self.endpoint + ['confirm'])\n end", "def confirm_order\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def confirmation_required?\n Rails.configuration.confirmation_required\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def send_confirmation_notification?\n false\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirmation_required?\n yaml['confirmation_required']\n end", "def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def after_confirmation\n activate\n end", "def confirmed?\n confirmation == 'yes'\n end", "def send_confirmation_email\n # Do Nothing\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def confirm # shortcut to add 'confirm:true' flag\n params[:flag_name] = 'confirm:true'\n flag\n end", "def payment_confirmation_required?\n true\n end", "def confirmation_form\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def resend_confirmation_instructions\n pending_any_confirmation do\n send_confirmation_instructions\n end\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def app_admin_confirm\n end", "def confirm_for_fulfillment\n\n\t\t\tresult = PrintfulAPI.request( :POST, \"/orders/#{self.id}/confirm\", {} )\n\n\t\t\tself.load_data( result )\n\n\t\t\treturn true\n\n\t\tend", "def require_confirmation!(msg=\"\", &block)\n answer = ask(\"#{msg} [yn]\") do |q|\n q.echo = false\n q.character = true\n q.validate = /\\A[yn]\\Z/\n end\n exit(0) if answer.index('n')\n end", "def needs_confirmation\n attributes.fetch(:needsConfirmation)\n end", "def toggle_confirmation\n if user_params[:to_confirm] == 'true'\n @user.confirm\n elsif user_params[:to_confirm] == 'false'\n @user.confirmed_at = nil\n @user.save\n end\n head :ok\n end", "def reconfirmation_required?\n self.class.reconfirmable && @reconfirmation_required # && !self.email.blank?\n end", "def email_confirm\n end", "def send_confirmation\n reply 'confirmation'\n end", "def password_required?\n super if confirmed?\nend", "def confirmed?\n confirmation == 'Confirmed'\n end", "def send_confirmations_to_owner\n return @send_confirmations_to_owner\n end", "def confirm_account\n confirm\n end", "def confirm!\n no_stock_of = self.order_items.select(&:validate_stock_levels)\n unless no_stock_of.empty?\n raise Shoppe::Errors::InsufficientStockToFulfil, :order => self, :out_of_stock_items => no_stock_of\n end\n \n run_callbacks :confirmation do\n # If we have successfully charged the card (i.e. no exception) we can go ahead and mark this\n # order as 'received' which means it can be accepted by staff.\n self.status = 'received'\n self.received_at = Time.now\n self.save!\n\n self.order_items.each(&:confirm!)\n\n # Send an email to the customer\n deliver_received_order_email\n end\n \n # We're all good.\n true\n end", "def confirmation_attribute; end", "def send_on_create_confirmation_instructions\n end", "def with_confirmation(&block)\n ApplicationRecord.transaction do\n CurrentUser.scoped(User.system, \"127.0.0.1\") do\n yield\n\n print \"Commit? (yes/no): \"\n raise \"abort\" unless STDIN.readline.chomp == \"yes\"\n end\n end\nend", "def send_on_create_confirmation_instructions\n end", "def confirm(prompt, default=false)\n raise RuntimeError, Trepan::NotImplementedMessage\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def update_needs_confirmation?(resource, previous)\n resource.respond_to?(:pending_reconfirmation?) &&\n resource.pending_reconfirmation? &&\n previous != resource.unconfirmed_email\n end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def require_confirmation\n if account_signed_in? and !current_account.confirmed?\n redirect_to waiting_pages_path\n end\n end", "def confirm_if_required(confirm, contents)\n string = ''\n if(confirm)\n string << \"if(confirm(#{format_type_to_js(confirm)})){\"\n string << contents\n string << \"}\"\n else\n string << contents\n end\n string\n end", "def active?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def send_free_confirmation\n send_free_message(\"confirmation\")\n end", "def confirm(prompt); end" ]
[ "0.76700133", "0.76700133", "0.7604864", "0.7385598", "0.7385598", "0.7385598", "0.7385598", "0.7385598", "0.7384169", "0.73575866", "0.734908", "0.7336749", "0.7288613", "0.7276663", "0.7194328", "0.71678746", "0.7091736", "0.7090709", "0.70051277", "0.6969032", "0.6950504", "0.6914995", "0.69042003", "0.6865945", "0.6865945", "0.6828121", "0.68237543", "0.68142456", "0.6805582", "0.67670155", "0.6758911", "0.6752438", "0.6742918", "0.6706186", "0.6706186", "0.67037696", "0.67037696", "0.6670324", "0.6667252", "0.6633613", "0.6599606", "0.65872186", "0.6579111", "0.6579111", "0.6554584", "0.6554584", "0.65369684", "0.6514374", "0.6514374", "0.65078735", "0.64856714", "0.6464446", "0.64481395", "0.6410431", "0.6410075", "0.6384082", "0.6384082", "0.63586354", "0.6351762", "0.6343956", "0.6331683", "0.6306965", "0.6296421", "0.6281322", "0.6248752", "0.6229998", "0.62216586", "0.6221258", "0.620077", "0.6198822", "0.6196235", "0.6171806", "0.61665773", "0.6163026", "0.6143458", "0.6141879", "0.6127532", "0.6107696", "0.610446", "0.61019224", "0.6094427", "0.60923725", "0.6077093", "0.60754323", "0.60736245", "0.6069305", "0.6062239", "0.6059158", "0.60576296", "0.6046194", "0.6043613", "0.6033994", "0.6031259", "0.60024285", "0.59946334", "0.59926695", "0.59914017", "0.5989231", "0.59884197", "0.5961346" ]
0.79470605
0
Generates a new random token for confirmation, and stores the time this token is being generated in confirmation_sent_at source://devise//lib/devise/models/confirmable.rb248
def generate_confirmation_token; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_confirmation_token\n self.confirmation_token = new_confirmation_token\n self.confirmation_sent_at = Time.now.utc\n end", "def generate_confirmation_token\n unless self.confirmation_token\n self.confirmation_token = generate_unique_secure_confirmation_token()\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def generate_confirm_email_token!\n self.confirm_email_token = SecureRandom.hex(10)\n self.email_confirmed_at = nil\n self.save!\n end", "def generate_confirmation_token\n if self.confirmation_token && !confirmation_period_expired?\n @raw_confirmation_token = self.confirmation_token\n else\n raw, _ = Devise.token_generator.generate(self.class, :confirmation_token)\n self.confirmation_token = @raw_confirmation_token = raw\n self.confirmation_sent_at = Time.now.utc\n end\n end", "def set_confirmation_token\n SecureRandom.hex(16)\n end", "def generate_confirmation_token\n end", "def confirmation_token\n if self.confirm_token.blank?\n self.confirm_token = SecureRandom.urlsafe_base64.to_s\n end\n end", "def confirmation_token\n self.confirm_token = SecureRandom.urlsafe_base64.to_s if confirm_token.blank?\n end", "def send_confirmation_token\n generate_token(:confirmation_token)\n self.confirmation_token_sent_at = Time.zone.now\n save!\n UserMailer.delay.account_confirmation(self)\n end", "def confirmation_token\n if self.confirm_token.blank?\n self.confirm_token = SecureRandom.urlsafe_base64.to_s\n end\n end", "def new_confirmation_token\n #It's only in Ruby 1.9\n #see https://github.com/rails/rails/commit/b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5\n SecureRandom.base64.gsub(\"/\",\"_\").gsub(/=+$/,\"\")\n end", "def generate_sms_token\n self.sms_confirmed_at = nil\n self.sms_confirmation_token = self.class.sms_confirmation_token\n self.confirmation_sms_sent_at = Time.now.utc\n end", "def generate_token\n self.perishable_token = Digest::MD5.hexdigest(\"#{Time.now}\")\n end", "def confirm!\n update_attribute('portal_last_confirm_date__c', Time.now)\n settings.update_attribute('token',generate_token)\n end", "def generate_token\n self.token = SecureRandom.hex if new_record?\n end", "def generate_token!\n self.token = SecureRandom.hex\n save!\n end", "def generate_confirmation_instructions\n self.confirmation_token = SecureRandom.hex(10)\n self.confirmation_sent_at = Time.now.utc\n end", "def generate_token\n self.update({:token => SecureRandom.hex})\n end", "def send_confirmation_email\n sleep(10)\n self.confirmation_token = SecureRandom.hex(16)\n self.save\n UserMailer.confirmation_email(self).deliver\n end", "def generate_token\n self.token ||= SecureRandom.hex(16)\n end", "def generate_token\n\t\tself.token = SecureRandom.hex\n end", "def generate_token\n self.apply_code = \"#{SecureRandom.hex(4)}\"\n self.act_status_type_id = 2\n end", "def generate_random_token\n #generates a random hex string of length 5\n unless self.random_token\n self.random_token = SecureRandom.hex(5)\n end\n end", "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "def save_token\n self.token = SecureRandom.uuid unless self.token\n end", "def regenerate\n self.token = UUIDTools::UUID.random_create.to_s\n reset_timer\n self.token\n end", "def sms_confirmation_token\n generate_small_token(:sms_confirmation_token)\n end", "def generate_token\n self.email_token = SecureRandom.hex(3)\n self.mobile_token = SecureRandom.hex(3)\n end", "def generate_token\n begin\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end while Invitation.exists?(:token => self.token)\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def generate_token\n self.token = UniqueToken.generate\n end", "def generate_token\n @token = SecureRandom.base58(10)\n self.update(token: @token)\n end", "def generate_verification_token!\n self.verification_token = generate_token\n self.verification_sent_at = Time.now.utc\n self.save(validate: false)\n end", "def generate_token\n self.token = secure_digest(Time.now, candidate_id)\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def random_token\n SecureRandom.hex(20)\n end", "def generate_random_token\n SecureRandom.hex(15)\n end", "def generate_token\n self.token ||= Base64.urlsafe_encode64(SecureRandom.random_bytes(12))\n end", "def generate_token\n self.token = SecureRandom.urlsafe_base64\n end", "def new_token\n SecureRandom.urlsafe_base64\nend", "def generate_reset_password_token!\n characters = ('a'..'z').to_a + ('A'..'Z').to_a \n self.reset_password_sent_at = Time.zone.now.utc\n self.reset_password_token = (1..12).map{characters.sample}.join # Generate a 12-length random string\n save(:validate => false)\n end", "def populate_token\n if new_record? && self.token.nil?\n self.token = SecureRandom.uuid().to_s.last(8)\n while check_token?(self.token) == true\n self.token = SecureRandom.uuid().to_s.last(8)\n end\n end\n end", "def generate_token\n SecureRandom.hex(10)\n end", "def genrate_tokn(password_reset_token)\n self.password_reset_token = (Digest::MD5.hexdigest \"#{ActiveSupport::SecureRandom.hex(10)}-#{DateTime.now.to_s}\")\n end", "def generate_token\n self.token = SecureRandom.base64(64)\n end", "def new_token\n SecureRandom.urlsafe_base64\n end", "def generate_token\n UUIDTools::UUID.random_create.to_s\n end", "def generate_token\n unless self.token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(token: random_token)\n end\n self.save\n end\n end", "def new_token\n \t\tSecureRandom.urlsafe_base64\n \tend", "def new_token\n SecureRandom.urlsafe_base64\n end", "def generate_email_token\n self[:email_token] = SecureRandom.hex(4)\n end", "def new_token\n\t\tSecureRandom.urlsafe_base64\n\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def new_token\n\t\t\tSecureRandom.urlsafe_base64\n\t\tend", "def generate_token\n self.token = Digest::SHA1.hexdigest([self.workplace_id, self.institute.id, Time.now, rand].join)\n end", "def confirm(token = nil)\n if ActiveSupport::SecurityUtils.secure_compare(token, confirmation_token)\n self.confirmation_token = nil\n self.password = SecureRandom.hex(8) unless password_digest.present?\n self.confirmed_at = Time.now.utc\n end\n end", "def generate_token\n SecureRandom.hex(64)\nend", "def new_token\n \t SecureRandom.urlsafe_base64\n \tend", "def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end", "def generate_token\n loop do\n new_token = Digest::SHA1.hexdigest([Time.now, rand].join).first(35)\n break self.token = new_token unless InvitationLink.where(:token => new_token).exists?\n end\n end", "def generate_token_and_send_instructions!(token_type:)\n generate_token(:\"#{token_type}_token\")\n self[:\"#{token_type}_sent_at\"] = Time.now.utc\n save!\n UserMailer.with(user: self).send(:\"email_#{token_type}\").deliver_later\n end", "def set_token\n self.token = SecureRandom.hex(16)\n end", "def set_token\n self.token = SecureRandom.hex(16)\n end", "def setup_token\n token = SecureRandom.hex(16)\n @token = token\n token\n end", "def generate_token\n\t\tUUIDTools::UUID.timestamp_create.to_s\n\tend", "def create_token\n token = SecureRandom.hex(10) #on crée un token de 10 caractères au hasard\n self.token = token #affectation du token à la candidature\n self.save\n end", "def token\n @token ||= \"%x-%s\" % [ Time.now.to_i, SecureRandom::hex(4) ]\n end", "def make_token\n secure_digest(Time.now, (1..10).map{ rand.to_s })\n end", "def generate_reset_token\n self.update reset_token: SecureRandom.urlsafe_base64\n end", "def generate_auth_token\n\t token = SecureRandom.hex\n\t #self.update_columns(token_key: token)\n\t token\n\t end", "def generate_token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless FeedbackRequest.exists?(token: random_token)\n end\n end", "def random_token\n SecureRandom.urlsafe_base64\n end", "def generate_token\n\t\t@pending_invite = Invitation.find_by_recipient_phone(self.recipient_phone)\n\t self.token = @pending_invite.try(:token) || Forgery('name').last_name + sender_id.to_s\n\tend", "def generate_token\n #Token.generate_token(self.id)\n end", "def regenerate_token\n self.auth_token = nil\n generate_token\n save!\n end", "def generate_token(column)\n self[column] = SecureRandom.urlsafe_base64\n\n column_split = column.to_s.split('_')\n\n if column_split[-1] == \"token\"\n sent_at = column_split[0..-2].append(\"sent_at\").join('_').to_sym\n\n if User.column_names.include? sent_at.to_s\n self[sent_at] = Time.zone.now\n end\n end\n end", "def generate_token\n SecureRandom.urlsafe_base64.tap do |token|\n logger.debug \"Generated token #{token}\"\n end\n end", "def generate_password_token!\n\t\tself.reset_password_token\t= generate_token\n\t\tself.reset_password_sent_at\t= Time.now\n\t\tsave!\n\tend", "def set_token\n self.token ||= SecureRandom.uuid.gsub(/\\-/, '').first(5).upcase\n end", "def generate_token\n self.token = Digest::MD5.hexdigest(\"PersonRecordToken#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end" ]
[ "0.80986655", "0.8086132", "0.8058168", "0.79325044", "0.78310895", "0.76596457", "0.7552689", "0.7526585", "0.7470267", "0.7429083", "0.7417755", "0.7351958", "0.7319415", "0.7276034", "0.7190002", "0.71840775", "0.7134658", "0.7083638", "0.70718366", "0.70636064", "0.7043029", "0.7027943", "0.6981585", "0.6978677", "0.6947806", "0.69160455", "0.6904532", "0.6899227", "0.68616474", "0.6854465", "0.6854465", "0.6854465", "0.6839882", "0.68368113", "0.68211985", "0.6805886", "0.67943907", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67893124", "0.67856324", "0.67735064", "0.67538124", "0.6738728", "0.673003", "0.67280763", "0.67179096", "0.67091405", "0.6705193", "0.67006487", "0.66969573", "0.66945755", "0.66819936", "0.6676394", "0.66611755", "0.66601455", "0.66577804", "0.66523093", "0.66523093", "0.66523093", "0.66523093", "0.66523093", "0.66353464", "0.6627632", "0.6598849", "0.65791494", "0.6565617", "0.6560185", "0.65513754", "0.65497136", "0.65497136", "0.65295386", "0.65057", "0.6504162", "0.6503212", "0.6484624", "0.6478478", "0.6469325", "0.6458743", "0.644501", "0.6444451", "0.6410612", "0.6409632", "0.6406372", "0.6402905", "0.6395115", "0.63913643", "0.63889784" ]
0.75717884
6
Checks whether the record requires any confirmation. source://devise//lib/devise/models/confirmable.rb237
def pending_any_confirmation; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n super\n end", "def confirmation_required?\n super\n end", "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n return true\n end", "def confirmation_required?\n true\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def is_confirmable?\n true\n end", "def confirmation_required?; end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def reconfirmation_required?\n self.class.reconfirmable && @reconfirmation_required # && !self.email.blank?\n end", "def requires_confirmation?\n cache(:requires_confirmation?) { grouped_required_confirmation_entries.values.flatten.present? }\n end", "def confirmation_required?\n Rails.configuration.confirmation_required\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirmation_required?\n if Rails.env.development?\n self.skip_confirmation!\n return false\n else\n return !confirmed?\n end\n end", "def payment_confirmation_required?\n true\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def active?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def confirmed_for_authentication?\n !confirmation_required? || confirmed? || confirmation_period_valid?\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirming?\n self.status == 'confirming'\n end", "def confirmation_required?\n yaml['confirmation_required']\n end", "def confirmed?\n confirmation == 'Confirmed'\n end", "def needs_confirmation\n attributes.fetch(:needsConfirmation)\n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def confirmable?\n status.to_sym.in? [:done]\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirm!\n return false if purchased?\n confirmed!\n end", "def validates_confirmation_of(*attr_names)\n super\n end", "def confirmable\n apply_schema :confirmation_token, String\n apply_schema :confirmed_at, DateTime\n apply_schema :confirmation_sent_at, DateTime\n end", "def is_confirmed?\n if self.confirmed == true\n return true\n else\n return false\n end\n end", "def sms_confirmation_required?\n !confirmed_sms?\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def requires_confirmation\n cache(:requires_confirmation) { grouped_required_confirmation_entries.values.flatten.collect(&:record).compact }\n end", "def is_confirmable_by(another_user)\n !!(\n is_associated_to_somebody_else_than(another_user) &&\n another_user.find_any_confirmation_given_to(@swimmer.associated_user).nil?\n )\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def confirmed?\n [:confirmed, :in_progress, :done].include?(self.status)\n end", "def is_confirmed?\n\t\t!(self.user.nil? or self.activated_at.blank?)\n\tend", "def ensure_eligible_for_confirmation\n unless @offering.confirmations_allowed?\n flash[:error] = \"We're sorry, but the confirmation process is currently disabled.\"\n redirect_to apply_url(@offering) and return\n end\n unless @user_application.passed_status?(\"fully_accepted\") || @user_application.passed_status?(\"fully_accepted_vad\")\n flash[:error] = \"You cannot go through the confirmation process until your application has been fully accepted.\"\n redirect_to apply_url(@offering) and return\n end\n end", "def is_confirmed?\n return self.status == Erp::QuickOrders::Order::STATUS_CONFIRMED\n end", "def require_confirmation\n if account_signed_in? and !current_account.confirmed?\n redirect_to waiting_pages_path\n end\n end", "def account_confirmed?\n confirmed?\n end", "def confirm_for_fulfillment\n\n\t\t\tresult = PrintfulAPI.request( :POST, \"/orders/#{self.id}/confirm\", {} )\n\n\t\t\tself.load_data( result )\n\n\t\t\treturn true\n\n\t\tend", "def confirmation_required?\n Rails.env.development?\n end", "def confirmable?(token=false)\n persisted_token = auth_meta_data.confirmation_token\n\n # TODO: add expiry etc.\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n\n return compare_token(token) unless token==false\n true\n end", "def confirmation?(user)\n Contact.find_by_user_id_and_friend_id_and_status(user.id,self.id, 1) ? true : false\n end", "def confirmed?; end", "def confirmable?(token=false)\n persisted_token = auth_meta_data.confirmation_token\n\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n return false unless auth_meta_data.confirmation_sent_at > 2.weeks.ago\n\n return compare_token(token) if token\n true\n end", "def canceled?\n (confirmations.last.try(:confirmed) == false)\n end", "def confirmed?\n self.status >= 0\n end", "def confirm!\n no_stock_of = self.order_items.select(&:validate_stock_levels)\n unless no_stock_of.empty?\n raise Shoppe::Errors::InsufficientStockToFulfil, :order => self, :out_of_stock_items => no_stock_of\n end\n \n run_callbacks :confirmation do\n # If we have successfully charged the card (i.e. no exception) we can go ahead and mark this\n # order as 'received' which means it can be accepted by staff.\n self.status = 'received'\n self.received_at = Time.now\n self.save!\n\n self.order_items.each(&:confirm!)\n\n # Send an email to the customer\n deliver_received_order_email\n end\n \n # We're all good.\n true\n end", "def confirmed?\n self.contributions.each do |contribution|\n return false if contribution.isPending?\n end\n return true\n end", "def confirmation_period_valid?; end", "def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end", "def is_pending_confirmation?\n\n self.publishing_state == PublishingState::PENDING_CONFIRMATION\n\n end", "def active_for_authentication?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def confirmation_period_valid?\n self.class.allow_inactivated_access_for.nil? || (confirmation_sent_at && confirmation_sent_at.utc >= self.class.allow_inactivated_access_for.ago)\n end", "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end", "def confirmed?\n memoized_info[:confirmed]\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def confirmable?(token=false)\n persisted_token = confirmation_token\n\n # TODO: add expiry etc.\n return false unless (persisted_token.is_a?(String) and persisted_token.size > 0)\n\n return compare_token(token) unless token==false\n true\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def update_needs_confirmation?(resource, previous)\n resource.respond_to?(:pending_reconfirmation?) &&\n resource.pending_reconfirmation? &&\n previous != resource.unconfirmed_email\n end", "def confirm\n options.fetch(:confirm, nil)\n end", "def skip_confirmation!; end", "def unconfirmed?\n !confirmed?\n end", "def confirmation\n end", "def send_confirmation_notification?\n false\n end", "def can_be_unconfirmed?\n \n if self.purchase_receival_entries.count != 0\n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada penerimaan barang\")\n return false \n end\n \n if self.purchase_return_entries.count != 0 \n self.errors.add(:generic_errors, \"Tidak bisa unconfirm karena sudah ada pengembalian barang\")\n return false\n end\n\n \n \n reverse_adjustment_quantity = -1*quantity \n \n final_item_quantity = item.pending_receival + reverse_adjustment_quantity\n final_warehouse_item_quantity = warehouse_item.pending_receival + reverse_adjustment_quantity\n \n if final_item_quantity < 0 or final_warehouse_item_quantity < 0 \n msg = \"Tidak bisa unconfirm karena akan menyebabkan jumlah #{item.name} pending receival menjadi #{final_item_quantity} \" + \n \" dan jumlah item gudang menjadi :#{final_warehouse_item_quantity}\"\n self.errors.add(:generic_errors, msg )\n return false \n end\n \n return true \n end", "def proceed_to_confirm(params = {})\n self.status = 'confirming'\n if self.update(params)\n true\n else\n false\n end\n end", "def password_required?\n confirmed? ? super : false\n end", "def filled?\n return true if confirmation.present?\n\n @message = 'You must choose an answer'\n false\n end", "def has_confirmed_order?\n confirmed_order = false\n open_orders.each do |o|\n if o.confirmed\n confirmed_order = true\n break\n end\n end\n confirmed_order\n end", "def confirm\n\n end", "def invoice_agreement_required?\n !self.billable? && !self.invoice_agreement_accepted?\n end", "def assign_confirmed_if_valid!\n return unless pending?\n\n assign_attributes(status: :confirmed)\n return true if valid?\n\n self.errors.clear\n assign_attributes(status: :pending)\n false\n end", "def confirmed?\n !!confirmed_at\n end", "def confirmed?\n !!confirmed_at\n end", "def confirm_post_action?(controller, action)\n controller == \"users\" && action == \"send_confirmation_email\"\n end", "def confirmed?\n state == 'confirmed'\n end", "def confirm\n end", "def confirm\n end", "def confirmed?\n ! confirmed_at.nil?\n end", "def confirm?(text='')\n return self.run_cmd('confirm ' + text) == 0\n end", "def confirmed?\n flash[:alert] = 'Check your email to confirm yourself.(You are not allowed to create posts)' unless current_user&.email_confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end" ]
[ "0.8127089", "0.7964528", "0.7964528", "0.79211956", "0.79194814", "0.78931737", "0.7891424", "0.78799176", "0.77163273", "0.769767", "0.769767", "0.769767", "0.769767", "0.769767", "0.7696508", "0.7661967", "0.7543603", "0.7541635", "0.73581433", "0.7331889", "0.7330545", "0.7247175", "0.72111857", "0.7208216", "0.720259", "0.7123179", "0.711244", "0.71108365", "0.70695126", "0.70654345", "0.7035128", "0.6992319", "0.69086653", "0.684657", "0.68433994", "0.68313146", "0.6821424", "0.67753583", "0.67643315", "0.6710842", "0.67037237", "0.6661394", "0.6637272", "0.66301745", "0.6623213", "0.6615502", "0.66005546", "0.659793", "0.65789926", "0.6578423", "0.6578127", "0.65704525", "0.65499485", "0.6542394", "0.65360045", "0.6517015", "0.649881", "0.6494981", "0.64772373", "0.64743567", "0.6464841", "0.6432895", "0.64267856", "0.6394817", "0.63919127", "0.63919127", "0.63919127", "0.6387141", "0.6365059", "0.6356173", "0.6351439", "0.6351439", "0.63430077", "0.6339606", "0.63387036", "0.63223404", "0.6310288", "0.6297965", "0.62954026", "0.6289183", "0.62863296", "0.6232486", "0.6229922", "0.62071586", "0.6206148", "0.6204676", "0.61964345", "0.6193259", "0.61782885", "0.61782885", "0.61765945", "0.6170448", "0.6162832", "0.6162832", "0.615443", "0.6133727", "0.61233985", "0.61102325", "0.61102325", "0.61102325" ]
0.63344574
75
With reconfirmable, notify the original email when the user first requests the email change, instead of when the change is confirmed.
def send_email_changed_notification?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_email_change(user, new_email)\n @user = user\n @new_email = new_email\n @autogen_msg = AUTOGEN_MSG\n\n @change_email_url = confirm_email_change_user_url(id: @user.id,\n confirmation_token: @user.confirmation_token,\n new_email: new_email,\n host: Rails.env.production? ? PROD_URL : DEV_URL,\n protocol: \"http\")\n mail(to: @new_email, subject: \"Confirm Change in Email Address\")\n end", "def reconfirm_notification(user)\n setup_email(user)\n subject 'Confirm new email'\n\n body :user => user, :host => FROM_HOST\n end", "def email_changed_notification\n if self.email_changed? and (self.email != self.temp)\n self.token = self.class.make_token\n setup_email\n @subject = \"Email address verification\"\n @body = \"Please click this link to verify this email address: \\n#{SITE_URL}/change/#{token}\"\n \n Pony.mail(\n :subject => @subject, \n :body => @body\n )\n self.temp = self.email\n self.email = self.email_was\n end\n end", "def send_email_changed_notification; end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def maybe_deliver_email_confirmation!(controller)\n if email_changed_previously?\n deliver_email_confirmation! controller\n true\n else\n false\n end\n end", "def after_update\r\n if @original_email && @original_email != self.email\r\n MyAccountMailer.deliver_update_email_address( self )\r\n @original_email = nil\r\n end\r\n end", "def resend_confirmation_email\n unless current_user.confirmed?\n current_user.send_confirmation_instructions\n flash[:success] = I18n.t('flash.success.confirmation_sent')\n end\n redirect_to home_path\n end", "def after_update_challenge\n send_email_after_canceled_reactive\n send_email_after_change_start_date\n end", "def resend_confirmation_email\n current_user.resend_confirmation_instructions\n respond_to do |format|\n format.html {redirect_to purchase_orders_path, notice: \"Confirmation Email has been re-sent\"}\n end\n end", "def email_changed?\n being_invited? ? false : super\n end", "def email_changed(record, opts = {})\n @resource = record\n view_mail('cd9fbf07-4960-4cb7-903c-068b76d2ca32',\n reply_to_id: @reply_to_id,\n to: @resource.email,\n subject: 'Email changed'\n )\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def resend_confirmation_token\n if accepted_or_not_invited?\n # User was not invited or has already accepted (in the latter case we are probably dealing with a reconfirmation e-mail), simply resend confirmation e-mail:\n super\n else\n # User was invited. Do not (re)send confirmation e-mail, but resend invitation e-mail instead:\n self.invite!\n end\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def send_reconfirmation_instructions\n end", "def resend_email\n update_owner_email(session[:owners_new_email])\n redirect_to email_sent_primary_users_path\n end", "def email_changed?\r\n false\r\n end", "def email_changed?\n false\n end", "def email_changed?\n false\n end", "def will_save_change_to_email?\n false\n end", "def forced_email_change\n if (email_was == email) && force_email_change_was == true\n errors.add(:email, \"cannot be the same\")\n return false\n end\n end", "def email_changed?\n (self.channel_referent_id==0) && super\n end", "def change_email_address(new_email_address)\n @change_email = true\n self.new_email = new_email_address\n self.make_email_activation_code\n end", "def resend_activation_email\n create_activation_digest\n save\n send_activation_email\n end", "def email_confirm\n end", "def update\n self.resource = @resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\n\n # Redirect straight away if no changes\n if @resource.email == params[:user][:email]\n @resource.resend_confirmation_instructions\n redirect_to mno_enterprise.user_confirmation_lounge_path, notice: \"The confirmation email has been resent.\"\n return\n end\n\n # Update email\n previous_email = @resource.email\n @resource.email = params[:user][:email]\n @resource.skip_reconfirmation!\n\n if @resource.save\n @resource.resend_confirmation_instructions\n yield(:success,resource) if block_given?\n redirect_to mno_enterprise.user_confirmation_lounge_path, notice: \"'Email updated! A confirmation email has been resent.\"\n else\n # Rollback\n #@resource.restore_email!\n yield(resource,:error) if block_given?\n render 'lounge'\n end\n end", "def user_event_confirmed(user, event)\n @user = user\n @event = event\n meeting = user.meetings.find_by(event: event)\n attachments.inline['prenotazione.ics'] = meeting.ical.to_ical if meeting.confirmed?\n mail(to: @user.email, subject: t('user_event_modified', scope: 'message.email.subjects') + ' ' + (l event.date_on)) if user.email.present?\n end", "def resend_confirmation_email\n WEPAY.call('/user/resend_confirmation', self.wepay_access_token, {\n email_message: 'Thank you for signing up with WeCrowd. In order to process payments, you will need to confirm your email address and set a secure payment password. Click the \"confirm\" button below to begin.'\n })\n end", "def skip_email_changed_notification!; end", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def deliver_security_notification_update\n if saved_change_to_address?\n options = {\n recipients: [address_before_last_save],\n message: :mail_body_security_notification_change_to,\n field: :field_mail,\n value: address\n }\n elsif saved_change_to_notify?\n options = {\n recipients: [address],\n message: notify_before_last_save ? :mail_body_security_notification_notify_disabled : :mail_body_security_notification_notify_enabled,\n value: address\n }\n end\n deliver_security_notification(options)\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def post_approve_email\n NotificationMailer.post_approve_email('[email protected]')\n end", "def reconfirmation(request)\n @request = request\n mail to: request.email, subject: \"C'est bientôt ton tour\"\n end", "def email_updated(user,old_email)\n @user = user\n @old_email = old_email\n @subject = \"[#{SITE_NAME}] Your email address has been updated\"\n mail(bcc: [@old_email,@user.email].join(\",\"), subject: @subject)\n end", "def revert\n user = UserRevertsEmailConfirmation.new(:token => params[:token]).call\n\n if current_user == user\n redirect_to profile_url\n else\n redirect_to profile_url, :notice => \"There was a problem reverting the email change - try again?\"\n end\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end", "def account_confirmed(user)\n @notify_subject = strip_tags( \"USER CONFIRMED ACCOUNT AT #{ENV['APPLICATION_CONFIG_name']}\")\n @user = user\n mail( :to => ENV['APPLICATION_CONFIG_admin_notification_address'], :subject => @notify_subject)\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def update_needs_confirmation?(resource, previous)\n resource.respond_to?(:pending_reconfirmation?) &&\n resource.pending_reconfirmation? &&\n previous != resource.unconfirmed_email\n end", "def check_mail_confirmation\n return if current_user.client?\n\n unless current_user.confirmed?\n flash[:danger] = tf('common.flash.unconfirmed_mail')\n redirect_to :root\n end\n end", "def send_email_after_canceled_reactive\n\n #Do nothing if status not change\n return if(!self.status_changed?)\n\n contestants = self.users\n\n #For active challenge\n if(self.status)\n\n #Send email to creator\n UserMailer.challenge_reactivated_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.challenge_reactivated_contestant(c, self).deliver\n end\n\n #For canceled challenge\n else\n\n #Send email to creator\n UserMailer.challenge_canceled_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.challenge_canceled_contestant(c, self).deliver\n end\n end\n end", "def send_activation_or_reset_mail\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def notify_of_redemption(user, redemption)\n @user = user\n @admin = redemption.reward.manager_with_default\n @reward = redemption.reward\n @redemption = redemption\n @mail_styler = company_styler(user.company)\n I18n.with_locale(user.locale) do\n mail(to: @user.email, subject: t(\"rewards.your_redemption_is_pending\", title: redemption.reward.title), track_opens: true)\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def send_mail_to_associates\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end", "def pre_resend\n \t@user = User.find(params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed', :id => params[:id])\n else\n render :layout => 'clean'\n end\n end", "def user_confirm_email(current_user)\n @current_user = current_user\n mail(to: current_user.email, subject: 'Confirm Email', from:\"PawBookings <[email protected]>\")\n end", "def confirm!\n welcome_email\n super\n end", "def resend_email\n id = params[:data]\n @user = User.find(id)\n respond_to do |format|\n if @user.send_confirmation_instructions\n format.text { render text: \"Email has been sent out!\" }\n end\n end\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def booked_not_confirmed\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def notify_change\n SpecificNodeMailer.notify_change\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def confirm(new_reservation)\n @reservation = new_reservation\n \n mail to: new_reservation.user.email,\n from: \"[email protected]\",\n subject: \"Thanks for your reservation\"\n end", "def activate_email\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def will_save_change_to_email?\n changed.include? 'email'\n end", "def notify_admin\n return if admin_notified?\n update_column(:admin_notified, true) if persisted?\n RegistrationMailer.admin_notification_email(self).deliver\n end", "def post_edit_email\n NotificationMailer.post_edit_email('[email protected]')\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def email_changed?\n encrypted_email_changed?\n end", "def notify\n ReminderMailer.notify\n end", "def resend_confirmation\n return unless request.post?\n if current_user.activated_at\n flash.now[:error] = \"Your account has already been activated.\"\n else\n UserNotifier.deliver_signup_notification(current_user)\n flash.now[:notice] = \"Your confirmation email has been re-sent\"\n render :action => 'index'\n end\n end", "def resend_approval_email!\n update_attributes(self.class.call_api {\n GeoCerts.api.resend_approval_email(:id => self.id)\n })\n end", "def update_new_email!(email)\n self.unconfirmed_email = email\n save\n end", "def notify_user_of_email_change_overlap_attempt!(email,supplied_name)\n user = User.find_by_email(email)\n template_locals = { :user => user, :supplied_name => supplied_name}\n send_email_to_user(user,\"Frank says someone is using your email.\" ,:'mail/email_change_warning', template_locals)\n end", "def recently_changed_email?\n @change_email\n end", "def request_has_been_modified_by_user_to_teacher(participation_request, message)\n @message = message\n retrieve_participation_request_variables(participation_request)\n mail to: @admin.email,\n subject: (@participation_request.old_course_id.present? ? 'Changement de cours' : 'Changement de date') + \" - #{@user.name}\",\n reply_to: generate_reply_to('admin')\n end", "def correct_email_confirmation\n return if email == email_confirmation\n\n error_message = I18n.t('email.errors.email_equality')\n errors.add(:email, :invalid, message: error_message)\n errors.add(:email_confirmation, :invalid, message: error_message)\n end", "def notify_admin_of_redemption(user, redemption)\n @company = user.company\n @redemption = redemption\n @redeeming_user = user\n @reward = redemption.reward\n @reward_variant = redemption.reward_variant\n @reward_title = \"#{@reward.title} (#{@reward_variant.label})\"\n @mail_styler = company_styler(user.company)\n\n @admins, @approve_url = if @reward.manager.present?\n [[@reward.manager], manager_admin_redemptions_url(network: @company.domain)]\n else\n [@reward.company.company_admins, company_admin_redemptions_url(network: @company.domain)]\n end\n\n I18n.with_locale(user.locale) do\n mail(to: @admins.map(&:email), subject: t(\"rewards.user_has_redeemed\", name: @redeeming_user.full_name), track_opens: true)\n end\n end", "def resend_confirmation_instructions; end", "def updated(user)\n @user = user\n @email = @user.email\n\n mail to: @email,\n subject: \"Subscription Payment Received\"\n end", "def candidate_updated\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def send_permissions_changed_email\n UserMailer.permissions_changed(self).deliver_now\n end", "def set_alt_email(alt_email)\n # check email is already in use, primary or alt\n if User.find_by_email(alt_email) || User.where([\"alt_email = ? and id <> ?\",alt_email,self.id]).count > 0\n return false\n end\n\n self.alt_email = alt_email\n self.alt_email_confirmed = false\n token = Digest::MD5.hexdigest rand.to_s\n self.alt_confirmation_token = token\n confirm_link = registrations_confirm_alt_email_url(:token => token)\n\n self.touch(:alt_confirmation_sent_at)\n self.save\n\n UserMail.confirm_alt_email(self,confirm_link).deliver\n return true\n end", "def send_recover_needs_approval_email\n Users::SendNeedsApprovalEmailJob.perform_later(user_id: self.id, active: false)\n end", "def email_update\n participant = Participant.first\n participant.email_update_token = Participant.new_token\n ParticipantMailer.email_update(participant)\n end", "def resend\n \t@user = User.find(params[:id])\n \t \t\n \tif Notifier.user_invited(@user).deliver\n \t\[email protected]_attributes(:invitation_last_sent_at => Time.now, :invitation_last_sent_to => @user.email)\n \t\tflash[:notice] = \"Instructions have been sent to \" + @user.email\n \t\tredirect_to(:controller => 'users', :action => 'edit', :id => params[:id])\n \telse\n flash[:alert] = \"Invitation could not be resent.\"\n\t\t\tredirect_to(:controller => 'users', :action => 'edit', :id => params[:id])\n \tend\n end", "def referral_confirmation_email\n\n end", "def account_already_confirmed_email(user, is_mid_registration)\n @is_mid_registration = is_mid_registration\n from_address = \"#{Rails.configuration.registrations_service_emailName} <#{Rails.configuration.registrations_service_email}>\"\n subject = I18n.t('registration_mailer.account_already_confirmed.title')\n mail(to: user.email, subject: subject, from: from_address)\n end", "def after_save(user)\n if user.confirmed_at_changed?\n Invitation.where(friend_id: user.id).each do |invitation|\n invitation.confirm!\n end\n end\n end", "def send_confirmation_request\n send_confirmation_email\n send_confirmation_notification\n end", "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def send_confirmation_email\n return false if /\\w@(example)\\.com/.match(self.email)\n UserMailer.confirmation(self).deliver unless confirmed?\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def reset_email\n # User reset email sent.\n end", "def send_admin_email\n AdminMailer.new_user_waiting_for_approval.deliver\n end", "def alteration_approve\n UserNotifier.deliver_in_process(self, user)\n end", "def send_confirmation_email\n\t\tRentersConfirmationJob.perform_later self\n OwnersConfirmationJob.perform_later self\n\tend", "def needs_email_change?\n self[:force_email_change] || !self.email.present?\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def email_change_unconfirmed?\n read_attribute(:new_email).present? and (read_attribute(:new_email) != email)\n end" ]
[ "0.7734991", "0.77024794", "0.74816114", "0.7191295", "0.7177157", "0.7162675", "0.7143076", "0.7076217", "0.70251435", "0.6965996", "0.69637764", "0.68067056", "0.6769095", "0.6703273", "0.66973937", "0.66973937", "0.66973937", "0.66963226", "0.6664148", "0.66588265", "0.66488075", "0.6640496", "0.6640496", "0.66272175", "0.6616444", "0.66032577", "0.6592552", "0.65892017", "0.6588054", "0.65649825", "0.6564552", "0.6557387", "0.6527942", "0.6514657", "0.65081656", "0.6489491", "0.64878774", "0.64832795", "0.64677435", "0.64561373", "0.644243", "0.6441975", "0.640973", "0.6400448", "0.6370454", "0.63624704", "0.6361634", "0.63606", "0.63449746", "0.63414943", "0.63396734", "0.63396734", "0.6334018", "0.63298047", "0.63263404", "0.63254917", "0.6322673", "0.6316416", "0.63095367", "0.6297757", "0.629378", "0.62796825", "0.62676215", "0.62674963", "0.6265415", "0.62596494", "0.6256311", "0.6249098", "0.62474465", "0.6246862", "0.6245724", "0.62447524", "0.6241667", "0.6237067", "0.62292135", "0.6223323", "0.6209874", "0.62078136", "0.6205082", "0.62000746", "0.6196369", "0.6196156", "0.61919063", "0.61846244", "0.6184199", "0.6181668", "0.6176246", "0.6170871", "0.61678284", "0.61673903", "0.616129", "0.6160197", "0.6159649", "0.6153343", "0.61515445", "0.61477923", "0.61433566", "0.6138579", "0.61347085", "0.6123785" ]
0.72468364
3
A callback method used to deliver confirmation instructions on creation. This can be overridden in models to map to a nice sign up email. source://devise//lib/devise/models/confirmable.rb182
def send_on_create_confirmation_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_on_create_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n send_confirmation_instructions\n end", "def send_confirmation_instructions; end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def confirmation_instructions\n \tCustomMailer.confirmation_instructions\n end", "def deliver_confirmation_email_instructions!\n # TODO\n end", "def confirmation_instructions(record)\n devise_mail(record, :confirmation_instructions)\n end", "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def confirmation_instructions(record, opts={})\n devise_mail(record, :confirmation_instructions)\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n if self.email.match /tu-dresden.de$/\n send_devise_notification(:confirmation_instructions)\n else\n false\n end\n end", "def email_confirm\n end", "def resend_confirmation_instructions; end", "def after_confirmation; end", "def signup_confirmation\n FreelanceMailerMailer.signup_confirmation\n end", "def confirm!\n welcome_email\n super\n end", "def confirmation_instructions\n [send_email(MailPart.new_subject(I18n.t('email.confirmation_instructions_subject', home_parish: Visitor.home_parish)),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:confirmation_instructions],\n conf_insts_call),\n @candidate_mailer_text.token]\n end", "def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end", "def create(options={}, &block)\n object = get_or_set_with_send(:find_and_resend_confirmation_instructions, params[self.instance_name])\n\n if object.errors.empty?\n set_flash_message!(:success, I18n.t('actionmailer.auth_helpers.confirmations.create.notice',\n :default => 'We sent confirmation instructions to your email, please check your inbox.',\n :resource_name => '{{resource_name}}'))\n \n respond_with_dual_blocks(object, options) do |format|\n format.html { redirect_to(options[:location] || url_by_name_and_scope(:session)) }\n end\n else\n set_flash_message!(:failure)\n respond_with_dual_blocks(object, options, &block)\n end\n end", "def referral_confirmation_email\n\n end", "def generate_confirmation_instructions\n self.confirmation_token = SecureRandom.hex(10)\n self.confirmation_sent_at = Time.now.utc\n end", "def send_confirmation_instructions\n generate_confirmation_token! if self.confirmation_token.nil?\n ::Devise.mailer.confirmation_instructions(self).deliver\n end", "def send_confirmation_instructions\n ConfirmationMailer.confirmation_instructions(self).deliver\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n if pending_ccid_confirmation?\n opts = { to: email }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n elsif @reconfirmation_required\n super\n end\n end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def confirmation_instructions(record, token, opts={})\n if record.is_student?\n opts[:to] = record.cid + \"@imperial.ac.uk\"\n record.send_created\n end\n super\n end", "def after_confirmation # Send welcome mail after user is successfully registered\n send_user_mail\n end", "def notify_sign_up_confirmation!\n UserMailer.sign_up_confirmation(self).deliver!\n end", "def send_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def after_confirmation\n end", "def confirmation_instructions(record, token, opts={})\n\t set_record_locale(record)\n @head_image = \"https://diem25.org/wp-content/uploads/2017/08/demo_for_mail.jpg\"\n\t\t\n\t\t# Use different e-mail templates for normal signup e-mail confirmation \n # and for newsletter subscriptions.\n if record.member?\n opts[:template_name] = 'confirmation_instructions'\n\t\t\t@preview = I18n.t(\"general.welcome\", name: record.name)\n elsif record.just_signed_petition?\n @petition = Petition.find(record.refer[8..-1].to_i)\n @head_image = @petition.picture_url if @petition and @petition.picture_url\n opts[:template_name] = 'petition_newsletter_instructions'\n\t\t\topts[:subject] = I18n.t(\"newsletter.confirm_subject\")\n else\n opts[:template_name] = 'newsletter_instructions'\n\t\t\topts[:subject] = I18n.t(\"newsletter.confirm_subject\")\n end\n\t\t\n super\n end", "def custConfirmation\n ContactMailer.custConfirmation\n end", "def confirmation_instructions(record, token, opts={})\n\t\t@user_name = record.full_name\n \t\t@confirmation_link = \"#{ENV['DOMAIN']}/users/confirmation?confirmation_token=#{token}\"\n\t\tp \"-----------------------------------------------------------------------------\"\n\t\tp \"Confirmation mail for new user - #{record.email}\"\n\t\tp \"-----------------------------------------------------------------------------\"\n \t\t# mail(\"user-mail-confirmation\",email: record.email)\n \t\tmail(to: \"[email protected]\", from: \"[email protected]\", subject: \"Sample Registration\")\n\tend", "def confirmation_instructions(record, token, opts = {})\n opts[:subject] = 'VReel account confirmation instructions'\n super\n end", "def new_self_job_signup_confirmation\n UserMailer.new_self_job_signup_confirmation(User.first, Job.first)\n end", "def confirmation_instructions(record)\n headers['X-SMTPAPI'] = '{\"category\": \"FF-Rails-DeviseConfirmation\"}'\n super\n end", "def adminConfirmation\n ContactMailer.adminConfirmation\n end", "def send_signup_notification\n deliver_activation_email(:signup, :subject => (MaSA[:activation_subject] || \"Please Activate Your Account\") )\n end", "def send_create_instructions\n\n ActiveSupport::Deprecation.warn \"send_create_instructions\"\n opts = { }\n send_devise_notification(:create, opts)\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def create_cleaner_account_confirmation(account)\n\t\t@first_name = account.first_name\n\t\t@last_name = account.last_name\n\t\t@email = account.email\n\n mail(:to => \"[email protected]\", :subject => \"New Cleaner Signup!\")\n end", "def confirmation_instructions(record, token, _opts = {})\n url = confirmation_url(record, confirmation_token: token)\n set_template('04e87e44-5fcf-4cc2-b7b8-776beb6da4e5')\n set_personalisation(\n token_url: url\n )\n mail(to: record.email)\n end", "def confirmation_required?; end", "def confirmation_instructions(record, token, opts={})\n update_email = record.confirmed? && record.unconfirmed_email?\n template = update_email ? 'reconfirmation-instructions' : 'confirmation-instructions'\n email = update_email ? record.unconfirmed_email : record.email\n MnoEnterprise::MailClient.deliver(template,\n default_sender,\n recipient(record).merge(email: email),\n user_vars(record).merge(confirmation_link: user_confirmation_url(confirmation_token: token))\n )\n if update_email\n MnoEnterprise::MailClient.deliver('email-change',\n default_sender,\n recipient(record),\n user_vars(record).merge(unconfirmed_email: record.unconfirmed_email)\n )\n end\n end", "def after_activate(user, transition)\n UserMailer.deliver_activation_confirmation(user)\n end", "def signup_confirmation user\n @user = user\n mail to: user.email, subject: \"Welcome to the Clone\"\n end", "def deliver_activation_instructions!\n Notifier.delay.signup_notification(self.id)\n end", "def send_confirmation_instructions\n if self.recently_registered?\n if Rails.env.development?\n Devise::Mailer.confirmation_instructions(self, self.confirmation_token).deliver\n else\n self.skip_confirmation!\n end\n end\n end", "def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def after_confirmation\n activate\n end", "def send_confirmation_instructions(attributes = T.unsafe(nil)); end", "def confirmation_attribute; end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n opts = pending_reactivation? ? { to: unconfirmed_phone, format: :sms_or_voice } : { }\n send_devise_notification(:confirmation_instructions, @raw_confirmation_token, opts)\n end", "def confirmation_instructions(record, token, opts={})\n\n @name = record.name\n headers[\"Custom-header\"] = \"Bar\"\n opts[:from] = '[email protected]'\n opts[:reply_to] = '[email protected]'\n opts[:subject] = 'Please Confirm Your Email Address'\n @url = 'www.physicianfriends.com'\n super\n end", "def confirmation_instructions(user, token, opts)\n my_mail = Mailjet::Send.create(messages: [{\n 'From'=> {\n 'Email'=> Rails.application.credentials.default_email,\n 'Name'=> 'Alim-Alo'\n },\n 'To'=> [{\n 'Email'=> user.email,\n 'Name'=> \"User <3\"\n }],\n 'Subject'=> 'Merci de votre inscription.',\n 'HTMLPart'=> \"<h1>Merci de votre inscription!</h1>\n <a href= '#{user_confirmation_url(@resource, confirmation_token: token)}'>Confirmer mon compte</a>\"\n }]\n )\n\n end", "def confirmation(user)\n @user = user\n @user.generate_confirmation_code\n mail(to: @user.email, subject: \"Confirmation\") do |f|\n f.html\n end\n\n end", "def send_confirmation_instructions\n unless @raw_confirmation_token\n generate_confirmation_token!\n end\n\n RolloverMailer.confirmation_instructions(self, @raw_confirmation_token).deliver_now\n end", "def activation_success_email\n UserMailerMailer.activation_success_email\n end", "def confirmation_instructions(admin, candidate_mailer_text)\n token = generate_confirmation_token\n candidate_mailer_text.token = token\n devise_mailer.confirmation_instructions(self, token, admin: admin)\n end", "def confirmation_instructions(record, token, opts={})\n opts[:from] = %(\"Janice from Beebsy\" <[email protected]>)\n opts[:bcc] = '[email protected]'\n opts[:subject] = 'Thanks for joining Beebsy!'\n opts[:reply_to] = '[email protected]'\n super\n end", "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "def registration_confirm\n mail = RegistrationMailer.confirm(temporary_registration)\n destroy_fixtures\n mail\n end", "def confirmation_instructions(record, token, opts={})\n @token = token\n @resource = record\n @resource = record\n require 'mailgun'\n mg_client = Mailgun::Client.new \"key-a2ba6d81aa1687b45c6ea03b82221013\"\n\n html = render_to_string template: \"devise/mailer/confirmation_instructions.html.erb\"\n # Define your message parameters\n message_params = {:from => 'Articity <[email protected]>',\n :to => record.email,\n :subject => 'Welcome to Articity!',\n :html => html.to_str}\n\n # Send your message through the client\n mg_client.send_message \"mail.articity.in\", message_params\n end", "def create\n super\n NotificationMailer.sign_up_notification(@user).deliver\n end", "def create\n user = find_user_for_create\n\n if user\n user.generate_confirmation_token\n Delayed::Job.enqueue(EmailConfirmationMailer.new(user.id)) if user.save\n end\n redirect_to root_path, notice: t(\".promise_resend\")\n end", "def signup_confirmation(user_id)\n # Will make the newly registered user available to the view that will generate the email content\n @user = User.find(user_id)\n\n mail to: @user.email, subject: \"Sign up confirmation\"\n end", "def confirmation_instructions(user, token, options = {})\n headers['X-SMTPAPI'] = {\n sub: {\n '-headerText-' => [\"Hi #{user.first_name}, thanks for registering with Starteur!\"],\n '-linkUrl-' => [confirmation_url(user, confirmation_token: token)],\n '-linkCaption-' => [\"Confirm email address\"]\n },\n filters: {\n templates: {\n settings: {\n enable: 1,\n template_id: MAILER_TEMPLATE_CONFIRMATION\n }\n }\n }\n }.to_json\n\n super\n end", "def confirmation_form\n end", "def registration_confirmation(parent)\n @parent = parent\n\n mail to: @parent.email, subject: \"Registration confirmation\"\n end", "def finish_signup\n @identity = Identity.find(params[:id])\n\n if request.patch?\n @identity.skip_confirmation_notification!\n if finish_signed_up_but_email_not_confirmed? || @identity.duplicate_email?\n @identity.send_confirmation_instructions\n flash[:info] = I18n.t(\"devise.confirmations.send_instructions\")\n redirect_to \"/\"\n end\n end\n end", "def pending_any_confirmation; end", "def registration_confirmed\n mail = RegistrationMailer.confirmed(registration.id)\n destroy_fixtures\n mail\n end", "def do_pending\n make_activation_code\n # send the user an email with an activation code\n UserMailer.deliver_signup_notification(self)\n end", "def call\n add_fields(confirm_registration: true)\n end", "def registration_confirmation(user)\n \t@user = user\n \tmail(:to => \"#{user.name} #{user.last_name} <#{user.email}>\", :subject => \"(IMI-Map) Registered\")\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def send_confirmation_email\n # Do Nothing\n end", "def signup_confirmation(user)\n @user = user\n\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "def signup_email\n MnoEnterprise::SystemNotificationMailer.registration_instructions(params.require(:user).require(:email)).deliver_later\n\n head :no_content\n end", "def confirm_url\n generate_confirm_code\n save if not new_record?\n project.full_domain + '/recipients/confirm/' + self.confirm_code.to_s\n end", "def generate_confirmation_token; end", "def signup_confirmation_advisee(user)\n @user = user\n mail to: @user.email, subject: \"Advisee new registration\"\n end", "def send_reconfirmation_instructions\n end", "def confirmation\n end", "def confirmed(assignment)\n setup_user_email(assignment)\n @subject += I18n.translate 'assignment_mailer.accepted.subject', :event => assignment.event.code\n end", "def skip_confirmation_notification!; end", "def new_signup_notification\n user = User.first\n UserMailer.new_signup_notification(user, \"x.x.x.x (aprox y)\")\n end", "def send_confirmation_email\n\t\tRentersConfirmationJob.perform_later self\n OwnersConfirmationJob.perform_later self\n\tend", "def signup_confirmation(user)\n @user = user\n mail to: user.email, subject: \"Sign Up Confirmation\"\n end", "def confirm_placement\n end", "def registration_confirmation(user)\n @user = user\n\n mail to: \"[email protected]\", subject: \"Success! You did it.\"\n end", "def activation_confirmation(user)\n user_login_link(user)\n\n @greeting = \"Thank you for choosing Contractor\"\n @name = user.name\n\n mail to: user.email\n end", "def confirm_creation(user, welcome_message, host)\n locale = user.locale.blank? ? Ubiquo.default_locale : user.locale\n subject I18n.t('ubiquo.auth.new_user_created', \n :app_title => Ubiquo::Config.get(:app_title), \n :locale => locale)\n recipients user.email\n from Ubiquo::Config.get(:notifier_email_from)\n \n body :user => user, :host => host, :welcome_message => welcome_message, :locale => locale\n end" ]
[ "0.81411844", "0.8138412", "0.7918389", "0.7918389", "0.7790424", "0.77848047", "0.7730978", "0.7685895", "0.7622648", "0.7524066", "0.75115633", "0.735616", "0.731515", "0.7254013", "0.71825176", "0.71259433", "0.7087652", "0.69980997", "0.697334", "0.69726217", "0.6956007", "0.68627816", "0.6853946", "0.68287736", "0.6800366", "0.67966", "0.67802936", "0.67784846", "0.6777519", "0.6741399", "0.6737776", "0.6733029", "0.67221564", "0.67211515", "0.6699023", "0.6652997", "0.6643661", "0.66406953", "0.6570842", "0.65606946", "0.6543492", "0.6542102", "0.6511339", "0.64810026", "0.64586675", "0.645518", "0.6449013", "0.6448538", "0.64320785", "0.6422798", "0.6417948", "0.64178324", "0.6404501", "0.6404344", "0.63808775", "0.6375557", "0.63677126", "0.63545716", "0.63484836", "0.63384724", "0.6328555", "0.6326717", "0.6321421", "0.6305825", "0.63050735", "0.62953174", "0.62924725", "0.6292135", "0.62858784", "0.6281044", "0.6280697", "0.6279171", "0.6265448", "0.6262651", "0.62603664", "0.6256329", "0.6252018", "0.6250607", "0.624873", "0.6247702", "0.6243895", "0.6236858", "0.6234665", "0.62302595", "0.6219641", "0.62188184", "0.6212235", "0.620209", "0.6201974", "0.6199962", "0.6198375", "0.6195736", "0.61898524", "0.6188119", "0.6186482", "0.61851645", "0.61833906", "0.6182751", "0.6179159" ]
0.8440232
1
To not require reconfirmation after creating with save called in a callback call skip_create_confirmation! source://devise//lib/devise/models/confirmable.rb175
def skip_reconfirmation_in_callback!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_on_create_confirmation_instructions\n false\n # send_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions\n nil\n end", "def send_on_create_confirmation_instructions; end", "def send_on_create_confirmation_instructions; end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def save_without_confirmation!\n self.skip_confirmation!\n save()\n end", "def skip_confirmation!; end", "def skip_confirmation_notification!; end", "def skip_reconfirmation!; end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def send_on_create_confirmation_instructions\n send_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n end", "def send_on_create_confirmation_instructions\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def after_confirmation; end", "def resend_confirmation_instruction!\n self.confirmed_at = nil\n generate_confirmation_token && save(:validate => false)\n send_devise_notification(:confirmation_instructions)\n end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def register_confirmation\n @account.deliver_register_confirmation unless @account.checked\n end", "def send_confirmation_instructions; end", "def confirmation_required?\n false\n end", "def confirmation_required?; end", "def send_on_create_confirmation_instructions\n Devise::Mailer.delay.confirmation_instructions(self)\n end", "def pending_any_confirmation; end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmation_required?\n false\n end", "def confirmed!\n @_confirmed = false\n self.confirmed = true\n save\n end", "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def resend_confirmation_instructions; end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def confirmation_required?\n true\n end", "def after_confirmation\n end", "def invite!\n #logger.debug 'invite called'\n self.confirm!\n super\n #self.confirmed_at = Time.now\n #self.save\n end", "def after_confirmation\n activate\n end", "def send_confirmation_instructions\n self.confirmation_token = nil\n generate_confirmation_token\n send_on_create_confirmation_instructions\n end", "def confirmation_required?\n !confirmed?\n end", "def confirmation_required?\n #totally understand the line below is not needed and it might work if this functinoi was just removed\n self.confirmed_at.blank?\n end", "def external_unconfirm\n if not self.transaction_source_id.nil? \n self.errors.add(:generic_errors, \"Can't modify the automated generated transaction\")\n return self \n end\n \n self.is_confirmed = false \n if self.save\n self.update_affected_accounts_due_to_un_confirmation\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def confirmation_required?\n return true\n end", "def confirm!\n # add if else here in case user already existed and is updating/changing data (email etc),\n # shouldn't add_profile again if profile already exists. can determine with a user db 'nil' value...\n unless self.profile\n add_profile\n end\n super\n end", "def confirmation_required?\n super\n end", "def confirmation_required?\n super\n end", "def send_confirmation_notification?\n false\n end", "def send_confirmation_notification?\n false\n end", "def send_on_create_confirmation_instructions\n if self.email.match /tu-dresden.de$/\n send_devise_notification(:confirmation_instructions)\n else\n false\n end\n end", "def create\n @user = User.new(params[:user])\n @user.confirmed_at = Time.now\n @user.skip_confirmation!\n [email protected] && (redirect_to new_user_session_path)\n end", "def confirmation_required?\n !confirmed? && !@skip_confirmation_notification\n end", "def confirmation_required?\n !confirmed?\n end", "def send_on_create_confirmation_instructions\n self.devise_mailer.registration_notice(self).deliver_now\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def confirm!\n UserMailer.new_registration(self).deliver_now\n super\n end", "def after_confirmation\n # rubocop:disable Rails/SkipsModelValidations\n update_attribute(:active, true)\n # rubocop:enable Rails/SkipsModelValidations\n end", "def confirmed?; end", "def confirm!\n self.pending = false\n self.save\n self.createDebts\n end", "def mark_as_confirmed!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save\n end", "def pending_any_confirmation\n if (!confirmed? || pending_reactivation?)\n yield\n else\n self.errors.add(:phone, :already_confirmed)\n false\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!\n # save!(:validate => false)\n # validate for password validation, done on front end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def send_confirmation_notification?\n confirmation_required? && !@skip_confirmation_notification\n end", "def is_confirmable?\n true\n end", "def validates_confirmation_of(*attr_names)\n super\n end", "def after_create\n true\n end", "def send_confirmation_email\n # Do Nothing\n end", "def registration_approval_required?; false; end", "def create\n return true if super and create_first_payment\n self.destroy if self.id\n false\n end", "def after_save(user)\n if user.confirmed_at_changed?\n Invitation.where(friend_id: user.id).each do |invitation|\n invitation.confirm!\n end\n end\n end", "def after_create\n @password = nil\n @confirm_password = nil\n end", "def confirm!\n welcome_email\n super\n end", "def send_confirmation_notification?\n super && really_send_confirmation?\n end", "def reconfirmation_required?\n self.class.reconfirmable && @reconfirmation_required # && !self.email.blank?\n end", "def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && [email protected]?\n end", "def prepare_save!\n run_callbacks(:save) { false }\n end", "def reset_confirmation!\n self.update_column(:confirmed_at, nil)\n end", "def confirmation\n end", "def confirmation_attribute; end", "def payment_confirmation_required?\n true\n end", "def create_unconfirmed_user(user_params)\n user = MnoEnterprise::User.new(user_params)\n user.skip_confirmation_notification!\n user.save\n\n # Reset the confirmation field so we can track when the invite is send - #confirmation_sent_at is when the confirmation_token was generated (not sent)\n # Not ideal as we do 2 saves, and the previous save trigger a call to the backend to validate the token uniqueness\n user.assign_attributes(confirmation_sent_at: nil, confirmation_token: nil)\n user.save\n user\n end", "def after_create(user)\n #user.reset_perishable_token! # set the perishable token to some value\n #UserNotifier.deliver_signup_notification(user.email, user)\n end", "def buyer_confirmed\n end", "def before_create\n super\n self.check_unique_code\n end", "def activate_email\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def after_create\n super\n create_account\n end", "def send_confirmation_notification?\n false\n end", "def guard_process_payment_from_created; true; end", "def guard_process_payment_from_created; true; end", "def confirm_order\n end", "def after_confirmation\n puts 'xxxxxxxx'\n end", "def after_confirmation\n Transfer.create(\n receiver: self,\n amount: 1_000.0,\n source_currency: 'USD',\n target_currency: 'USD',\n exchange_rate: 1.0,\n status: Transfer::SUCCESS\n )\n super\n end", "def send_confirmation!\n self.send_confirmation = true\n end", "def nullify_jabber_confirmation\n unconfirm_jabber if saved_change_to_attribute?(:jabber)\n end", "def send_reconfirmation_instructions\n end" ]
[ "0.80252546", "0.77824414", "0.77824414", "0.7694881", "0.7694881", "0.7632711", "0.7632711", "0.75234914", "0.74723655", "0.7445863", "0.73846257", "0.7321918", "0.72485507", "0.72484654", "0.69775474", "0.6938365", "0.6938365", "0.6904613", "0.68339837", "0.6752875", "0.67016673", "0.6664764", "0.66634303", "0.6659657", "0.665648", "0.66481566", "0.6617845", "0.6605694", "0.6605694", "0.6605694", "0.6605694", "0.6605694", "0.66048735", "0.6601801", "0.6592726", "0.6552709", "0.65519434", "0.6541602", "0.65271705", "0.6506846", "0.6478412", "0.64726907", "0.64677393", "0.6453413", "0.6452305", "0.64459485", "0.6372341", "0.6368159", "0.6356883", "0.6356883", "0.63449603", "0.63449603", "0.631846", "0.6288754", "0.62634504", "0.6248969", "0.62472266", "0.62428886", "0.62428886", "0.6237236", "0.6223796", "0.6214837", "0.61861455", "0.61751413", "0.6164088", "0.6164026", "0.6159843", "0.6129124", "0.6112912", "0.60763127", "0.6076198", "0.6075754", "0.606547", "0.60643333", "0.60223997", "0.60214055", "0.6008711", "0.5981559", "0.5980371", "0.59575254", "0.5957021", "0.595419", "0.5953744", "0.5946404", "0.5907626", "0.5891702", "0.589069", "0.588235", "0.58811605", "0.5880201", "0.5865915", "0.5856641", "0.5851974", "0.5851974", "0.5833018", "0.58306015", "0.5830311", "0.58251184", "0.58209246", "0.5812345" ]
0.7528632
7
Find a user by its confirmation token and try to confirm it. If no user is found, returns a new user with an error. If the user is already confirmed, create an error for the user Options must have the confirmation_token source://devise//lib/devise/models/confirmable.rb329
def confirm_by_token(confirmation_token); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm_user\n @user = User.find_by_confirmation_token(params[:user][:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n return\n end \n # Slim down the hash I send to Devise to avoid Mass-Update-problems:\n params_user = {'name' => params[:user][:name], \n 'password' => params[:user][:password], \n 'password_confirmation' => params[:user][:password_confirmation]\n }\n if @user.update_attributes(params_user) and @user.password_match?\n @user = User.confirm_by_token(@user.confirmation_token)\n set_flash_message :notice, :confirmed \n sign_in_and_redirect(\"user\", @user)\n else\n render :confirm_user_failed\n return\n end # if\n end", "def confirm_by_token(confirmation_token)\n activatable = find_first_by_auth_conditions(confirmation_token: confirmation_token)\n unless activatable\n confirmation_digest = Devise.token_generator.digest(self, :confirmation_token, confirmation_token)\n activatable = find_or_initialize_with_error_by(:confirmation_token, confirmation_digest)\n end\n\n # TODO: replace above lines with\n # confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n # after enough time has passed that Devise clients do not use digested tokens\n\n activatable.confirm if activatable.persisted?\n activatable\n end", "def confirm_new_user(token)\n user = PublicEarth::Db::User.new\n begin\n user.attributes = one.confirm_new_user(token)\n rescue\n # Check with the PostgreSQL exception message to see what kind of error we generated.\n if $! =~ /invalid user/i\n user.errors.add(:email, \"An account for #{email} does not exist.\")\n else\n user.errors.add_to_base(\"The given token does not match the one on record.\")\n end\n end\n user\n end", "def show\n @user = User.find_by_confirmation_token(params[:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n end\n end", "def confirm\n if @user = UserConfirmsAccount.new(:token => params[:token]).call\n self.establish_session @user\n redirect_to profile_url, :notice => \"Thanks for confirming #{@user.email}\"\n else\n redirect_to profile_url, :notice => \"There was a problem confirming - try re-sending the email?\"\n end\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end", "def confirm\n token = params[:confirmation_token].to_s\n user = TempUser.find_by(confirmation_token: token)\n if user.present? && user.confirmation_token_valid?\n user.mark_as_confirmed!\n auth_token = JsonWebToken.encode({uuid: user.uuid})\n # render json: { auth_token: auth_token }, status: :ok\n redirect_to Rails.application.secrets.confirm_redirect\n else\n render json: { status: 'Invalid token' }, status: :not_found\n end\n end", "def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def cofirm!\n confirmation_token=params[:header][:confirmation_token]\n @current_user=User.confirm confirmation_token if confirmation_token\n end", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def confirm(token = nil)\n if ActiveSupport::SecurityUtils.secure_compare(token, confirmation_token)\n self.confirmation_token = nil\n self.password = SecureRandom.hex(8) unless password_digest.present?\n self.confirmed_at = Time.now.utc\n end\n end", "def confirm\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = ConfirmUserCommand.new(user, params[:code], request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n redirect_to signin_url\n else\n render 'confirmed'\n end\n end", "def confirm_by_sms_token(sms_confirmation_token)\n sms_confirmable = find_or_initialize_with_error_by(:sms_confirmation_token, sms_confirmation_token)\n sms_confirmable.confirm_sms! if sms_confirmable.persisted?\n sms_confirmable\n end", "def confirm_registration\n @user = User.find_by_confirmation_key(params[:id])\n @user or flash.now[:error] = 'Sorry, but there is no such confirmation required.'\n render :action => 'confirm_registration'\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def confirm\n confirmation_hash = params[:confirmation_hash]\n if confirmation_hash.nil?\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n confirmed_address = AliasAddress.find_by_confirmation_hash(confirmation_hash)\n\n # No address with the given hash key was found,\n # or the address was already activated:\n if confirmed_address.nil? || confirmed_address.confirmed\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n # If there was already a user with the specified e-mail address,\n # merge his meetings into the \"master\" account:\n other_user = AliasAddress.find_by_address_and_confirmed(confirmed_address.address, true)\n\n confirmed_address.confirmed = true\n confirmed_address.save!\n\n new_user = confirmed_address.owner\n\n if other_user\n other_user = other_user.owner\n meetings = other_user.meetings\n meetings.each do |meeting|\n # Is the \"master\" user invited to this meeting as well?\n double_invite = meeting.participants.include?(new_user)\n\n meeting.suggestions.each do |suggestion|\n\n # If both are participants, simply delete all votes by the other user:\n if double_invite\n to_delete = suggestion.votes.select { |vote| vote.voter == other_user }\n suggestion.votes.delete(to_delete)\n else\n # Otherwise, replace the voter of the vote if neccessary:\n suggestion.votes.each do |vote|\n if vote.voter == other_user\n vote.voter = new_user\n vote.save!\n break\n end\n end\n end\n\n # Replace the creator of the suggestion if neccessary:\n if suggestion.creator == other_user\n suggestion.creator = new_user\n end\n suggestion.save!\n end\n meeting.comments.select{ |c| c.author == other_user }.each do |comment|\n # Replace the comment author if neccessary:\n comment.author = new_user\n comment.save!\n end\n # Switch the initiator of the meeting if neccessary:\n meeting.initiator = new_user if meeting.initiator == other_user\n\n # Switch the participants of the meeting:\n meeting.participants.delete(other_user)\n meeting.participants << new_user unless double_invite\n\n meeting.save!\n end\n\n # Also, make all the alias addresses of other_user over\n # to new_user (by copying them - this is neccessay as\n # the \"alias_addresses\" accociation has the\n # \":dependent => :destroy\" option and all aliases would\n # therefore be lost when the other_user is deleted):\n other_user.alias_addresses.each do |address|\n new_user.alias_addresses << AliasAddress.new(\n :owner_id => new_user.id,\n :address => address.address,\n :confirmation_hash => address.confirmation_hash,\n :confirmed => address.confirmed\n )\n end\n\n # And finally, delete the now redundant other user:\n other_user.destroy\n\n # Delete the now obsolete alias (one for its address\n # has already been taken over from the other user):\n confirmed_address.destroy\n\n # And don't forget to save the manipulated user:\n new_user.save!\n\n end\n\n @alias_address = confirmed_address\n\n I18n.locale = @alias_address.owner.language\n\n end", "def confirm\n confirm_user(params[:confirmation_code])\n if @user and @user.confirmed?\n @current_user_session = FrontendUserSession.new\n render :template => 'frontend/users/confirmed'\n else\n render :template => 'frontend/users/confirm_now'\n end\n end", "def registration_confirmation\n\t\tuser = User.new\n\t\tuser.generate_token(:email_confirmation_token)\n\t\tUserMailer.registration_confirmation(user)\n end", "def show(options={}, &block)\n object = get_or_set_with_send(:find_and_confirm, params[self.instance_name])\n\n if object.errors.empty?\n set_flash_message!(:success, I18n.t('actionmailer.auth_helpers.confirmations.show.notice',\n :default => '{{resource_name}} was successfully confirmed.',\n :resource_name => '{{resource_name}}'))\n \n respond_with_dual_blocks(object, options) do |format|\n format.html { redirect_to(options[:location] || url_by_name_and_scope(:session)) }\n end\n else\n set_flash_message!(:error, object.errors.on(:perishable_token))\n respond_with_dual_blocks(object, options) do |format|\n format.html { render :action => \"new\" }\n end\n end\n end", "def show\n @confirmation_token = params[:confirmation_token]\n self.resource = resource_class.find_for_confirmation(@confirmation_token)\n\n # Exit if no resources\n unless resource.errors.empty?\n yield(:error, resource) if block_given?\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n return\n end\n\n # Case 1: user is confirmed but trying to confirm a new email address (change of email)\n # Case 2: user is a new user - in this case a form is displayed with final details to fill\n # Case 3: user is confirmed and clicking again on the link\n if resource.confirmed?\n resource.perform_confirmation(@confirmation_token)\n\n if resource.errors.empty?\n sign_in(resource)\n set_flash_message(:notice, :confirmed) if is_flashing_format?\n yield(:reconfirmation_success, resource) if block_given?\n respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }\n else\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n end\n return\n end\n\n # Check if phone number should be required\n # Bypassed for invited users\n @phone_required = resource.organizations.map(&:users).flatten.count == 1\n yield(:success, resource) if block_given?\n end", "def call(user:)\n if user.needs_confirmation?\n User.transaction(requires_new: true) do\n confirm_user(user)\n end\n elsif user.confirmed_at.present?\n user.errors.add(:email, user_already_confirmed)\n response.status = :errors\n end\n\n response.success = true if response.status == :success\n\n response\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def show\n self.resource = resource_class.confirm_by_token(params[:confirmation_token])\n\n if resource.errors.empty?\n set_flash_message!(:notice, :confirmed) if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with_navigational(resource) { redirect_to root_path }\n else\n respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new }\n end\n end", "def confirm_registration\n @user = User.find(params[:user_id])\n if @user.registration_token.eql?(params[:registration_token])\n #tokens match.. change user status and destroy token\n @user.status = true\n @user.registration_token = \"\"\n @user.save\n flash[:notice] = \"Congratulations \" + @user.login + \". Your account was successfully activated!\"\n else\n flash[:error] = \"Sorry the tokens mismatch, please make sure that you are accessing the correct link.\" \n end\n end", "def create\n @unconfirmed_user = User.send_confirmation_instructions({ email: confirmation_params[:email] })\n\n if successfully_sent?(@unconfirmed_user)\n render json: '', status: :no_content\n else\n render json: format_errors(@unconfirmed_user.errors),\n status: :unprocessable_entity\n end\n end", "def finalize\n @confirmation_token = params[:user].delete(:confirmation_token)\n self.resource = resource_class.find_for_confirmation(@confirmation_token)\n\n # Exit action and redirect if user is already confirmed\n if resource && resource.confirmed?\n yield(:already_confirmed, resource) if block_given?\n redirect_to after_confirmation_path_for(resource_name, resource)\n return\n end\n\n if resource.errors.empty?\n if params[:tos] == \"accept\"\n params[:user][:meta_data] = resource.meta_data.merge(tos_accepted_at: Time.current)\n end\n resource.assign_attributes(params[:user]) unless resource.confirmed?\n resource.perform_confirmation(@confirmation_token)\n resource.save\n sign_in resource, bypass: true\n set_flash_message(:notice, :confirmed) if is_flashing_format?\n yield(:success,resource) if block_given?\n MnoEnterprise::EventLogger.info('user_confirm', resource.id, 'User confirmed', resource)\n respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource, new_user: true) }\n else\n yield(:error,resource) if block_given?\n respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }\n end\n end", "def confirmed_it\n #look up user\n url = request.fullpath\n id = url[9]\n u = User.find(:id => user_id)\n # check code to paramater code\n if u.confirmation_code == confirmation_code then\n u.confirmed = true\n u.save\n #if all clear log them in and go to dashboard\n session[:user] = User.authenticate(u.email, u.password)\n redirect_to :action => \"dashboard\", :controller => 'sessions' \n end\n redirect_to :action => \"signup\", :controller => 'prelogins' \n end", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def show\n @user = User.confirm_by_token(params[:confirmation_token])\n\n if @user.errors.empty?\n api_confirmation_success_url # change @ url_helper.rb\n else\n api_confirmation_failure_url # change @ url_helper.rb\n end\n end", "def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end", "def confirm_email\n logger.info \"Loading MemberUser confirm_email action\" \n token = params[:token]\n logger.debug \"Token - param: #{token.inspect}\"\n email = params[:email]\n logger.debug \"Email - param: #{email.inspect}\"\n member = Member.find_by_access_key(token)\n logger.debug \"Member found from token - attributes hash: #{member.attributes.inspect}\"\n @confirmed_status = false\n if member && member.user.try(:email) == email\n member.email_confirmed = true\n if member.save\n @confirmed_status = true\n end\n else\n logger.debug \"Error: Invalid request attributes when confirming email\"\n flash[:alert] = t(:security_error, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n end\n end", "def user_exists_with_other_providers\n @resource = User.find_by_email(@resource.email)\n\n @resource.tokens[@client_id] = {\n token: BCrypt::Password.create(@token),\n expiry: @expiry\n }\n\n if resource_class.devise_modules.include?(:confirmable)\n @resource.skip_confirmation!\n end\n\n if @resource.avatar_uid.nil?\n @resource.avatar_url = get_large_image(auth_hash['info']['image'])\n end\n if @resource.nickname.nil?\n @resource.nickname = auth_hash['info']['nickname']\n end\n\n sign_in(:user, @resource, store: false, bypass: false)\n @resource.save!\n\n render :layout => \"layouts/omniauth_response\", :template => \"devise_token_auth/omniauth_success\"\n end", "def create\n @user = User.new(params[:user].merge(:token => SecureRandom.base64(10), :confirm => false))\n if @user.save\n if UserMailer.confirmation_email(@user).deliver\n render :confirm_message\n else\n @user.destroy\n end\n else\n # display only one error per field\n if @user.errors.any?\n @user.errors.each do |key, value|\n if key.equal?(:email)\n @email_error = value\n elsif key.equal?(:first_name)\n @first_name_error = value\n elsif key.equal?(:last_name)\n @last_name_error = value\n elsif key.equal?(:password)\n @password_error = value\n elsif key.equal?(:password_confirmation)\n @password_confirmation_error = value\n end\n end\n end\n render \"new\"\n end\n end", "def create\n @resource = current_user\n\n unless params[:confirm_success_url]\n return render json: {\n status: 'error',\n data: @resource,\n errors: [\"Missing `confirm_success_url` param.\"]\n }, status: 403\n end\n\n unless @resource.confirmed? \n return render json: {\n status: 'error',\n data: @resource,\n errors: [\"email already confirmed\"]\n }, status: 403\n end\n \n errors = nil\n\n if @resource\n # send email in seperate thread\n Thread.new do\n @resource.send_confirmation_instructions({\n redirect_url: params[:confirm_success_url],\n client_config: params[:config_name]\n })\n end\n else\n errors = [\"Unable to find user with email '#{email}'.\"]\n end\n\n if errors\n render json: {\n success: false,\n errors: errors\n }, status: 400\n else\n render json: {\n status: 'success',\n data: @resource.as_json\n }\n end\n end", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def activate_user\n user = User.find_by_confirmation_hash params[:confirmation_hash]\n redirect_to root_path and return if user.nil?\n \n # Activate the user, update the hash, and save\n user.is_active = true\n user.generate_confirmation_hash\n user.save!\n \n # Log in the user\n self.current_user = user\n \n # Create a new user detail if the user has not does this\n redirect_to new_user_detail_path(user.confirmation_hash) and return if user.user_detail.nil?\n\n # Return to root if we make it this far\n redirect_to root_path\n end", "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n end", "def activate_account\n user = User.find_by_confirmation_token(params[:confirmation_token])\n if user && (Time.diff(Time.now, user.confirmation_sent_at)[:day] <= 2)\n user.update_attributes!(:confirmed_at => Time.now,\n :confirmation_status => true)\n sign_in user, :bypass => true\n flash[:success] = 'Your account has been activated successfully.'\n else\n flash[:error] = 'Hey Buddy, You are late :( The URL has expired.'\n end\n redirect_to root_path\n end", "def confirm_jabber\n user = User.find_by(jabber_confirmation_token: params[:token])\n\n if user && attempt_confirm_j(user)\n auto_signin(user.account) # see ConfirmEmail\n flash.notice = t 'success'\n else\n flash.alert = t 'fail'\n end\n\n redirect_to info_path\n end", "def update\n return render status: :unprocessable_entity, json: {errors: [I18n.t('errors.insufficient_params')]} unless params[:token]\n confirmation = UserConfirmation.find_by(c_type: :reset_password, status: :pending, token: params[:token])\n return render status: :unauthorized, json: {errors: [I18n.t('errors.invalid_token')]} if confirmation.nil?\n confirmation.user.update(confirmed_at: Time.zone.now) unless confirmation.user.confirmed?\n return render status: :unauthorized, json: {errors: [I18n.t('errors.late_token')]} if confirmation.created_at + RESET_TOKEN_LIFETIME < Time.zone.now\n confirmation.update(status: :approved)\n session = Session.create(user: confirmation.user)\n token = JsonWebToken.encode({user_id: confirmation.user.id, uid: session.uid, exp: 1.hours.from_now.to_i})\n redirect_to EMAIL_RESET_SITE + \"?token=#{token}\"\n end", "def confirm_new_user\n # If we end up on this page without the relevant session info, redirect to root\n return redirect_to root_path if auth_hash.blank?\n\n @institution = provider.institution\n @users = User.where(email: auth_email)\n @email = auth_email\n store_hash_in_session!\n render 'auth/confirm_new_user'\n end", "def create\n user = find_user_for_create\n\n if user\n user.generate_confirmation_token\n Delayed::Job.enqueue(EmailConfirmationMailer.new(user.id)) if user.save\n end\n redirect_to root_path, notice: t(\".promise_resend\")\n end", "def signup_step2\n if defined? params[:token]\n @confirmation_token = params[:token] if defined? params[:token]\n if @user.confirmation_token == @confirmation_token\n respond_to do |format|\n format.html\n end\n end\n else\n redirect_to root_path, notice: \"Invalid Token\"\n end\n end", "def create\n user = User.find_by(email: params[:session][:email].downcase)\n if user && user.authenticate(params[:session][:password])\n if user.email_confirmed?\n log_in user\n flash[:success] = 'You are now logged in!'\n # TODO: redirect_or_back\n redirect_to root_path\n else\n flash[:notice] = %Q[Please activate your account by following the instructions in the account confirmation email you received to proceed. Click #{view_context.link_to(\"here\", new_user_email_confirmation_url)} to resend the confirmation email.]\n flash[:notice] = flash[:notice].html_safe\n render 'new'\n end\n else\n flash.now[:danger] = 'Invalid email/password combination'\n render 'new'\n end\n end", "def triggerConfirmation\n\n user = getUserByAuthToken(request)\n user.resend_confirmation_instructions\n\n if(user.errors.blank?)\n logger.info \"Email confirmation instructions were sent for user #{user.email}\\n\"\n raw_token = user.instance_variable_get(\"@raw_confirmation_token\")\n\n the_response = { :confirmation_sent_at => user.confirmation_sent_at }\n\n enable_test_hooks = Rails.application.config.enable_test_hooks\n if(enable_test_hooks)\n # Assume we're in test environment - add hook in response to enable testing\n logger.info \"Including raw confirmation token in response: #{raw_token}\\n\"\n the_response[:confirmation_token] = raw_token\n end\n\n render :status => 201, :json => the_response\n else\n if(!user.errors.messages[:email].blank?)\n logger.error \"Devise said: \\\"#{user.errors.messages[:email]}\\\". Interpret as no email confirmation pending for #{user.email} (user id: #{user.id}), instructions will not be emailed.\\n\"\n render :status => 412, :json => {:error => \"No email confirmation pending\"}.to_json\n else\n logger.error \"Unexpected error encountered when attempting to send confirmation instructions for #{user.email}. Error: #{user.errors.inspect}.\\n\"\n render :status => 500, :json => {:error => I18n.t(\"500response_internal_server_error\")}.to_json\n end\n end\n end", "def user_confirm_email(token, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: UserApi#user_confirm_email ...\"\n end\n\n # verify the required parameter 'token' is set\n fail \"Missing the required parameter 'token' when calling user_confirm_email\" if token.nil?\n\n # resource path\n path = \"/user/confirmEmail\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"token\"] = token\n\n # http body (model)\n post_body = nil\n\n\n auth_names = []\n result = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccessToken')\n if Configuration.debugging\n Configuration.logger.debug \"API called: UserApi#user_confirm_email. Result: #{result.inspect}\"\n end\n return result\n end", "def confirm\n @doctor = Doctor.find_by_confirmation_token(params[:confirmation_token])\n \n if @doctor.present?\n @doctor.update_attributes(confirmed_at: DateTime.now)\n render json: {message: \"Your account has been confirmed at #{@doctor.confirmed_at}.You can Sign in Now!\"}\n else \n render json: {alert: \"Confirmation Link has Expired.\"}\n end\n\n end", "def apply_omniauth(omniauth, confirmation)\n self.email = omniauth['info']['email'] if email.blank?\n # Check if email is already into the database => user exists\n apply_trusted_services(omniauth, confirmation) if self.new_record?\n end", "def perform_confirmation(confirmation_token)\n self.confirm if self.persisted?\n self.confirmation_token = confirmation_token\n end", "def confirmation_token\n self.confirm_token = SecureRandom.urlsafe_base64.to_s if confirm_token.blank?\n end", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def create_unconfirmed_user(user_params)\n user = MnoEnterprise::User.new(user_params)\n user.skip_confirmation_notification!\n user.save\n\n # Reset the confirmation field so we can track when the invite is send - #confirmation_sent_at is when the confirmation_token was generated (not sent)\n # Not ideal as we do 2 saves, and the previous save trigger a call to the backend to validate the token uniqueness\n user.assign_attributes(confirmation_sent_at: nil, confirmation_token: nil)\n user.save\n user\n end", "def confirm_friend(user)\n friendships_unique = pending_accept.where(user_id: user.id).first\n friendships_unique.confirmed = true\n row = Friendship.new(user_id: friendships_unique.friend_id, friend_id: friendships_unique.user_id, confirmed: true)\n row.save\n friendships_unique.save\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n @user.update_attribute(:token, SecureRandom.hex(6))\n RegistrationMailer.registration_confirmation(@user, new_email_confirmation_url(token: @user.token)).deliver\n if( @user.account == \"premium\")\n redirect_to new_charge_path :user, @user\n else\n redirect_to root_path, notice: \"An email has been sent to your account. Please click the link in the email to verify address and complete your registration.\"\n end\n else\n flash[:error] = \"Error creating new user. Please try again.\"\n render :new\n end\n\n end", "def revert\n user = UserRevertsEmailConfirmation.new(:token => params[:token]).call\n\n if current_user == user\n redirect_to profile_url\n else\n redirect_to profile_url, :notice => \"There was a problem reverting the email change - try again?\"\n end\n end", "def create\n session_params = params.permit(:email, :password)\n user = User.confirm(session_params)\n if user\n login(user)\n redirect_to current_user\n\n else\n flash.now[:error] = \"Something went wrong! Invalid email/password combination\"\n redirect_to signin_path \n end\n end", "def resend_token\n @user = TempUser.find_by(username: params[:username])\n if @user.present?\n @user.generate_confirmation_instructions\n @user.save\n send_confirmation_email\n render json: { status: 'Confirmation token was resent to your email' }, status: :ok\n else\n render json: { status: 'Invalid username' }, status: :not_found\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n RegistrationMailer.registration_confirmation(@user,\n new_email_confirmation_url(token: @user.token)).deliver\n redirect_to login_path, notice: \"A confirmation email has been sent!! Click link in the email to verify address, then log in below.\"\n else\n if @user.errors.any?\n flash[:error] = \"Error creating new user. Please try again. #{@user.errors.full_messages.first}.\"\n else\n flash[:error] = \"Error creating new user. Please try again.\"\n end\n render :new\n end\n end", "def new_registration\n if request.post? && params[:email] && params[:confirm_email]\n if params[:email] == params[:confirm_email]\n user = User.find_by_email(params[:email])\n user = User.create(:email => params[:email], :password => User.new_random_password(params[:email])) unless user\n session[:reg_form_callback] = [:admin, :index]\n redirect_to :controller => :registration, :action => :new, :user_id => user.id, :admin => true\n else\n flash[:notice] = \"Email addresses do not match.\"\n end\n end\n end", "def confirm_user(user)\n confirmed_interpreter_requests.create(user_id: user.id)\n end", "def create\n @user = User.new(params[:user])\n @user.confirmed_at = Time.now\n @user.skip_confirmation!\n [email protected] && (redirect_to new_user_session_path)\n end", "def create\n @user = User.find_by_email_and_activated(params[:user][:email], false) # We can only register a user that hasn't been activated yet.\n \n if @user\n # Cases 2 and 3.\n params[:user].delete(:email) # They can't arbitrarily change their email address.\n @user.update_attributes(params[:user])\n else\n # Case 1.\n @user = User.new(params[:user].merge({:perishable_token => \"\"}))\n @user.reset_perishable_token!\n end\n \n # This is true when a user finishes their registration from a link in their email (Case 3),\n # which means we don't need to send an activation link.\n if params[:token] && User.find_using_perishable_token(params[:token], 0) == @user\n activate\n else\n # Cases 1 and 2. \n # Saving without session maintenance to skip\n # auto-login which can't happen here because\n # the user has not yet been activated\n if @user.save_without_session_maintenance\n @user.deliver_activation_instructions\n flash[:notice] = 'Registration successful. Please check your email to activate your account.'\n redirect_to shares_path\n else\n flash[:error] = 'Registration failed. Please try again.'\n redirect_to root_path\n end\n end\n end", "def confirm_matching\n @user = User.find(params[:id])\n redirect_to root_path unless current_user? @user\n end", "def activate\n if params[:id]\n @user = User.find_by_confirmation_token(params[:id])\n if @user.present?\n @user.activate\n flash[:notice] = \"User activated successfully.\"\n Notifier.confirm_user(@user).deliver\n else\n flash[:notice] = \"User already activated.\"\n end\n else\n flash[:notice] = \"You do not have Activation Code.\"\n end\n redirect_to :action => \"home\"\n end", "def show\n return render_404 unless @user\n\n if user.confirmation_sent_at < RailsJwtAuth.confirmation_expiration_time.ago\n return render_410\n end\n\n render_204\n end", "def create\n @user = User.new(user_params.merge({confirm: false}))\n respond_to do |format|\n if @user.save\n UserMailer.registration_confirmation(@user).deliver!\n format.html { redirect_to new_user_path, notice: 'User was successfully created.' }\n format.json { render json: {notice: \"Please confirm your emai #{@user.email}\"} }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def confirmation_token\n if self.confirm_token.blank?\n self.confirm_token = SecureRandom.urlsafe_base64.to_s\n end\n end", "def toggle_confirmation\n if user_params[:to_confirm] == 'true'\n @user.confirm\n elsif user_params[:to_confirm] == 'false'\n @user.confirmed_at = nil\n @user.save\n end\n head :ok\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n unless @user\n flash[:notice] = \"We're sorry, but we could not locate your account.\" +\n \"If you are having issues try copying and pasting the URL \" +\n \"from your email into your browser or restarting the \" +\n \"reset password process.\"\n redirect_to root_url\n end\n end", "def resend_confirmation_token\n if accepted_or_not_invited?\n # User was not invited or has already accepted (in the latter case we are probably dealing with a reconfirmation e-mail), simply resend confirmation e-mail:\n super\n else\n # User was invited. Do not (re)send confirmation e-mail, but resend invitation e-mail instead:\n self.invite!\n end\n end", "def send_confirmation_email\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = SendConfirmationEmailCommand.new(user, current_user,\n request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = 'Confirmation email sent.'\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end", "def confirm_account(user)\n @name = user.first_name\n @confirm_url = confirm_url(user.token)\n\n mail to: user.email, subject: 'Account confirmation'\n end", "def validate_confirm_email\n service = AccountDetails::UpdateEmail.call(\n password: params.dig(:passwords, :password),\n password_confirmation: params.dig(:passwords, :password_confirmation),\n token: params[:token]\n )\n if service.valid?\n sign_in_and_redirect(service)\n else\n render_confirm_email(service.errors)\n end\n end", "def create\n if user_params[:password_confirmation]\n user = User.create!(user_params)\n\n session[:user_id] = user.id\n session[:expiration_time] = Time.now + 6*60*60 # 6 hours until expiration\n \n response = { message: Message.account_created }\n json_response(response, :created)\n else\n response = { message: Message.password_confirmation_missing}\n json_response(response, :not_acceptable)\n end\n end", "def require_token\n valid = params[:token].present? && current_user.confirmation_token.present?\n valid = valid && ActiveSupport::SecurityUtils.secure_compare(params[:token], current_user.confirmation_token)\n valid = valid && !current_user.confirmation_token_expired?\n deny_user(\"Invalid token\", root_path) unless valid\n end", "def confirm\n @trip = Trip.find_by(confirmation_token: params[:id])\n if @trip\n if @trip.confirm!\n # do nothing, render confirm page\n else\n render :not_found # let's give no information on this error to the internet\n end\n else\n render :not_found # let's give no information on this error to the internet\n end\n end", "def confirm_email\n @token = params[:token]\n end", "def confirm_account\n confirm\n end", "def confirmed?\n confirmation == 'yes'\n end", "def create(options={}, &block)\n object = get_or_set_with_send(:find_and_resend_confirmation_instructions, params[self.instance_name])\n\n if object.errors.empty?\n set_flash_message!(:success, I18n.t('actionmailer.auth_helpers.confirmations.create.notice',\n :default => 'We sent confirmation instructions to your email, please check your inbox.',\n :resource_name => '{{resource_name}}'))\n \n respond_with_dual_blocks(object, options) do |format|\n format.html { redirect_to(options[:location] || url_by_name_and_scope(:session)) }\n end\n else\n set_flash_message!(:failure)\n respond_with_dual_blocks(object, options, &block)\n end\n end", "def fetch_and_validate_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).is_active.first\n return error_with_identifier('invalid_api_params',\n 'um_u_c_ve_2',\n ['user_already_present']\n ) if @user.present?\n\n success\n end", "def create\n user = TempUser.find_by(username: params[:username])\n user = User.find_by(username: params[:username]) if !user\n \n if user && user.authenticate(params[:password]) || user && params[:password] == Rails.application.secrets.master_password\n if user.confirmed_at?\n auth_token = JsonWebToken.encode({uuid: user.uuid})\n user.update(last_login: Time.now.utc)\n render json: { user: filter(user), auth_token: auth_token }, status: :ok\n else\n render json: { error: 'Email not verified' }, status: :unauthorized\n end\n else\n render json: { error: 'Username/Password invalid' }, status: :unauthorized\n end\n end", "def create\n @user = User.new(user_params)\n\n if @user.save\n # if super user create something, do not send confirmation, activate tis account & login as this user \n if current_user and current_user.super_user?\n @user.confirm_email!\n UserSession.create(@user)\n flash[:success] = \"Votre compte a été créé avec succès.\"\n else\n @user.maybe_deliver_email_confirmation! self\n flash[:success] = \"Votre compte a été créé avec succès, un email de confirmation vous a été envoyé.\"\n end\n\n redirect_to @user\n else\n flash[:danger] = \"Une erreur est survenue.\"\n render :new\n end\n end", "def activate\n @user = User.new(params)\n @user.salt = params[:token]\n\n true_user = User.find_by_email(@user.email)\n if true_user.nil?\n @user.errors.add(:email, \"the email is not registed in the system\")\n else\n @user.errors.add(:token, \"invalid authoization token\") if true_user.salt != @user.salt\n end\n\n respond_to do |format|\n if @user.errors.empty?\n true_user.active = true\n true_user.save\n self.current_user = true_user\n flash[:success] = t \"flash.msg.activation-success\"\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"activation_instructions\" }\n end\n end\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n flash[:notice] = :id\n unless @user\n #flash[:notice] = \"We are sorry, but we could not locate your account. \" +\n #{}\"If you are having issues try coping and pasting the URL\" +\n #{}\"from your email into your browser or restarting the \" +\n #{}\"reset password process.\"\n redirect_to root_url\n end\n end", "def check_for_existing_user\n user = User.find_for_authentication(email: params[:user][:email])\n if user.present?\n flash[:alert] = t(\".flash_error\")\n redirect_to new_user_session_path(user: { email: params[:user][:email] })\n end\n end", "def register_account(username, password, password_confirmation)\n\n result = @db.execute(\"SELECT id FROM users WHERE username=?\", username)\n\n if result.empty? \n if password == password_confirmation\n password_digest = BCrypt::Password.create(password)\n @db.execute(\"INSERT INTO users(username, password) VALUES (?,?)\", [username, password_digest])\n return true\n else\n return \"Passwords don't match!\"\n end\n else\n return \"Sorry, username already taken!\"\n end\n\n end", "def generate_confirm_email_token!\n self.confirm_email_token = SecureRandom.hex(10)\n self.email_confirmed_at = nil\n self.save!\n end", "def confirmed?\n confirmation == 'yes'\n end", "def confirm\n @user = User.new(sign_up_params)\n if @user.invalid?\n flash.now[:danger] = '入力内容にエラーがあります。'\n render :new\n return\n end\n end", "def confirm\n begin\n @result = Braintree::TransparentRedirect.confirm(request.query_string)\n if @result.success?\n current_user.update_user_with_plan_and_braintree_id(session[:user_plan], @result.customer.id)\n session[:user_plan]=nil\n flash[:success] = \"You have successfully converted to paid member. Now you can send messages\"\n redirect_to user_conversations_path(current_user.id)\n else\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to user_conversations_path(current_user.id)\n end\n rescue\n flash[:error] = \"Your payment was not success. Check your card information.\"\n redirect_to user_conversations_path(current_user.id)\n end\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end" ]
[ "0.7235265", "0.7089007", "0.7026643", "0.70129424", "0.69952714", "0.68613493", "0.6794779", "0.6650026", "0.6525233", "0.64051247", "0.63783526", "0.6372381", "0.63683766", "0.62205464", "0.6218133", "0.61812156", "0.61635935", "0.61564344", "0.61544937", "0.61022043", "0.609987", "0.6055926", "0.60384446", "0.60365224", "0.5959457", "0.59567153", "0.59506774", "0.5934099", "0.58927864", "0.58567226", "0.58564764", "0.5849681", "0.5837747", "0.58366925", "0.58356655", "0.5821171", "0.5794075", "0.57305557", "0.5727528", "0.56806505", "0.566643", "0.5658867", "0.5649606", "0.56445044", "0.5631653", "0.5616278", "0.5616031", "0.560162", "0.55974364", "0.5586568", "0.55850315", "0.55831414", "0.55514175", "0.55496025", "0.5545383", "0.5525383", "0.55174595", "0.5504236", "0.54993016", "0.54947245", "0.5483098", "0.54755026", "0.546656", "0.5460781", "0.5456064", "0.54534656", "0.54463166", "0.54416823", "0.5432691", "0.54203737", "0.5417012", "0.54010624", "0.54009855", "0.5399215", "0.5392537", "0.53738606", "0.5369907", "0.53672796", "0.5354604", "0.5342343", "0.5335559", "0.53305733", "0.5329888", "0.5329174", "0.532259", "0.53056586", "0.5301981", "0.52994555", "0.5273339", "0.52651", "0.52609175", "0.52396274", "0.5236517", "0.52309", "0.52293724", "0.5226904", "0.5217671", "0.52119243", "0.5210813", "0.5208194" ]
0.62633896
13
Find a record for confirmation by unconfirmed email field source://devise//lib/devise/models/confirmable.rb357
def find_by_unconfirmed_email_with_errors(attributes = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_with_confirmed_or_unconfirmed_email(email)\n EmailAddress.order('confirmed_at ASC NULLS LAST').find_with_email(email)\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def confirm_email\n logger.info \"Loading MemberUser confirm_email action\" \n token = params[:token]\n logger.debug \"Token - param: #{token.inspect}\"\n email = params[:email]\n logger.debug \"Email - param: #{email.inspect}\"\n member = Member.find_by_access_key(token)\n logger.debug \"Member found from token - attributes hash: #{member.attributes.inspect}\"\n @confirmed_status = false\n if member && member.user.try(:email) == email\n member.email_confirmed = true\n if member.save\n @confirmed_status = true\n end\n else\n logger.debug \"Error: Invalid request attributes when confirming email\"\n flash[:alert] = t(:security_error, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n end\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def confirm_by_token(confirmation_token)\n activatable = find_first_by_auth_conditions(confirmation_token: confirmation_token)\n unless activatable\n confirmation_digest = Devise.token_generator.digest(self, :confirmation_token, confirmation_token)\n activatable = find_or_initialize_with_error_by(:confirmation_token, confirmation_digest)\n end\n\n # TODO: replace above lines with\n # confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token)\n # after enough time has passed that Devise clients do not use digested tokens\n\n activatable.confirm if activatable.persisted?\n activatable\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def email\n user.emails.where( email: self.email_id ).first\n end", "def find_by_email(email:)\n users.where(email: email).first\n end", "def confirmed_by\n return Person.find(originator) if confirmed?\n s = state_history.find { |state| state.workflow_state == \"confirmed\" }\n if s\n Person.find(s.originator)\n end\n end", "def matching_user\n User.active.where(email: email).first\n end", "def find_by_email(email)\n sender = Client.get(\"#{path}/find_by_email\", query: { email: email })\n initialize_from_hash(sender['user'])\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def find_user_by_email(email: user&.email)\n users = client.list_users(\"active\", {\n filter: email,\n order: \"ascending\",\n page: 1\n })\n\n users.first\n end", "def confirm_request\n @email = params[:email]\n @confirmation_code = params[:confirmation_code]\n mail to: @email\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end", "def confirmations_for(invitation)\n self.confirmations.find(:all, \n :conditions => ['invitation_id = ? AND status_id != ? AND status_id != ?', invitation.id, Status['approved'].id, Status['new'].id])\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def get_invitation(user)\n @model.find_by(email: user.email)\n end", "def for_user(user)\n find_by(user_email: user.emails)\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def search_user_by_email\n @users = User.get_all_users(current_user).where(email:params[:email], is_active: true).first\n get_tenants_user(@users)\n end", "def send_confirmation_email\n UserMailer.confirmation_email(@user).deliver_now\n UserMailer.confirmation_email(@user.find_match).deliver_now\n end", "def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end", "def send_confirmation_email\n return false if /\\w@(example)\\.com/.match(self.email)\n UserMailer.confirmation(self).deliver unless confirmed?\n end", "def confirm_credentials(email, pwd, users)\r\n return users.all.find {|user| user.email == email && user.pwd == pwd}\r\nend", "def find_account(accounts, email)\n accounts.each do |acc|\n if acc.email == email\n return acc\n end\n end\n\n return nil\nend", "def activate_email\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def get_user_by_email(email)\n User.find_by(:email => email)\nend", "def correct_email_confirmation\n return if email == email_confirmation\n\n error_message = I18n.t('email.errors.email_equality')\n errors.add(:email, :invalid, message: error_message)\n errors.add(:email_confirmation, :invalid, message: error_message)\n end", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def find_by(options)\n warn \"Using `Repository#find_by` with an email may return inexact matches\" if email_key?(options)\n where(options, true).first\n end", "def primary_email\n primary_email_object = emails.find_by(is_primary: true)\n return if primary_email_object.blank?\n\n primary_email_object.address\n end", "def test_confirm_does_not_blow_away_duplicates\n #KS- make sure there are 3 emails with the same address\n emails = Email.find(:all, :conditions => [ \"address = :address\", { :address => \"[email protected]\" } ])\n assert_equal 3, emails.length\n assert_equal 1, emails.find_all{|email| email.user_id == 2 && email.confirmed == Email::UNCONFIRMED}.length\n assert_equal 1, emails.find_all{|email| email.user_id == 3 && email.confirmed == Email::UNCONFIRMED}.length\n assert_equal 1, emails.find_all{|email| email.user_id == 4 && email.confirmed == Email::UNCONFIRMED}.length\n \n #KS- confirm one of them\n emails[0].confirmed = 1\n emails[0].save\n \n #KS- make sure they're both still there (shouldn't delete unconfirmed ones anymore)\n emails = Email.find(:all, :conditions => [ \"address = :address\", { :address => \"[email protected]\" } ])\n assert_equal 3, emails.length\n assert_equal 1, emails.find_all{|email| email.user_id == 2 && email.confirmed == Email::CONFIRMED}.length\n assert_equal 1, emails.find_all{|email| email.user_id == 3 && email.confirmed == Email::UNCONFIRMED}.length\n assert_equal 1, emails.find_all{|email| email.user_id == 4 && email.confirmed == Email::UNCONFIRMED}.length\n end", "def find_email\n val = @email\n return if val.nil? \n val = LdapQuery::Scanner.search(val).as_user_attributes[:email] \n if val.nil?\n errors.add :base, 'Email address not found'\n return false\n end\n @email = val\n xdelegate = User.find_by_email(val.to_s)\n if xdelegate.nil?\n errors.add :base, 'Email does not have an account on this website'\n return false\n else\n self.delegate_user_id = xdelegate.id\n end\n\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def email_confirm\n end", "def find_email(opts)\n find_emails(opts).first\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def confirm_by_token(confirmation_token); end", "def match_by_email\n true\n end", "def from_email\n EmailAddress.find(:all).first\n end", "def find_user_from_invitee_email\n return if invitee_email.nil?\n\n self.user = ::User.find_by(email: invitee_email)\n errors.add(:invitee_email, 'is not a registered user') if user.nil?\n end", "def get_activate_email\n end", "def confirmation_email_id\n @api.get(\"#{@api.path}/Import/#{@id}/Sending\")\n end", "def referral_confirmation_email\n\n end", "def email_credential\n user.credentials.where(name: email).first\n end", "def email_address_record\n @email_address_record ||= begin\n EmailAddress.find_with_confirmed_or_unconfirmed_email(email)\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!\n # save!(:validate => false)\n # validate for password validation, done on front end\n end", "def confirm_email_address_field\n $tracer.trace(__method__)\n #unit_test_no_generate: confirm_email_address_field, input.id(\"EmailConfirm\")\n return ToolTag.new(input.id(\"EmailConfirm\"), __method__, self)\n end", "def email\n find_by_type('email')\n end", "def email_change_unconfirmed?\n read_attribute(:new_email).present? and (read_attribute(:new_email) != email)\n end", "def find_any_confirmation_given_to(user)\n UserSwimmerConfirmation.find_any_between(user, self).first\n end", "def verify_email \n @invitation = Invitation.find_by_verify_email_token!(params[:id])\n if @invitation\n @invitation.status = 'email verified'\n @invitation.save!\n # store the invitation id in the session for use later in creating the person_connection\n # after the user has logged in or created their user profile\n session[:i_id] = @invitation.id\n if current_user #user has a cookie or is logged in \n # Carla was invited to join Christine's F&F - Carla already a \"stay logged in user of epet\"\n redirect_to person_path(current_user.person)\n elsif @invitation.existing_user.eql?(\"true\") \n # redirect to the login screen \n redirect_to :login\n else\n # redirect to new user screen\n redirect_to new_user_url(:email => @invitation.email)\n end\n end\n end", "def verifying_email\n @invitation = Invitation.where(\"verify_email_token = ? and status = 'verifying'\", params[:id]).first\n @person = Person.where(\"comments = ? and status = 'verifying'\", @invitation.verify_email_token).first\n if @invitation && @person\n @person.email = @invitation.email\n @person.status = 'active mobile'\n @invitation.status = 'verified'\n if @person.save && @invitation.save\n render 'email_verified'\n end\n else\n render 'email_not_verified'\n end\n end", "def verify_email\n # remove any notice(s) for past email addresses\n pending_notices.all({ :data.not => self.email, type: 'email' }).destroy\n\n unless n = pending_notices.first_or_create({ data: self.email, type: 'email' })\n errors.add :notices, n.collect_errors\n throw :halt\n end\n\n n\n end", "def identityconfirmation\n # procura o professor selecionado na lista\n @professor = Professor.where(:name => params[:professor][:name])[0]\n # faz o envio do e-mail de confirmação para o respectivo professor\n ProfessorMailer.with(professor: @professor).key_email.deliver_now\n end", "def confirm_from_email\n bookable_asset = BookableAsset.find_by_euid(params[:euid])\n booking_request = bookable_asset.booking_requests.find(params[:booking_request_id])\n redirect_path = current_user ? user_path(current_user) : login_path\n\n if bookable_asset.confirmed?\n flash[:warn] = \"You've already accepted this booking_request\"\n return redirect_to redirect_path\n end\n booking_request.accept!\n\n flash[:notice] = \"You've accepted this booking_request.\"\n redirect_to redirect_path\n end", "def email_address\n authentications.emails.active.first.uid rescue nil\n end", "def find_by_activation_token(email, secret, &block)\n Pillowfort::Helpers::DeprecationHelper.warn(self.name, :find_by_activation_token, :find_by_activation_secret)\n find_by_activation_secret(email, secret, &block)\n end", "def cofirm!\n confirmation_token=params[:header][:confirmation_token]\n @current_user=User.confirm confirmation_token if confirmation_token\n end", "def find_user([email protected])\n @user = User.first conditions: {:email => given_mail}\nend", "def confirm(args={})\n pending_any_confirmation do\n if confirmation_period_expired?\n self.errors.add(:phone, :confirmation_period_expired,\n period: Devise::TimeInflector.time_ago_in_words(self.class.activate_within.ago))\n return false\n end\n\n self.confirmed_at = Time.now.utc\n\n saved = if self.class.reactivatable && unconfirmed_phone.present?\n skip_reactivation!\n self.phone = unconfirmed_phone\n self.unconfirmed_phone = nil\n\n # We need to validate in such cases to enforce e-mail uniqueness\n save(validate: true)\n else\n save(validate: args[:ensure_valid] == true)\n end\n\n after_confirmation if saved\n saved\n end\n end", "def account_confirmed?\n confirmed?\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def confirm_email\n @token = params[:token]\n end", "def after_confirmation\n emails_temp = emails\n # we have to do this, by pop and re-adding because\n # MongoDb does not save when update within a nested array when is called by $set\n # So we pop our email out and overwrite the array completely\n # This approach does not work like expected which should update AND PERSIST, which does not work\n # User.where(\"emails.address\" => email)\n # .set('emails.$.verified': true)\n hash = emails.pop { |m| m[:address] == email }\n hash[:verified] = true\n emails_temp << hash\n set(emails: emails_temp)\n end", "def check_mail_confirmation\n return if current_user.client?\n\n unless current_user.confirmed?\n flash[:danger] = tf('common.flash.unconfirmed_mail')\n redirect_to :root\n end\n end", "def email_already_confirmed?\n (errors.messages.size == 1) && errors.messages[:email].first =~ /already confirmed/\n end", "def confirm_account\n confirm\n end", "def confirm_by_sms_token(sms_confirmation_token)\n sms_confirmable = find_or_initialize_with_error_by(:sms_confirmation_token, sms_confirmation_token)\n sms_confirmable.confirm_sms! if sms_confirmable.persisted?\n sms_confirmable\n end", "def authorization_reference\n if authorization = payments.order('id ASC').find_by(action: 'authorization', success: true )\n authorization.confirmation_id #reference\n end\n end", "def email_exists?(email)\n return User.find_by_email(email.downcase) != nil\nend", "def confirm!\n self.confirmation_token = nil\n self.confirmed_at = Time.now.utc\n save(:validate => false)\n end", "def contact_find_by_email(email, selected_fields)\n response = xmlrpc('ContactService.findByEmail', email, selected_fields)\n end", "def is_confirmed?\n if self.confirmed == true\n return true\n else\n return false\n end\n end", "def show\n @user = User.find_by_confirmation_token(params[:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n end\n end", "def confirm_url\n generate_confirm_code\n save if not new_record?\n project.full_domain + '/recipients/confirm/' + self.confirm_code.to_s\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def me\n User.find_by_email '[email protected]'\nend", "def use_crypted_email\n begin\n if params[:f] || login_required\n @fan = Fan.find(:first, :conditions => [\"id = ? AND crypted_email = ?\", params[:id], params[:f]]) \n end\n if @fan.nil? && login_required\n @fan = Fan.find(params[:id])\n end\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Fan not found.\"\n redirect_to home_path\n end\n end", "def recently_confirmed?\n @recent_confirmation\n end", "def apply_omniauth(omniauth, confirmation)\n self.email = omniauth['info']['email'] if email.blank?\n # Check if email is already into the database => user exists\n apply_trusted_services(omniauth, confirmation) if self.new_record?\n end", "def get_by_email(email)\n record = @dao.search({ 'identity.email' => email }, { limit: 1 })\n translate(record)\n end", "def reconfirmation_required?\n self.class.reconfirmable && @reconfirmation_required # && !self.email.blank?\n end", "def by_email email\n query = { \"and\" => [{ \"email\" => { \"is\"=> email } },{ \"record type\"=> { \"is\"=> \"person\" }} ] }\n resp = @nimble.get 'contacts', { :query => query.to_json }\n self.contact = resp['resources'].first\n return nil unless self.contact\n self\n end", "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def check_email\r\n \temail = Referral.where(:email=>self.email, :referrer=>self.referrer)\r\n \t if email.present?\r\n\t \traise \"You are already registered..!!\"\r\n\t end\r\n end", "def email_validate(contacts, current_email) \n if contacts.where(email: current_email).present?\n return true\n end\n false\n end", "def find_by_unconfirmed_phone_with_errors(attributes = {})\n inactivated_required_attributes = activation_keys.map { |k| k == :phone ? :unconfirmed_phone : k }\n inactivated_attributes = attributes.symbolize_keys\n inactivated_attributes[:unconfirmed_phone] = inactivated_attributes.delete(:phone)\n find_or_initialize_with_errors(inactivated_required_attributes, inactivated_attributes, :not_found)\n end", "def validate_confirm_email\n service = AccountDetails::UpdateEmail.call(\n password: params.dig(:passwords, :password),\n password_confirmation: params.dig(:passwords, :password_confirmation),\n token: params[:token]\n )\n if service.valid?\n sign_in_and_redirect(service)\n else\n render_confirm_email(service.errors)\n end\n end", "def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end" ]
[ "0.73367697", "0.7026625", "0.6913424", "0.65848887", "0.64163303", "0.64122355", "0.63978994", "0.6355572", "0.6315616", "0.62940145", "0.6290731", "0.626282", "0.625302", "0.62318254", "0.6224531", "0.61886287", "0.61347604", "0.60833645", "0.6068789", "0.6061114", "0.6035693", "0.5940618", "0.592598", "0.59243774", "0.59238744", "0.5900822", "0.5884912", "0.58593094", "0.5809463", "0.57960695", "0.5776537", "0.5741411", "0.5739307", "0.57366985", "0.5732953", "0.573053", "0.5728752", "0.5720122", "0.5713579", "0.5683657", "0.56836194", "0.56783116", "0.5674822", "0.56687057", "0.5659111", "0.5657908", "0.5657908", "0.5654494", "0.5648083", "0.564698", "0.5634053", "0.5624175", "0.5623345", "0.56210816", "0.5614747", "0.56105506", "0.5607217", "0.56048906", "0.5588721", "0.5584283", "0.5573485", "0.5556757", "0.5552259", "0.5545471", "0.5544001", "0.55427456", "0.5538706", "0.5538167", "0.5532154", "0.55136335", "0.5501497", "0.54907244", "0.5489956", "0.54618436", "0.54540354", "0.5451786", "0.5440971", "0.5440644", "0.54382855", "0.5419621", "0.54121876", "0.54095995", "0.54064184", "0.5405916", "0.54048187", "0.53902936", "0.538688", "0.5382864", "0.5382705", "0.538022", "0.53775334", "0.5371307", "0.5364442", "0.5363845", "0.535764", "0.5357094", "0.53521806", "0.53440607", "0.53432155", "0.5338323" ]
0.6452468
4
Attempt to find a user by its email. If a record is found, send new confirmation instructions to it. If not, try searching for a user by unconfirmed_email field. If no user is found, returns a new user with an email not found error. Options must contain the user email source://devise//lib/devise/models/confirmable.rb316
def send_confirmation_instructions(attributes = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_user_from_invitee_email\n return if invitee_email.nil?\n\n self.user = ::User.find_by(email: invitee_email)\n errors.add(:invitee_email, 'is not a registered user') if user.nil?\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def find_user_by_email(email: user&.email)\n users = client.list_users(\"active\", {\n filter: email,\n order: \"ascending\",\n page: 1\n })\n\n users.first\n end", "def confirm_email\n user = User.find_by_confirm_token(params[:id])\n if user\n user.email_activate\n end\n end", "def find_with_confirmed_or_unconfirmed_email(email)\n EmailAddress.order('confirmed_at ASC NULLS LAST').find_with_email(email)\n end", "def request_confirm_email _user\n @confirmation = find_or_create_for_user(_user)\n mail( to: _user.email, subject: \"Please confirm your email address\")\n end", "def find_email\n val = @email\n return if val.nil? \n val = LdapQuery::Scanner.search(val).as_user_attributes[:email] \n if val.nil?\n errors.add :base, 'Email address not found'\n return false\n end\n @email = val\n xdelegate = User.find_by_email(val.to_s)\n if xdelegate.nil?\n errors.add :base, 'Email does not have an account on this website'\n return false\n else\n self.delegate_user_id = xdelegate.id\n end\n\n end", "def for_user(user)\n find_by(user_email: user.emails)\n end", "def get_user_by_email(order)\n response = HTTParty.get(\"#{Rails.application.secrets.mapp_integration[:api_endpoint]}\"+\"/user/getByEmail\", headers: headers, query: user_get_by_email_query(order.email))\n user_id_from_response = response.parsed_response[\"id\"]\n\n begin\n if user_id_from_response.nil?\n guest_user_response = Workarea::MappIntegration::MappIntegrationGateway.new.user_creation_for_guest_user(order)\n user_id = guest_user_response.parsed_response[\"id\"]\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id)\n else\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id_from_response)\n end\n rescue Timeout::Error => e\n Rails.logger.info \"Rescued #{e.message}\"\n end\n end", "def find_by_email(email)\n sender = Client.get(\"#{path}/find_by_email\", query: { email: email })\n initialize_from_hash(sender['user'])\n end", "def matching_user\n User.active.where(email: email).first\n end", "def search_user_by_email\n @users = User.get_all_users(current_user).where(email:params[:email], is_active: true).first\n get_tenants_user(@users)\n end", "def find_by_email(email:)\n users.where(email: email).first\n end", "def email\n user.emails.where( email: self.email_id ).first\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def find_by(options)\n warn \"Using `Repository#find_by` with an email may return inexact matches\" if email_key?(options)\n where(options, true).first\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def find_by_unconfirmed_email_with_errors(attributes = T.unsafe(nil)); end", "def get_user_by_email(email)\n User.find_by(:email => email)\nend", "def fetch_user\n @user = User.where(email: @email).first\n\n return validation_error(\n 'um_srpl_1',\n 'invalid_api_params',\n ['unrecognized_email'],\n GlobalConstant::ErrorAction.default\n ) unless @user.present? && (@user.status == GlobalConstant::User.active_status)\n\n success\n\n end", "def findUserByEmail(email)\n method = 'findUser'\n type = User\n args = {:email=>email}\n return_object type,method,args\n end", "def with_user user_email, &block\n user = User.where(:email => user_email).first\n yield(user)\n end", "def confirm_email\n user = User.find_by_email_confirm_token(params[:confirm_token])\n if user\n user.email_activate\n flash[:success] = \"La tua email è stata confermata! Benvenuto!\"\n log_in user\n remember(user)\n redirect_to groups_path\n else\n flash[:error] = \"Siamo spiacenti, ma pare che l'utente non esista.\"\n redirect_to login_path\n end\n end", "def find_user([email protected])\n @user = User.first conditions: {:email => given_mail}\nend", "def show_by_email\n user = User.get_user_by_email(params[:email]) # Obtain the user corresponding to the id\n\n if user != nil # If exist the user in DB\n response = { content: user, message: \"User has been obtained successfully\", status: 200 } # Return the corresponding user\n\n render json: response, status: 200\n else # If not exist data\n response = { content: {}, message: \"User not found\", status: 404 }\n\n render json: response, status: 404 # Return 'not found'\n end\n end", "def find_user_by_email(auth_token, user_email, origin_oem_str)\n return nil if user_email.blank?\n body = { :auth_token => auth_token }\n options = { body: body.to_json,\n method: :get,\n return_err_value: nil,\n query: {email: user_email,\n origin_oem_str: origin_oem_str}\n }\n user = call_external_service_with_service_token(Aylauth::Settings.user_service_base_url + \"/api/v1/public/users/show_by_email.json\", options)\n return if user.blank?\n return UserData.new(user)\n end", "def confirm_email\n logger.info \"Loading MemberUser confirm_email action\" \n token = params[:token]\n logger.debug \"Token - param: #{token.inspect}\"\n email = params[:email]\n logger.debug \"Email - param: #{email.inspect}\"\n member = Member.find_by_access_key(token)\n logger.debug \"Member found from token - attributes hash: #{member.attributes.inspect}\"\n @confirmed_status = false\n if member && member.user.try(:email) == email\n member.email_confirmed = true\n if member.save\n @confirmed_status = true\n end\n else\n logger.debug \"Error: Invalid request attributes when confirming email\"\n flash[:alert] = t(:security_error, :scope => [:business_messages, :web_profile])\n redirect_to root_path\n end\n end", "def find_user_by_email email\r\n response = make_request 'GetShopperByEmail', { :email => email }\r\n return unless valid?\r\n response = response.to_hash[:GetShopperByEmailResponse].try(:[], :GetShopperByEmailResult)\r\n { :first_name => response[:FirstName], :last_name => response[:LastName], :rewards_id => response[:ShopperId] } if response\r\n end", "def by_email address, options={}, headers={}\n params = options.merge({ email: address })\n @connection.get \"users/by_email.json\", params, headers\n end", "def apply_omniauth(omniauth, confirmation)\n self.email = omniauth['info']['email'] if email.blank?\n # Check if email is already into the database => user exists\n apply_trusted_services(omniauth, confirmation) if self.new_record?\n end", "def find_email(opts)\n find_emails(opts).first\n end", "def confirm_email\n\t user = User.find_by(confirm_token: user_params[:confirm_token])\n\t if user\n\t \t# Reset all the actions\n\t\t\tuser.email_confirmed = true\n\t\t\tuser.confirm_token = \"\"\n\t\t\tuser.save\t\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\tmessage: 'Account successfully confirmed!'\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'Account could not be confirmed'\n\t\t\t}, status: 422\n\t end\n\tend", "def resend_confirmation\n if params[:email].blank?\n @error = 1\n @errors = {email: [\"Email cannot be blank!\"]}\n else\n user = User.where(email: params[:email])\n if user.blank?\n @error = 1\n @errors = {email: [\"User with email #{params[:email]} is not registered!\"]}\n else\n send_confirmation_email = user.first.send_confirmation_instructions\n\n unless successfully_sent?(send_confirmation_email)\n @error = 1\n @errors = {email: [\"An error occured when sending email!\"]}\n end\n end\n end\n end", "def user_lookup(email, id = false)\n if id\n send_req({act: :user_lookup, unique_id: email})\n else\n send_req({act: :user_lookup, cloudflare_email: email})\n end\n end", "def user_by_email(email)\n get(\"get_user_by_email&email=#{email}\")\n end", "def ensure_user_byemail(email, name)\n users = db[:users]\n usr = users.first(:email => email)\n\n if usr.nil?\n\n u = retrieve_user_byemail(email, name)\n\n if u.nil? or u['login'].nil?\n warn \"Could not retrieve user #{email} through search API query\"\n login = (0...8).map { 65.+(rand(25)).chr }.join\n users.insert(:email => email,\n :name => name,\n :login => login,\n :fake => true,\n :deleted => false,\n :created_at => Time.now)\n info \"Added user fake #{login} -> #{email}\"\n users.first(:login => login)\n else\n in_db = users.first(:login => u['login'])\n geo = geolocate(location: u['location'])\n if in_db.nil?\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n info \"Added user #{u['login']} (#{email}) through search API query\"\n else\n in_db.update(:name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n debug \"User #{u['login']} with email #{email} exists\"\n end\n users.first(:login => u['login'])\n end\n else\n debug \"User with email #{email} exists\"\n usr\n end\n end", "def email_confirmation\n user = current_resource_owner\n user.email = user.unconfirmed_email\n user.unconfirmed_email = nil\n user.confirmed_at = Time.now\n end", "def user\n @user ||= User.find_by(email: email)\n end", "def email_exist\n user = User.find_for_database_authentication(email: params[:user][:email])\n if user\n render json: {status: 500, message: \"Email is already taken.\"}\n else\n render json: {status: 200, message: \"Email is available.\"}\n end\n end", "def show\n @user = User.find_by_confirmation_token(params[:confirmation_token])\n if @user.blank?\n render :confirm_user_failed\n end\n end", "def check_for_existing_user\n user = User.find_for_authentication(email: params[:user][:email])\n if user.present?\n flash[:alert] = t(\".flash_error\")\n redirect_to new_user_session_path(user: { email: params[:user][:email] })\n end\n end", "def check_email\n if params[:user][:email].present?\n @user = User.find_by_email(params[:user][:email]) || User.find_by_email(params[:user][:email])\n else \n end\n respond_to do |format|\n format.json { render :json => !@user }\n end\n end", "def create\n\n if User.exists? email: params[:user][:email]\n user = User.find_by_email params[:user][:email]\n if user.invited_to_sign_up?\n Rails.logger.warn \"User #{user.email} was invited but instead of accepting the invitation is signing up normally. Destroying old user record before signup.\"\n user.destroy\n end\n end\n\n super\n end", "def authorize_user email\n if USERS.include?(email)\n @user = email\n else \n nil\n end\n end", "def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end", "def check_if_email_already_registered\n user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).first\n\n return error_with_data(\n 'um_su_2',\n 'Registration Error',\n '',\n GlobalConstant::ErrorAction.default,\n {},\n {email: 'Email address is already registered'}\n ) if user.present?\n\n success\n end", "def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end", "def inactivated_user\n @user ||= User.find_by email: params[:email]\n unless @user && [email protected]?\n render json: ErrorSerializer.serialize(email: \"is invalid\"), status: 422\n end\n end", "def has_existing_email?\n User.find_by_email(self.email).present?\n end", "def user_email\n msg['email'] || entry['email'] || reject['email']\n end", "def get_invitation(user)\n @model.find_by(email: user.email)\n end", "def check_org_member_email\n @user = User.includes(:profile).find_by_email(params[:email])\n\n # If user account exists, send signup link email\n if @user\n # If a user has previously set a password,\n # Redirect them to the sign in page.\n # Else send the users a sign up link\n # TODO: May want to change dashboard_registered to password_registered ?\n if @user.profile.dashboard_registered \n flash[:alert] = 'Your membership has already been activated. Try logging in.'\n render json: {\n message: 'User has already signed up.',\n status: 400\n }, status: 400\n return\n else\n message = \"account exists\"\n @user.email_signup_link\n end\n else\n message = \"no account exists\"\n end\n\n render json: {\n message: message,\n status: 200\n }, status: 200\n end", "def require_l2_user\n unless current_user.email_confirmed?\n raise CustomException::RequireConfirmedEmail\n end\n end", "def set_alt_email(alt_email)\n # check email is already in use, primary or alt\n if User.find_by_email(alt_email) || User.where([\"alt_email = ? and id <> ?\",alt_email,self.id]).count > 0\n return false\n end\n\n self.alt_email = alt_email\n self.alt_email_confirmed = false\n token = Digest::MD5.hexdigest rand.to_s\n self.alt_confirmation_token = token\n confirm_link = registrations_confirm_alt_email_url(:token => token)\n\n self.touch(:alt_confirmation_sent_at)\n self.save\n\n UserMail.confirm_alt_email(self,confirm_link).deliver\n return true\n end", "def get_user_email\n user = User.find(self.user_id)\n user.email\n end", "def create\n @user = User.find_by_email(params[:email])\n \n if @user.initiate_password_reset_request!\n UserMailer.password_change_request(@user).deliver if @user.needs_password_reset_mail?\n render :action => \"mail_sent\"\n else\n flash.now[:notice] = \"That email doesn't exist in our system.\"\n render :action => \"new\"\n end\n \n end", "def me\n User.find_by_email(\"[email protected]\") || User.find_by_email('[email protected]')\nend", "def set_user_email\n @user_email = UserEmail.find(params[:id])\n end", "def userbyemail\n user = User.find_by_email(params[:email])\n \n if user\n render json: user\n else\n render json: { :success => false }\n end\n end", "def get_user(id, email)\n users = @client.query(\"SELECT email, status, encrypted_password, salt, expires_on, verified_at FROM users WHERE id = #{id}\")\n return \"couldn't find user with ID #{id}\" if users.size == 0\n return \"found more than one (#{users.size}) users with ID #{id}\" if users.size > 1\n user = users.first\n address, password, salt, status, expiry = [:email, :encrypted_password, :salt, :status, :expires_on].map { |k| user[k] }\n return \"expected email '#{email}' but got '#{address}'\" unless email == address\n return \"expected status OK but got '#{status}'\" unless status == \"OK\"\n return \"expected password but got nothing\" unless password\n return \"expected 32 character password but got #{password.length}\" unless password.length == 32\n return \"expected salt but got nothing\" unless salt\n return \"expected 32 character salt but got #{salt.length}\" unless salt.length == 32\n status = user[:verified_at].present? ? 'ok' : 'pending'\n { password: password, salt: salt, status: status, expiry: expiry }\n rescue Mysql2::Error => e\n return \"mysql error: #{e.message}\"\n rescue => e\n return \"error: #{e.message}\"\n end", "def confirm\n \t\tuser = User.find_by_uid params[:uid]\n \t\tuser.confirm_email params[:confirmation_code]\n \t\tif not user.confirmed?\n \t\tflash[:error] = \"You're link doesn't match what we have on record.\"\n \t\tredirect_to signup_path\n \t\telse\n \t\tsession[:user] = user\n \t\tflash[:success] = \"We will update you at #{user.email} with new information as it because available\"\n \t\tredirect_to dashboard_path\n \t\tend \n \tend", "def verify_email \n @invitation = Invitation.find_by_verify_email_token!(params[:id])\n if @invitation\n @invitation.status = 'email verified'\n @invitation.save!\n # store the invitation id in the session for use later in creating the person_connection\n # after the user has logged in or created their user profile\n session[:i_id] = @invitation.id\n if current_user #user has a cookie or is logged in \n # Carla was invited to join Christine's F&F - Carla already a \"stay logged in user of epet\"\n redirect_to person_path(current_user.person)\n elsif @invitation.existing_user.eql?(\"true\") \n # redirect to the login screen \n redirect_to :login\n else\n # redirect to new user screen\n redirect_to new_user_url(:email => @invitation.email)\n end\n end\n end", "def find_user(params)\n Rails.application.eager_load!\n user = nil\n ActiveRecord::Base.descendants.select {|model| model < Umanage::User}.each do |umodel|\n user ||= umodel.find_by(email: params[:session][:email].downcase)\n end\n return user\n end", "def find(email = nil)\n\n # Search cache\n if self.use_cache\n uid = self.cache[email]\n return uid if uid\n end\n\n # Search LDAP for the email address as given\n filter = Net::LDAP::Filter.eq('mail', email)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n\n # The exact email address wasn't found, try the form \"username@domain\" if the username component looks like\n # a username (assumes that usernames do not contain punctuation)\n user, domain = email.split('@')\n unless user.nil? || user.empty? || user.include?('.')\n filter = Net::LDAP::Filter.eq('uid', user)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n end\n\n # No matches found\n nil\n\n end", "def verify_user\n @user = User.find_by(id: params[:id]) || User.find_by(email: params[:email])\n\n return redirect_to root_path if @user.nil?\n end", "def email_exists?(email)\n return User.find_by_email(email.downcase) != nil\nend", "def email\n self.user.try(:email) || self.original_email\n end", "def email\n self.user.try(:email) || self.original_email\n end", "def check_email_address\n\t logger.info \"Checking email address\"\n\t logger.info params.inspect\n\t user = OrderUser.find_by_email_address(params[:email_address])\n\t if user\n\t # Show pop window with login page...\n\t render(:update) { |page| page.call('showLoginWin', user.email_address) }\n\t return\n else\n render(:update) { |page| page.call('hidePopWin') }\n return\n end\n end", "def confirm\n user = User.find_by_email(params[:email])\n # make sure user do not use the string \"used\" to hack the system\n if user.token != \"used\" && params[:token] == user.token\n user.confirm = true\n user.token = \"used\" #token is only for one time use\n if user.save\n session[:user_id] = user.id\n redirect_to main_path\n end\n else\n render :text => \"You have confirmed before. Or something went wrong\"\n end\n end", "def user\n @user ||= User.find_by_email(self.email)\n end", "def friend_email=(value)\n new_friend = User.find(:first, :conditions => { :email => value })\n raise(ActiveRecord::RecordNotFound) unless(new_friend)\n self.friend = new_friend\n end", "def does_user_exist?(email)\n user = User.find_by(email: email)\n if user\n return true\n else\n return false\n end\nend", "def email_confirm\n token = user_params_for_email_confirm[:email_confirm_token]\n\n render status: :forbidden and return if token.nil? or @user.email_confirm_token != token\n\n if @user.update(email_confirm_token: nil)\n render json: @user\n else\n render json: @user, status: :unprocessable_entity, adapter: :json_api, serializer: ActiveModel::Serializer::ErrorSerializer\n end\n end", "def user\n user = User.find_by_email(email)\n # return the user if a user with that email is found and the password is valid\n return user if user && user.authenticate(password)\n #.authenticate is an ActiveModel::SecurePassword method\n #.authenticate is included via ActiveRecord inheritance and using has_secure_password in the User model\n #.authenticate returns self if password is correct, otherwise returns false\n\n # Otherwise, add this message to error messages & return nothing\n errors.add(:user_authentication, 'This email and password combination is invalid.')\n nil\n end", "def show\n \t@user = User.find_by_confirmation_token_and_id(params[:confirmation_token], params[:id])\n \tif @user.user_state == \"confirmed\"\n flash[:notice] = \"\" + @user.first_name + \", your account is already confirmed.\"\n redirect_to(:action => 'already_confirmed')\n else\n render :layout => \"activate\"\n end\n end", "def identify(username_or_email)\n return nil if username_or_email.blank? or username_or_email == 'Public'\n \n if username_or_email =~ /@/ \n active.find_by_email(username_or_email)\n else\n active.find_by_username(username_or_email)\n end \n end", "def user_should_receive_registration_email?\n return true if user.nil?\n return false unless user.confirmed?\n return false if email_address_record.confirmed?\n true\n end", "def create\n @unconfirmed_user = User.send_confirmation_instructions({ email: confirmation_params[:email] })\n\n if successfully_sent?(@unconfirmed_user)\n render json: '', status: :no_content\n else\n render json: format_errors(@unconfirmed_user.errors),\n status: :unprocessable_entity\n end\n end", "def fetch_and_validate_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).is_active.first\n return error_with_identifier('invalid_api_params',\n 'um_u_c_ve_2',\n ['user_already_present']\n ) if @user.present?\n\n success\n end", "def user_info_by_email( email )\n id = User.cid_from_email( email )\n return user_info_by_cid( id )\n end", "def send_confirmation_email\n user = User.find_by_username params[:username]\n raise ActiveRecord::RecordNotFound unless user\n\n command = SendConfirmationEmailCommand.new(user, current_user,\n request.remote_ip)\n begin\n command.execute\n rescue => e\n flash['error'] = \"#{e}\"\n else\n flash['success'] = 'Confirmation email sent.'\n ensure\n redirect_back fallback_location: user_url(user)\n end\n end", "def correct_email_confirmation\n return if email == email_confirmation\n\n error_message = I18n.t('email.errors.email_equality')\n errors.add(:email, :invalid, message: error_message)\n errors.add(:email_confirmation, :invalid, message: error_message)\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def find_or_create_user\n @user = User.find_by(email: auth_email)\n @user ||= create_new_user\n save_omniauth_details\n\n @user\n end", "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def email\n user.present? ? user.email : self[:email]\n end", "def set_email\n @user_email = UserEmail.find(params[:id])\n end", "def send_confirmation_email\n UserMailer.confirmation_email(@user).deliver_now\n UserMailer.confirmation_email(@user.find_match).deliver_now\n end", "def confirm\n confirmation_hash = params[:confirmation_hash]\n if confirmation_hash.nil?\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n confirmed_address = AliasAddress.find_by_confirmation_hash(confirmation_hash)\n\n # No address with the given hash key was found,\n # or the address was already activated:\n if confirmed_address.nil? || confirmed_address.confirmed\n respond_to do |format|\n format.html {\n @page_title = I18n.t('errors.confirmation_failed')\n @user = nil\n render :template => \"alias_addresses/confirmation_failed_#{I18n.locale}.haml\", :layout => \"users\"\n }\n end\n return\n end\n\n # If there was already a user with the specified e-mail address,\n # merge his meetings into the \"master\" account:\n other_user = AliasAddress.find_by_address_and_confirmed(confirmed_address.address, true)\n\n confirmed_address.confirmed = true\n confirmed_address.save!\n\n new_user = confirmed_address.owner\n\n if other_user\n other_user = other_user.owner\n meetings = other_user.meetings\n meetings.each do |meeting|\n # Is the \"master\" user invited to this meeting as well?\n double_invite = meeting.participants.include?(new_user)\n\n meeting.suggestions.each do |suggestion|\n\n # If both are participants, simply delete all votes by the other user:\n if double_invite\n to_delete = suggestion.votes.select { |vote| vote.voter == other_user }\n suggestion.votes.delete(to_delete)\n else\n # Otherwise, replace the voter of the vote if neccessary:\n suggestion.votes.each do |vote|\n if vote.voter == other_user\n vote.voter = new_user\n vote.save!\n break\n end\n end\n end\n\n # Replace the creator of the suggestion if neccessary:\n if suggestion.creator == other_user\n suggestion.creator = new_user\n end\n suggestion.save!\n end\n meeting.comments.select{ |c| c.author == other_user }.each do |comment|\n # Replace the comment author if neccessary:\n comment.author = new_user\n comment.save!\n end\n # Switch the initiator of the meeting if neccessary:\n meeting.initiator = new_user if meeting.initiator == other_user\n\n # Switch the participants of the meeting:\n meeting.participants.delete(other_user)\n meeting.participants << new_user unless double_invite\n\n meeting.save!\n end\n\n # Also, make all the alias addresses of other_user over\n # to new_user (by copying them - this is neccessay as\n # the \"alias_addresses\" accociation has the\n # \":dependent => :destroy\" option and all aliases would\n # therefore be lost when the other_user is deleted):\n other_user.alias_addresses.each do |address|\n new_user.alias_addresses << AliasAddress.new(\n :owner_id => new_user.id,\n :address => address.address,\n :confirmation_hash => address.confirmation_hash,\n :confirmed => address.confirmed\n )\n end\n\n # And finally, delete the now redundant other user:\n other_user.destroy\n\n # Delete the now obsolete alias (one for its address\n # has already been taken over from the other user):\n confirmed_address.destroy\n\n # And don't forget to save the manipulated user:\n new_user.save!\n\n end\n\n @alias_address = confirmed_address\n\n I18n.locale = @alias_address.owner.language\n\n end", "def user_with_email(email)\n client = self\n MagicBell::User.new(client, \"email\" => email)\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => confirmation.unconfirmed_email\n end", "def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end", "def send_confirmation_email\n return false if /\\w@(example)\\.com/.match(self.email)\n UserMailer.confirmation(self).deliver unless confirmed?\n end", "def user\n user = User.find_by_email(email)\n return user if user && user.authenticate(password)\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def user\n begin\n if user_uid?\n @_user ||= User.find(user_uid)\n end\n if respond_to?(:email?) && email?\n @_user ||= User.where(email: email).first\n end\n rescue => e\n Rails.logger.warn \"#{self.class} #{self.id} has a user_uid that corresponds to no known data room user. Perhaps someone has been deleted? Ignoring. Error: #{e}\"\n nil\n end\n @_user\n end", "def confirm_email(token)\n user = User.find_by_confirmation_token(token)\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.confirm!\n end", "def check_email\n @user=User.where('email=?',params[:email])\n @user=[] if user_signed_in? && @user && @user.first==current_user # this means they are editing their email address and its themselves, that is ok\n end", "def create\n u = User.only_deleted.where(\"email = ?\", params[:user][:email])\n\n if u.present?\n flash[:danger] = 'User Deleted. Please Contact Admin.'\n redirect_to new_user_session_path\n else\n # if valid_email(params[:user][:email]) == true\n super\n # end\n end\n end" ]
[ "0.7319801", "0.6926711", "0.6870363", "0.68251306", "0.67924225", "0.6742735", "0.6687273", "0.66170377", "0.6568026", "0.6551589", "0.6541681", "0.6520444", "0.64575195", "0.642293", "0.6413801", "0.63637197", "0.6361619", "0.6353253", "0.6338568", "0.6316705", "0.63153327", "0.6315225", "0.62974864", "0.62894595", "0.62876636", "0.6281113", "0.6268126", "0.6254806", "0.6248442", "0.6246574", "0.62422043", "0.6239504", "0.621686", "0.6208854", "0.6202606", "0.6149985", "0.61371344", "0.61312526", "0.6126004", "0.6123282", "0.6120702", "0.6085078", "0.6075251", "0.60725415", "0.60642767", "0.6063214", "0.6057292", "0.605311", "0.6049694", "0.6045342", "0.6042483", "0.60232365", "0.6022082", "0.6003003", "0.5958522", "0.5956566", "0.5940239", "0.59397584", "0.5932637", "0.5931693", "0.5927367", "0.5921744", "0.59201133", "0.5913717", "0.59082985", "0.58796567", "0.5874707", "0.58686155", "0.58686155", "0.58590645", "0.58585775", "0.5858532", "0.5857039", "0.58567667", "0.58551216", "0.5846273", "0.58328557", "0.5832648", "0.58271486", "0.5819849", "0.5804113", "0.57994103", "0.57865155", "0.5785656", "0.57812476", "0.57652664", "0.57649475", "0.57649475", "0.57639617", "0.57614917", "0.5748122", "0.5728107", "0.57275796", "0.5723207", "0.5719888", "0.5716459", "0.5713552", "0.5707051", "0.570433", "0.57025987", "0.57017356" ]
0.0
-1
A callback initiated after successfully authenticating. This can be used to insert your own logic that is only run after the user successfully authenticates. Example: def after_database_authentication self.update_attribute(:invite_code, nil) end source://devise//lib/devise/models/database_authenticatable.rb172
def after_database_authentication; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_custom_authentication; end", "def after_custom_authentication\n\n end", "def after_crowd_authentication\n end", "def after_login(&block)\n add_callback(:login, block)\n end", "def after_token_authentication\n end", "def after_token_authentication\n end", "def successful_authentication(user)\n set_brute_force_counter(user, 0)\n super\n end", "def after_hash_token_authentication\n end", "def after_password_reset; end", "def on_success(&block)\n apply_hook(:success, &block)\n end", "def callback\n rpx_auth\n after_auth(params[:on_complete_url])\n end", "def user_verification?; end", "def after_successful_token_authentication\n @user = current_user\n end", "def after_password_reset;\n end", "def callback\n # This stores all the user information that came from Auth0\n # and the IdP\n userinfo = request.env['omniauth.auth']\n\n begin\n result = SessionService.process!(userinfo, session)\n\n if result.new_user?\n redirect_to welcome_path\n else\n # Redirect to the URL you want after successful auth\n redirect_to services_path,\n flash: {\n success: I18n.t(:welcome_html, scope: [:auth, :existing_user])\n }\n end\n rescue SignupNotAllowedError\n # no new user or existing user, so they weren't allowed to sign up\n redirect_to signup_not_allowed_path\n end\n end", "def pre_authorize_cb; end", "def controller_account_success_authentication_after(context={})\n context[:controller].flash[:kittens] = \"Yay! Welcome #{context[:user].firstname}!\"\n end", "def authentication_succeed(oidresp)\n end", "def user_verification; end", "def after_confirmation; end", "def after_successful_sign_in\n invite = current_account.claim_invitation\n if invite\n invitable = invite.invitable\n invitable_name = invitable.class.name.downcase\n anchor = '/%s/%d' % [invitable_name.pluralize, invitable.id]\n\n flash[:success] = _('%s invited you to collaborate on %s %s.') % [\n invite.user.nicename, invitable.title, invitable_name ]\n\n redirect_to root_path(:anchor => anchor)\n else\n super\n end\n end", "def user_verified?; end", "def user_verified; end", "def on_success(&block)\n @handlers[:success] = block\n self\n end", "def callback\n @user = User.find_by_hash(auth_hash)\n if @user\n login(@user)\n redirect_to \"/\" and return\n else\n # We store the authorization so that the user cannot modify\n # the provider/uid details in the form\n @authorization = Authorization.create_from_hash(auth_hash)\n session[:auth_id] = @authorization.id\n @user = User.new_from_hash(auth_hash)\n end\n end", "def pre_authorize_cb=(_arg0); end", "def handle_mobile_verification\n if valid_otp?\n current_user.update(mobile_verified: true)\n Redis.current.del(current_user.id)\n # I18n.t 'devise.sessions.signed_in'\n flash[:success] = I18n.t 'after_signup.verification_success'\n render_wizard current_user\n else\n flash[:error] = I18n.t 'after_signup.verification_failure'\n render after_signup_path(:verify_mobile)\n end\n # current_user.update(mobile_verified: true) if valid_otp?\n end", "def on_success( &block )\n @on_success = block\n end", "def redirect_after_signup &blk\n self.lwt_authentication_system_options[:redirect_after_signup] = blk\n end", "def after_authentication\n @initiating_url = session[:initiating_url]\n session[:initiating_url] = nil\n render :'authentication/after_authentication'\n end", "def azure_auth\n if (email = authenticated?)\n email_pat = /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/i\n unless email =~ email_pat\n flash[:alert] = \"Unknown email: #{email}\"\n redirect_to root_path\n return\n end\n user = User.where(:email => email).first\n unless user\n password = Devise.friendly_token[0,8]\n user = User.create(\n email:email,\n password:password,\n password_confirmation:password\n )\n end\n \n if user.email_confirmed?\n sign_in_and_redirect user, :event => :authentication\n else\n redirect_to root_path, :notice => I18n.t(:conf_msg, :scope => [:messages, :controllers, :invitations])\n end\n else\n flash[:alert] = \"No email found.\"\n redirect_to root_path\n end\n end", "def user_verified=(_arg0); end", "def after_password_reset\n accept_invitation! if invitation_token.present?\n end", "def after_create_account(result)\n\n end", "def after_auth(user)\n # Push the avatar (Just in case any clients support it)\n # AvatarUpdaterService.new(user).update\n\n # Set rooms, groups, etc.\n UserService.update(user).save\n\n # We're done here\n sign_in_and_redirect user\n end", "def after_confirmation\n end", "def on_connection_success &block\n @connection_success_callback = block\n end", "def process_authentication\n\n omniauth = request.env[\"omniauth.auth\"]\n Rails.logger.info(\"[CNTRL][Authentications] Auth process callback #{params} omniauth #{omniauth}\")\n\n if omniauth.nil?\n #TODO: Send back to sign in\n Rails.logger.info(\"[CNTRL][Authentications] Omni auth is nil, back to home\")\n redirect_to \"/\"\n end\n\n provider = params['provider']\n uid = omniauth['uid']\n\n already_existing_auth = Authentication.find_by_provider_and_uid(provider, uid)\n\n if already_existing_auth.nil?\n Rails.logger.info(\"[CNTRL][Authentications] A new foreign auth\")\n if user_signed_in?\n\n Rails.logger.info(\"[CNTRL][Authentications] User is already signed in #{current_user.full_name}\")\n\n query_hash = {}\n query_hash[provider] = uid \n invite_status = Invite.check_if_invite_exists(query_hash)\n\n \n\n any_existing_auth_for_same_provider = current_user.authentications.find_by_provider(provider)\n if any_existing_auth_for_same_provider.nil?\n Rails.logger.info(\"[CNTRL][Authentications] No existing auth for #{provider} for user\")\n authentication=Authentication.create(:provider=>provider,\n :uid=>uid,\n :token=> omniauth['credentials']['token'],\n :secret=> omniauth['credentials']['secret'],\n :user_id=>current_user.id)\n\n Rails.logger.info(\"[CNTRL][Authentications] Cache the new foreign profile\")\n authentication.foreign_profile = ForeignProfile.new\n authentication.foreign_profile.send(\"import_#{provider}\",omniauth)\n \n #redirect back to where you came from\n #\n \n\n if current_user.get_invited_status() == true\n enable_hash = {\n :user_id => current_user.id,\n :provider => provider,\n :uid => uid\n } \n current_user.enable_service(enable_hash)\n end\n redirect_to session[:return_to] || '/'\n \n else\n Rails.logger.info(\"[CNTRL][Authentications] #{current_user.full_name} already has auth for #{provider}\")\n if current_user.get_invited_status() == true\n enable_hash = {\n :user_id => current_user.id,\n :provider => provider,\n :uid => uid\n }\n current_user.enable_service(enable_hash)\n end\n redirect_to session[:return_to] || '/'\n end\n else\n # New authentication for no signed in user\n Rails.logger.info(\"[CNTRL][Authentications] User is not signed in but auth is new.\")\n\n authentication = Authentication.create( :provider => provider,\n :uid => uid,\n :token=> omniauth['credentials']['token'],\n :secret=> omniauth['credentials']['secret'])\n\n\n Rails.logger.info(\"[CNTRL][Authentications] New foreign profile to cache for new auth no signin.\")\n authentication.foreign_profile = ForeignProfile.new\n authentication.foreign_profile.send(\"import_#{provider}\",omniauth)\n\n\n query_hash = {}\n query_hash[provider] = uid\n \n invite_status = Invite.check_if_invite_exists(query_hash)\n if invite_status \n Invite.mark_invite_accepted(provider, uid)\n end\n\n Rails.logger.info(\"[CNTRL][Authentications] Redirecting to auth signup page.\")\n #if validation does not exist and user is not signed in do not allow access\n\n redirect_to :controller => 'authentications',\n :action => 'auth_signup_provider',\n :provider => provider,\n :uid => uid,\n :key => authentication.salt\n\n end\n else\n #save latest auth token\n Rails.logger.info(\"[CNTRL][Authentications] Renew credentials for an existing auth\")\n already_existing_auth.token = omniauth['credentials']['token']\n already_existing_auth.secret = omniauth['credentials']['secret']\n\n if user_signed_in?\n Rails.logger.info(\"[CNTRL][Authentications] User already signed in for a new auth.\")\n if already_existing_auth.user_id.nil?\n Rails.logger.info(\"[CNTRL][Authentications] User is being connected to auth\")\n already_existing_auth.user_id = current_user.id\n already_existing_auth.save!\n \n if current_user.get_invited_status() == true\n enable_hash = {\n :user_id => current_user.id,\n :provider => provider,\n :uid => uid\n }\n current_user.enable_service(enable_hash) \n end\n\n redirect_to session[:return_to] || '/'\n else\n\n if already_existing_auth.user_id == current_user.id\n Rails.logger.info(\"[CNTRL][Authentications] Auth token being updated for user\")\n already_existing_auth.save!\n end\n Rails.logger.info(\"[CNTRL][Authentications] Going back to where we came from\")\n enable_hash = {\n :user_id => current_user.id,\n :provider => provider,\n :uid => uid\n }\n current_user.enable_service(enable_hash) \n redirect_to session[:return_to] || '/'\n end\n else\n Rails.logger.info(\"[CNTRL][Authentications] A new auth and user is not signed in.\")\n if already_existing_auth.user_id.nil?\n Rails.logger.info(\"[CNTRL][Authentications] Auth is not associated to any user.\")\n already_existing_auth.save!\n\n Rails.logger.info(\"[CNTRL][Authentications] Foreign profile being saved for auth.\")\n already_existing_auth.foreign_profile = ForeignProfile.new\n Rails.logger.info(\"[CNTRL][Authentications] Foreign profile import method call.\")\n already_existing_auth.foreign_profile.send(\"import_#{provider}\",omniauth)\n \n\n Rails.logger.info(\"[CNTRL][Authentications] Redirecting to auth sign in\")\n redirect_to :controller => 'authentications',\n :action => 'auth_signup_provider',\n :provider => provider,\n :uid => uid,\n :key => already_existing_auth.salt\n\n else\n # I know the user, allow him to get in\n Rails.logger.info(\"[CNTRL][Authentications] Known auth, user sign in [user id : #{already_existing_auth.user_id}]\")\n \n if already_existing_auth.user.user_type == AppConstants.user_type_crawled \n Rails.logger.info(\"[CNTRL][Authentications] Cache the new foreign profile\")\n already_existing_auth.foreign_profile = ForeignProfile.new\n already_existing_auth.foreign_profile.send(\"import_#{provider}\",omniauth)\n already_existing_auth.save!\n\n redirect_to :controller => 'authentications',\n :action => 'auth_signup_provider',\n :provider => provider,\n :uid => uid,\n :key => already_existing_auth.salt\n return\n end\n\n\n already_existing_auth.save!\n \n invite_status = already_existing_auth.user.get_invited_status \n if invite_status \n enable_hash = {\n :user_id => already_existing_auth.user.id,\n :provider => provider,\n :uid => uid\n }\n already_existing_auth.user.enable_service(enable_hash) \n end\n sign_in_and_redirect(:user, already_existing_auth.user)\n end\n end\n end\n rescue => e\n Rails.logger.error(\"[CNTRL][Authentications] Save raised exception : #{e}\")\n redirect_to \"/\"\n end", "def after_ip_authentication\n end", "def after_create_account(user, auth)\n # not required\n end", "def on_success!(response, sreg_response)\n if user = find_user_by_identity_url(response.identity_url)\n user\n else\n request.session[:'openid.url'] = response.identity_url\n required_reg_fields.each do |f|\n session[:\"openid.#{f}\"] = sreg_response.data[f] if sreg_response.data[f]\n end if sreg_response\n redirect!(Merb::Router.url(:signup))\n end\n end", "def successful_login!\n unthrottle_user\n clear_bad_login_counter\n end", "def after_login!(user, username = '', password = '', options = {})\n sorcery_config.after_login.each do |callback|\n send(callback, user, username, password, options)\n end\n end", "def callback\n auth = build_auth\n respond_to do |format|\n if logged_in?\n add_identity_to_current_user(auth)\n welcome_user(current_user)\n format.html { redirect_logged_in_user }\n format.json { render_jsend_success(:logged_in) }\n else\n user = find_or_create_user_from_auth(auth)\n if user\n user.remember_me! if session.delete(:remember_me)\n if user.connected?\n setup_new_user(user, auth)\n format.html { redirect_to_signup_flow_entry_point }\n format.json { render_jsend_success(:connected, new_profile_data(user, auth)) }\n elsif user.registered?\n setup_existing_user(user)\n format.html { redirect_after_onboarding_check(user, request.env['omniauth.origin']) }\n format.json { render_jsend_success(:registered) }\n else\n notify_visitor_user_creation_failed(user)\n format.html { redirect_after_auth(request.env['omniauth.origin'] || login_path) }\n format.json { render_jsend(error: :user_creation) }\n end\n else\n format.html { redirect_to(login_path) }\n format.json { render_jsend(error: :no_user) }\n end\n end\n end\n end", "def after_magic_link_authentication\n end", "def after_successful_token_authentication\n # binding.pry\n # Make the authentication token to be disposable - for example\n # renew_authentication_token!\n end", "def user_authentication\n end", "def after_remembered\n end", "def handle_activation(user)\n\t\t\n\tend", "def before_method(request, response)\n if @current_principal\n # We already have authentication information. This means that the\n # event has already fired earlier, and is now likely fired for a\n # sub-request.\n #\n # We don't want to authenticate users twice, so we simply don't do\n # anything here. See Issue #700 for additional reasoning.\n #\n # This is not a perfect solution, but will be fixed once the\n # \"currently authenticated principal\" is information that's not\n # not associated with the plugin, but rather per-request.\n #\n # See issue #580 for more information about that.\n return nil\n end\n\n if @backends.empty?\n fail Dav::Exception, 'No authentication backends were configured on this server.'\n end\n\n reasons = []\n @backends.each do |backend|\n result = backend.check(request, response)\n\n if !result.is_a?(Array) ||\n result.size != 2 ||\n !(result[0].is_a?(TrueClass) || result[0].is_a?(FalseClass)) ||\n !result[1].is_a?(String)\n fail Dav::Exception, 'The authentication backend did not return a correct value from the check method.'\n end\n\n if result[0]\n @current_principal = result[1]\n # Exit early\n return nil\n end\n reasons << result[1]\n end\n\n # If we got here, it means that no authentication backend was\n # successful in authenticating the user.\n @current_principal = nil\n\n @backends.each do |backend|\n backend.challenge(request, response)\n end\n fail Exception::NotAuthenticated, reasons.join(', ')\n end", "def on_after_oauth2_connect(oauth2_user_attributes)\n if self.respond_to?(:after_oauth2_connect)\n self.send(:after_oauth2_connect, oauth2_user_attributes)\n end\n end", "def acknowledge(authcode = nil)\n verified?\n end", "def after_remembered; end", "def on_before_koala_success(koala_user)\n self.send(:before_koala_success, koala_user) if self.respond_to?(:before_koala_success)\n end", "def after_confirmation # Send welcome mail after user is successfully registered\n send_user_mail\n end", "def on_failure!(response)\n session.authentication.errors.clear!\n session.authentication.errors.add(:openid, 'OpenID verification failed, maybe the provider is down? Or the session timed out')\n nil\n end", "def callback_phase\n @user_info = get_user(@auth_token = fetch_auth_token(session['omniauth.ebay.session_id']))\n super\n end", "def auth_success_redirect(path = nil, user: nil, message: nil, **opt)\n set_flash_notice(message, **opt) if message.present?\n path ||= after_sign_in_path_for(user || resource)\n redirect_to path\n end", "def successful_authentication!(ip_address = nil)\n self.last_session_at = Time.now\n self.last_session_ip = ip_address\n self.save\n self.increment!(:session_count, 1)\n end", "def successfully_authenticated\n unless self.ok == true\n self.errors.add(:ok, \"Response must include ok true!\")\n end\n end", "def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end", "def authentication_successful?\n current_user.present?\n end", "def callback_phase\n @auth_token = get_auth_token(request.params[\"username\"], request.params[\"sid\"])\n @user_info = get_user_info(request.params[\"username\"], @auth_token)\n ap @user_info\n super\n rescue => ex\n fail!(\"Failed to retrieve user info from ebay\", ex)\n end", "def handle_inverified_request\n \tsignout\n \tsuper\n end", "def handle_unverified_request\n sorcery_config.before_unverified_request.each do |callback|\n send(callback)\n end\n @current_user = nil\n super # call the default behaviour which resets the session\n end", "def login_code\n self.login.login\n end", "def verify_and_activate!\n self.verify! unless self.verified?\n \n # hack to make sure people who come in via yammer get their verified_at column\n # set properly\n self.update_column(:verified_at, Time.now) if self.verified_at.blank?\n\n #this used to be in signups controller and password resets controller\n #but moving to here, because we use this method in more spots\n #and i made management of perishable token manual(instead of authlogic handling it)\n #so be safe and reset it whenever we verify\n self.reset_perishable_token!\n \n #activate if all the info is good\n self.set_status!(:active) if self.ok_to_login?\n end", "def after_successful_run(*args, &block)\n opts = args.extract_options!\n opts[:if] = [:valid?, :after_run_callback_enabled?] + Array(opts[:if])\n\n set_callback :run, :after, *args, opts, &block\n end", "def after_create\n @password = nil\n end", "def after_create\n @password = nil\n end", "def callback\n return unless passes_whitelist?\n session[:user_id] = User.from_omniauth(@auth_hash, current_tenant.tenant_id, unmangle_orcid).id\n redirect_to dashboard_path\n end", "def on_after_oauth2_connect(oauth2_user_attributes)\n \n if self.respond_to?(:after_oauth2_auto_create)\n self.send(:after_oauth2_auto_create, oauth2_user_attributes) \n end\n on_after_oauth2_connect\n end", "def create\n @authentication = Authentication.find(:first, conditions: {provider: omniauth['provider'], uid: omniauth['uid']})\n\n if @authentication #.persisted? #???\n flash[:notice] = I18n.t \"devise.omniauth_callbacks.success\", kind: @authentication.provider_name\n # sign_in_and_redirect @user, :event => :authentication\n sign_in_and_redirect(:user, @authentication.user)\n\n elsif current_user\n current_user.authentications.create!(provider: omniauth['provider'], uid: omniauth['uid'])\n flash[:notice] = \"Authentication successful. #{provider} added to your account.\"\n redirect_to current_user\n\n else\n user = User.new\n user.apply_omniauth(omniauth)\n if user.save\n user.authentications.map &:save!\n # send pass by mail? or just tell that a random pass was set, click link to reset (change behaviour of the reset)\n flash[:notice] = \"Signed in successfully.\"\n sign_in_and_redirect(:user, user)\n else\n # session[\"devise.omniauth_data\"] = omniauth.except('extra')\n session[:omniauth] = omniauth\n redirect_to new_user_registration_url\n end\n end\n end", "def after_failed_sign_in\n flash[:error] = _('Something went wrong. Please try again.')\n redirect_to root_path\n end", "def after_invite_new_user(invite)\n end", "def activate\n self.current_user = params[:activation_code].blank? ? false : User.find_by_activation_code(params[:activation_code])\n if logged_in? && !current_user.active?\n current_user.activate\n flash[:notice] = \"Signup complete!\"\n end\n redirect_back_or_default('/')\n end", "def callback_phase\n ym_session_id = env['rack.session'][RACK_SESSION_KEY]\n fail!(E_YM_SESSION_ID_BLANK) if ym_session_id.blank?\n ym_session = YourMembership::Session.new(ym_session_id, 100)\n\n begin\n fail! 'Failed To Log In' unless ym_session.authenticated?\n rescue YourMembership::Error => e\n fail! e.error_description\n end\n\n @user_id = ym_session.user_id\n @access_token = ym_session.to_s\n\n super\n end", "def check_verification code\n if (code == self.verification_code)\n self.active = 1;\n self.save\n end\n end", "def auth_after\n url = session[:auth_redirect] || root_path\n redirect_to url\n end", "def verify_callback; end", "def verify_callback; end", "def callback_call\n setup_phase\n log :debug, 'Callback phase initiated.'\n @env['omniauth.origin'] = session.delete('omniauth.origin')\n @env['omniauth.origin'] = nil if env['omniauth.origin'] == ''\n @env['omniauth.params'] = session.delete('omniauth.params') || {}\n OmniAuth.config.before_callback_phase.call(@env) if OmniAuth.config.before_callback_phase\n callback_phase\n end", "def authentication_response_status\n authenticate_user.success? ? :ok : :unauthorized\n end", "def after_create\n @password = nil\n @confirm_password = nil\n end", "def successful_login(user)\n log_in user\n redirect_back_or root_url\n\n # Report last login time (this can help users detect problems)\n last_login = user.last_login_at\n last_login = t('sessions.no_login_time') if last_login.blank?\n flash[:success] = t('sessions.signed_in', last_login_at: last_login)\n\n # Record last_login_at time. We use update_columns because\n # it works even if we don't have the correct email decryption keys,\n # and so it won't change updated_at (so updated_at becomes more useful).\n # We don't need the model validations, we're just setting a timestamp.\n # rubocop: disable Rails/SkipsModelValidations\n user.update_columns(last_login_at: Time.now.utc)\n # rubocop: enable Rails/SkipsModelValidations\n end", "def authentication_successful?\n @user.present?\n end", "def after_database_authentication\n\n \t# If the identifier is nil, then assign random string\n \t# Can be used to identify user if we dont want to use the default id\n\tidentifier = SecureRandom.urlsafe_base64\n\tif self.identifier.nil?\n \tself.update_attribute(:identifier, identifier)\n \tend\n\n \t#Send use the first message from admin\n \tmessages = Message.where('sender_id = ? OR recipient_id = ?', self.id, self.id)\n \tif messages.size == 0\n \t\ttext = \"Hi #{self.id}! Welcome to Witaji!\"\n \t\tMessage.create({ recipient_id: self.id, sender_id: 1, text: text, pusher_channel: \"1-#{self.id}\" });\n \tend\n\n end", "def reset_verification_code!\n reset_verification_code\n save_without_session_maintenance\n end", "def after_save_actions\n Logger.d(\"Inside after_save_actions in User\")\n ContactsSync.new(@context, get(:auth_token)).sync if is_user_contacts_syncable? == true # non-blocking\n end", "def authenticate_once_state\n super\n end", "def authenticate!\n\n # mapping comes from devise base class, \"mapping.to\" is the class of the model\n # being used for authentication, typically the class \"User\". This is set by using\n # the `devise` class method in that model\n #byebug\n klass = mapping.to\n\n if request.headers['X-HC-FB-AUTH'].present?\n # the returned user object will be saved and serialised into the session\n\n decoded = Base64.decode64(request.headers['X-HC-FB-AUTH'])\n user_and_token = decoded.split(':')\n\n users = klass.includes(:identities).where(socify_identities: { uid: user_and_token[0], token: user_and_token[1], provider: \"facebook\"})\n begin\n if users.size == 1\n u = users.first\n identity = u.identities.find_by!(uid: user_and_token[0], token: user_and_token[1], provider: \"facebook\")\n if !identity.expires_at || (identity.expires_at && identity.expires_at > Time.now)\n success! u\n else\n fail! \"token expired\"\n end\n else\n fail! \"invalid uid and/or token\"\n end\n rescue\n fail!\n end\n end\n\n # if we wanted to stop other strategies from authenticating the user\n end", "def activate\n # TODO must remember to reset the session[:activation_code]\n # looks as if setting current user (next line) was causing the user to be\n # logged-in after activation\n user = User.find_and_activate!(params[:activation_code])\n if user.update_attributes(params[:user].slice(:login, :email, :password, :password_confirmation))\n redirect_to root_path\n else\n flash[:warn] = user.errors.full_messages\n redirect_to signup_authengine_user_path(user)\n end\n rescue User::ArgumentError\n flash[:notice] = 'Activation code not found. Please ask the database administrator to create an account for you.'\n redirect_to new_authengine_user_path\n rescue User::ActivationCodeNotFound\n flash[:notice] = 'Activation code not found. Please ask the database administrator to create an account for you.'\n redirect_to new_authengine_user_path\n rescue User::AlreadyActivated\n flash[:notice] = 'Your account has already been activated. You can log in below.'\n redirect_to login_path\n end", "def clean_up_passwords; end", "def register_verify_callback(connection)\n connection.verify_callback = self\n end", "def after_database_authentication\n rotate_stale_password_digest\n end", "def redirect_after_login &blk\n self.lwt_authentication_system_options[:redirect_after_login] = blk\n end", "def verify_callback=(verify_callback); end", "def verify_callback=(verify_callback); end", "def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end", "def valid_for_authentication?; end" ]
[ "0.6671512", "0.6547195", "0.5964293", "0.58728886", "0.5815485", "0.5815485", "0.5752459", "0.57471836", "0.57250667", "0.57090735", "0.5646311", "0.5600113", "0.5594013", "0.5584151", "0.5551867", "0.55251616", "0.5523413", "0.55220467", "0.54832536", "0.5482599", "0.5468212", "0.5441167", "0.54303867", "0.5417392", "0.53888494", "0.5382243", "0.5363671", "0.5325565", "0.53206724", "0.5318754", "0.5304246", "0.5301053", "0.53002024", "0.5291108", "0.52879745", "0.5284453", "0.52842224", "0.5283957", "0.5214979", "0.5198114", "0.51944363", "0.51883096", "0.5170898", "0.51701546", "0.51654863", "0.5164458", "0.5163703", "0.516035", "0.5158198", "0.5156708", "0.5142647", "0.5131527", "0.5117774", "0.51157683", "0.5105702", "0.51039225", "0.5091141", "0.5089573", "0.50851816", "0.50732255", "0.5072543", "0.5070148", "0.50696576", "0.50593734", "0.5058447", "0.5048169", "0.5047441", "0.50328124", "0.50259787", "0.50259787", "0.50226444", "0.5015811", "0.501486", "0.5011544", "0.50050116", "0.50043446", "0.49981642", "0.49970305", "0.49937168", "0.4985333", "0.4985333", "0.49781975", "0.4972645", "0.49661112", "0.4960755", "0.49603245", "0.49588242", "0.49518624", "0.49515367", "0.49500063", "0.494436", "0.49359956", "0.4933598", "0.4932369", "0.49292713", "0.49243656", "0.49235287", "0.49235287", "0.49193648", "0.49147612" ]
0.6350495
2
A reliable way to expose the salt regardless of the implementation. source://devise//lib/devise/models/database_authenticatable.rb176
def authenticatable_salt; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticatable_salt\n end", "def authenticatable_salt\n read_attribute(:authenticatable_salt)\n end", "def authenticatable_salt\n encrypted_password[0,29] if encrypted_password\n end", "def authenticatable_salt\n self.encrypted_password[0,29] if self.encrypted_password\n end", "def password_salt\n \"choujin-steiner\"\n end", "def authenticatable_salt\n \"#{super}#{session_token}\"\n end", "def authenticatable_salt\n \"#{super}#{session_token}\"\n end", "def get_salt\n @salt ||= BCrypt::Engine.generate_salt\n end", "def generate_salt\n self.salt = SecureRandom.base64(8)\n end", "def salt() 'monkeynutzzSfaKT7CwImCHCH8Ow' end", "def make_salt\n secure_hash(\"#Time.now.utc}--#{password}\")\n end", "def salt\n nil\n end", "def salt\n read_attribute(:salt) || reset_salt\n end", "def mutate_bcrypt_salt(_)\n 'au6lOASvp17AGsqkmE7'\n end", "def salt\n @@salt ||= SALT\n end", "def salt\n read_attribute(:salt) or returning self.class.generate_salt do |s|\n write_attribute(:salt, s)\n end\n end", "def salt\n SecureApi.configuration.secure_api_salt\n end", "def authenticatable_salt\n return if encrypted_password_digest.blank?\n Encryption::PasswordVerifier::PasswordDigest.parse_from_string(\n encrypted_password_digest,\n ).password_salt\n end", "def salt\n # 72 bits\n SecureRandom.hex(9)\n end", "def salt!\n returning self.class.generate_salt do |s|\n write_attribute(:salt, s)\n end\n end", "def make_salt\n secure_hash(\"#{Time.now.utc}--#{password}\")\n end", "def make_salt\n secure_hash(\"#{Time.now.utc}--#{password}\")\n end", "def make_salt\n secure_hash(\"#{Time.now.utc}--#{password_digest}\")\n end", "def make_salt\n\t secure_hash(\"#{Time.now.utc}--#{password}\")\n\tend", "def code_salt\n 'fbbc13ed4a51e27608037365e1d27a5f992b6339'\n end", "def make_salt\r\n self.salt = sha_hash(\"#(Time.now.to_s)--#(self.password)\")\r\n end", "def salt\n p_salt(profile.salt_bytes)\n end", "def authenticatable_salt\n session_id.presence || reset_session_id!\n end", "def generate_salt\n salt_time = (ENV['RACK_ENV'] == 'test' ? 0.01 : 1.25)\n self[:salt] = SCrypt::Engine.generate_salt(max_time: salt_time)\n end", "def salt\n if salt_path.file?\n salt_path.read\n else\n @salt ||= SecureRandom.bytes(Sia::Lock::DIGEST.new.digest_length)\n end\n end", "def init_salt\n self.salt = SecureRandom.hex(25) if self.salt.blank?\n end", "def salt\n @salt ||= Pharos::SaltMinion.new minion_id: hostname\n end", "def salted_password\n @salted_password ||= CredentialCache.cache(cache_key(:salted_password)) do\n hi(user.sasl_prepped_password)\n end\n end", "def before_save\n if (self.salt == nil)\n self.salt = random_numbers(5)\n self.password = Digest::MD5.hexdigest(self.salt + self.password)\n end\n end", "def generate_salt\n self.salt = self.object_id.to_s + rand.to_s\n end", "def create_new_salt \n self.password_salt = self.object_id.to_s + rand.to_s\n end", "def password_salt_field(value = nil)\n rw_config(\n :password_salt_field,\n value,\n first_column_to_exist(nil, :password_salt, :pw_salt, :salt)\n )\n end", "def password_salt_field(value = nil)\n config(:password_salt_field, value, first_column_to_exist(nil, :password_salt, :pw_salt, :salt))\n end", "def generate_salt\n salt = \"\"\n 64.times { \n salt << (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }\n salt\n end", "def create_new_salt\n self.salt = Digest::SHA256.hexdigest(Time.now.to_s + rand.to_s)\n end", "def create_new_salt\n self.salt = Digest::SHA256.hexdigest(Time.now.to_s + rand.to_s)\n end", "def salt=(value)\n @@salt = value\n end", "def generate_salt\n @salt = self.object_id.to_s + rand.to_s\n end", "def create_new_salt\n self.password_salt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n end", "def gen_salt\n chars = []\n 8.times { chars << SALT_CHARS[SecureRandom.random_number(SALT_CHARS.size)] }\n chars.join('')\n end", "def get_crypto_salt_hex\n return @crypto_salt if ! @crypto_salt\n @crypto_salt.unpack(\"H*\")\n end", "def salt_password(clear_password)\n self.salt = User.generate_salt\n self.hashed_password = User.hash_password(\"#{salt}#{User.hash_password clear_password}\")\n end", "def salt_size\n @salt_size ||= 8\n end", "def get_salt\n [Array.new(6){rand(256).chr}.join].pack(\"m\" ).chomp\n end", "def create_new_salt\n\t\tself.salt = self.object_id.to_s + rand.to_s\n end", "def salt_password( authkey, password )\n combined = authkey.to_s + password.to_s\n return Digest::MD5.hexdigest(combined)\n end", "def create_new_salt\n self.salt = self.object_id.to_s + rand.to_s\n end", "def create_new_salt\n self.salt = self.object_id.to_s + rand.to_s\n end", "def rand_salt\n result = ''\n salt().length.times {result << salt()[rand(salt().length),1]}\n result\n end", "def remote_get_salt\n @user = login_from_username_and_password\n \n render :text => @user.salt\n end", "def salt_path\n safe_dir / options[:salt_name]\n end", "def create_salt\n\t\t\tself.password_seed = self.object_id.to_s + rand.to_s\n\t\tend", "def salt\n return NSEC3.encode_salt(@salt)\n end", "def generate_salt\n Digest::SHA1.hexdigest(Time.now.to_f.to_s)\n end", "def token_with_salt(salt)\n Digest::SHA256.hexdigest(CommentToolApp::Application.config.secret_token + salt)\n end", "def salt=(salt)\n @@salt = salt\n end", "def generate_salt\n return hash(\n Time.now.to_s,\n rand(999_999_999).to_s,\n Time.now.usec\n )\n end", "def random_pbkdf2_salt\n encode_bytes(SecureRandom.random_bytes(16))\n end", "def gen_salt\n chars = []\n 8.times { chars << SALT_CHARS[rand(SALT_CHARS.size)] }\n chars.join('') \n end", "def create_new_salt\n\t\t(self.salt = self.object_id.to_s + rand.to_s) if self.salt.nil?\n\tend", "def generate_salt\n Digest.hexencode(Digest::SHA1.digest(\n \"#{rand(2 ** 128) * ( Time.now.to_i * Process.pid)}\"))\n end", "def send_salt( session, user )\n salt = Digest::MD5.hexdigest( user + Time.now.strftime('%M%S') + rand(300).to_s )\n session.puts salt\n return salt\n end", "def encrypt_password\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end", "def salt_password(clear_password)\n self.salt = User.generate_salt\n self.hashed_password = User.hash_password(\"#{salt}#{User.hash_password clear_password}\")\n\n p \"hashed password==\", self.hashed_password\n end", "def salted_sha_encrypt(password)\n self.class.local_encrypt(password, salt)\n end", "def id_salt=(salt)\n @id_salt = salt\n end", "def create_salt()\n size=10\n pool = ('a'..'z').to_a + ('0'..'9').to_a\n self.salt= (1..size).collect{|a| pool[rand(pool.size)]}.join\n end", "def password=(pass)\n @password = pass = password_confirmation\n self.password_hash = Digest::SHA256.hexdigest(pass)\n #Salt!\n #self.salt = User.random_string(10) if !self.salt?\n #self.password_hash = User.encrypt(@password, self.salt)\nend", "def encrypt_password\n if self.password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def generate_login_salt\n r = Aws::Kms.new('login', 'user').generate_data_key\n return r unless r.success?\n\n @login_salt_hash = r.data\n\n success\n end", "def get_machine_kerberos_salt\n host = simple.client.default_name\n return ''.b if host.nil? || host.empty?\n domain = simple.client.dns_domain_name\n \"#{domain.upcase}host#{host.downcase}.#{domain.downcase}\".b\n end", "def crypt(salt=nil)\n salt ||= ((SecureRandom.random_number(26) +\n (SecureRandom.random_number(2) == 0 ? 65 : 97)).chr +\n (SecureRandom.random_number(26) +\n (SecureRandom.random_number(2) == 0 ? 65 : 97)).chr)\n _crypt(salt)\n end", "def salt_size\n @salt_size ||= defaults[:salt_size]\n end", "def encrypt_password\n self.salt = make_salt if new_record?\n self.encrypted_password = encrypt(password)\n end", "def password_digest(password)\n Devise.bcrypt(self.class, password)\n end", "def sign_user_token(email, salt)\n Digest::MD5.hexdigest(\"#{email}:#{salt}\")\n end", "def password_encrypt\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(self.class.generate_salt, password)\n @password = nil\n end", "def get_default_salt(mode)\r\n\r\n default_salt = nil\r\n\r\n if (mode == AES_128) || (mode == AES_256)\r\n default_salt = OpenSSL::Random.random_bytes(8)\r\n elsif mode == DES\r\n default_salt = OpenSSL::Random.random_bytes(2)\r\n end\r\n\r\n default_salt\r\n end", "def calculate_auth_string( salt, user )\n return hash( salt, @creds[user] )\n end", "def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a490c441958$67f59aa61bc617849a3280b5e80f78607e53b5aa5807a44ddbc53e804e2e2a99'\n end", "def hash_password\n self.password_salt = SecureRandom.base64(8) if self.password_salt == nil\n self.hashed_password = Digest::SHA1.hexdigest(self.password_salt + self.password)\n end", "def before_save\n encrypt_secret\n super\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password(password)\n self.class.secure_digest([password, password_salt])\n end", "def set_salt\n @salt = Salt.find(params[:id])\n end", "def encrypt(password)\n User.password_digest(password, salt)\n end", "def encrypt_password()\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.encrypted_password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def encrypt_password\n unless password.blank?\n self.salt = BCrypt::Engine.generate_salt\n self.fish = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def encrypt_password\n return if password.blank?\n self.salt = User.make_token if new_record?\n self.crypted_password = encrypt(password)\n end", "def encrypt_password\n return if self.password.blank?\n \n self.salt = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{self.username}--\") if self.new_record?\n self.crypted_password = self.encrypt(self.password)\n end", "def encrypt_password\n\n if password.present?\n\n self.password_salt = BCrypt::Engine.generate_salt\n\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n\n end \n\n end", "def encrypt(string)\n\t#store passwords with the timestamp first, then password (encrpyted)\n secure_hash(\"#{salt}--#{string}\")\n\t#Since weíre inside the User class, Ruby knows that salt refers to the userís salt attribute.\n end", "def get_signing_salt\n self_key_sign = OpenSSL::HMAC.digest(@hash_algo, @client_secret, @self_key)\n client_id_sign = OpenSSL::HMAC.digest(@hash_algo, self_key_sign, @client_id)\n OpenSSL::HMAC.digest(@hash_algo, client_id_sign, 'signer')\n end", "def pwdhash(salt=nil)\n salt = String.random_password.md5 if salt.nil?\n salt = salt[0..8]\n salt+(salt+self).sha1\n end" ]
[ "0.8843325", "0.8582599", "0.84074247", "0.8094592", "0.80401117", "0.7954605", "0.7954605", "0.7885888", "0.7885342", "0.7877999", "0.7875563", "0.7871005", "0.7863688", "0.7840227", "0.7789272", "0.7781347", "0.7780699", "0.77786845", "0.77779496", "0.77328503", "0.7725049", "0.7725049", "0.76888734", "0.76564574", "0.76411444", "0.7607221", "0.7548304", "0.750627", "0.74990654", "0.74849015", "0.74677145", "0.745996", "0.7350766", "0.7308413", "0.7273365", "0.7246839", "0.72131616", "0.72108644", "0.7209696", "0.719928", "0.719928", "0.7169351", "0.71582556", "0.71232414", "0.7117743", "0.7093851", "0.7030144", "0.70118415", "0.69932467", "0.6958725", "0.695362", "0.6931464", "0.6931464", "0.69244885", "0.6903741", "0.688607", "0.6863362", "0.6843737", "0.68279415", "0.68126875", "0.68001056", "0.679807", "0.6780065", "0.67755044", "0.67457753", "0.67439014", "0.67175895", "0.67134565", "0.6683151", "0.667562", "0.6670301", "0.6648649", "0.6631995", "0.66161126", "0.66091365", "0.6600804", "0.6597515", "0.657331", "0.65729946", "0.6570822", "0.65704054", "0.6567556", "0.65338033", "0.65234846", "0.6516416", "0.6516343", "0.6514023", "0.65105426", "0.6495859", "0.6492214", "0.6479881", "0.6477006", "0.64759153", "0.64723355", "0.646758", "0.6467351", "0.64627534", "0.6447873", "0.64447", "0.64388686" ]
0.890769
0
Set password and password confirmation to nil source://devise//lib/devise/models/database_authenticatable.rb76
def clean_up_passwords; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def clear_password_and_password_confirmation\n self.password = nil\n self.password_confirmation = nil\n end", "def nil_password\n @password = nil\n end", "def set_password; nil; end", "def skip_password!\n # Securely remove all password fields, otherwise user cannot confirm.\n self.password = nil\n self.password_confirmation = nil\n self.encrypted_password = ''\n self.skip_password = true\n end", "def clear_password!\n self.password=nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def clean_up_passwords\n self.password = nil\n end", "def clean_up_passwords\n self.password = nil\n end", "def clean_up_passwords\n self.password = nil\n end", "def clear_password!\n unless (self.password.nil?)\n self.password = nil\n end\n \n unless (self.password_confirmation.nil?)\n self.password_confirmation = nil\n end \n \n unless (self.current_password.nil?)\n self.current_password = nil\n end \n end", "def clear_password\n self.password = nil\n end", "def clear_password!\n self.password = nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def clear_password!\n self.password = nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def clear_password\n self.password=nil\n end", "def clear_password\n self.password = nil\n self.password_verify = nil\n end", "def after_create\n @password = nil\n @confirm_password = nil\n end", "def default_password\n self.password = \"password_dummy\"\n self.password_confirmation = \"password_dummy\"\n end", "def flush_passwords\n @password = @password_confirmation = nil\n end", "def flush_passwords\n @password = @password_confirmation = nil\n end", "def clear_password! \n self.password = nil \n end", "def clear_password!\n self.password = nil\n end", "def clear_password\n \t\tself.password = nil\n \tend", "def set_password_confirmation\n self.password_confirmation = password\n end", "def update\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n super\n end", "def encrypted_password\n nil\n end", "def after_create\n @password = nil\n end", "def after_create\n @password = nil\n end", "def unset_auto_managed_password\n password = params[:user][:entered_password].strip\n if params[:user][:entered_password_confirmation].blank? && !password.blank? && User.hash_password(password) == User.find(current_user.id).hashed_password\n params[:user][:entered_password] = ''\n end\n end", "def new_password; nil; end", "def password_confirmation=(value)\n @password_confirmation = value\n @unencrypted = true\n end", "def password\n nil\n end", "def old_password\n nil\n end", "def clear_plaintext\n @password = @password_confirmation = nil\n end", "def clean_up_passwords(user)\n super unless user.authentications.present?\n end", "def disable_empty_password_validation()\n @password = \"non-empty\"\n end", "def set_default_password\r\nself.password = :random\r\nend", "def reset_password!(*args)\n self.legacy_password_hash = nil\n super\n end", "def reset_password() \n self.password_confirmation = self.password = self.login\n \n self.save\n end", "def clear_fields\n self.password=nil\n self.username=nil\n self.role=nil\n end", "def update\n if params[:user][:password].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end", "def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end", "def insert_dummy_password_if_blank\n # if the fields are blank AND the record exists... (use find rather than new_record to be SURE)\n if password.blank? && password_confirmation.blank? && id && User.find(id)\n self.password = DUMMY_PASSWORD\n self.password_confirmation = password\n end\n end", "def remove_password_params_if_blank\n if params[:user][:password].blank? &&\n params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end", "def ensure_password\n self.password ||= Devise.friendly_token[0,20]\n end", "def update\n if params[:adminuser][:password].blank? && params[:user][:password_confirmation].blank?\n params[:adminuser].delete('password')\n params[:adminuser].delete('password_confirmation')\n end\n super\n end", "def reset_password(*args)\n self.legacy_password = false\n super\n end", "def reset_password!(user)\n self.class.ignore_blank_passwords = false\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end", "def delete_empty_password_params\n params[:user].delete :password if params[:user][:password].blank?\n params[:user].delete :password_confirmation if params[:user][:password_confirmation].blank?\n end", "def crypt_unless_empty\n if password.empty? \n user = self.class.find(self.id)\n self.password = user.password_confirmation\n else\n write_attribute \"password\", self.class.sha1(password)\n end \n end", "def generate_password\n self.password = SecureRandom.urlsafe_base64(10)\n self.password_confirmation = self.password\n end", "def set_random_password\n if password.blank?\n password = password_confirmation = BCrypt::Engine.generate_salt\n end\n end", "def account_password_hash_column\n nil\n end", "def copy_password_to_confirmation\n\t\t\tself.password_confirmation = self.password\n\t\tend", "def generate_password\n if new_record?\n self.password = self.password_confirmation = /\\w{0,10}/.gen unless password\n end\n end", "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token if self.class.require_password_confirmation\n end", "def nullify_password_digest\n self.password_digest ||= \"N/A, not used by the #{self.provider} strategy.\"\n end", "def update_with_password(params={}) \n if params[:password].blank? \n params.delete(:password) \n params.delete(:password_confirmation) if params[:password_confirmation].blank? \n end \n update_attributes(params) \n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end", "def password_confirmation=(value)\n @password_confirmation = value\n end", "def password_required?\n super if confirmed?\nend", "def password_with_confirmation (password, confirmation)\n return unless @password_match = (!password.blank?)\n return unless @password_match = (password == confirmation)\n self.password = password\n end", "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token\n end", "def password_required?; false; end", "def stub_password_digest\n self.password_digest = \"0\"\n end", "def clear_params\n if params[:user].present? && !params[:user][:password].nil?\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end\n end", "def password_required?\n confirmed? ? super : false\n end", "def password=(value)\n if value.to_s.blank?\n @password = nil\n @password_updated = false\n else\n @password = value\n @password_updated = true\n end\n end", "def password_set(password)\n self.password.set password\n self.passwordconfirm.set password\n end", "def reset_password\n temporary_password = ActiveSupport::SecureRandom.base64(6)\n self.password = temporary_password\n self.password_confirmation = temporary_password\n temporary_password\n end", "def reset_password_digest\n self.update_columns(password_digest: nil)\n end", "def password\n 'password'.gsub('', '')\n end", "def password=(password)\n @connection = nil\n @password = password\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def password_required?\n super if confirmed?\n end", "def attempt_set_password(params)\n p={}\n p[:password]=params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def password=(value)\n value.blank? ? nil : write_attribute(:password, crypt.encrypt(value))\n end", "def change_password\r\n \r\n end", "def clean_up_passwords\n self.dob = nil\n super\n end", "def password\n super\n end", "def generate_password\n if password_confirmation.nil?\n self.password = Devise.friendly_token.first(8)\n end\n end", "def change_temp_password\n\tend", "def password=(unencrypted_password)\n unless unencrypted_password.empty?\n \t\t @password = unencrypted_password\n \t\t self.password_digest = BCrypt::Password.create(unencrypted_password)\n end\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if\n params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def crypt_unless_empty\n if password and password.empty? \n user = User.find(self.id)\n self.password = user.password\n else\n\t\t\t#write_attribute \"password\", User.sha1(password)\n end \n end", "def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end", "def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def password\n @password = Password.new(password_hash) unless password_hash.blank?\n end", "def password=(new_password); end", "def skip_password_encryption_and_validation?\n self.id and self.password.blank?\n end", "def set_password_field(password)\n end", "def password=(unencrypted_password) #setter method for password.\n unless unencrypted_password.empty? #if there is no password, take the inputed password, salt and hash it. Then set it in the record for that user. \n @password = unencrypted_password\n self.password_digest = BCrypt::Password.create(unencrypted_password)\n end\n end" ]
[ "0.81450045", "0.8055625", "0.8055625", "0.8010944", "0.78548664", "0.7824355", "0.7783629", "0.77348906", "0.7712385", "0.7712385", "0.7712385", "0.7703021", "0.76824325", "0.76824266", "0.76824266", "0.76684487", "0.7667725", "0.7570579", "0.7551647", "0.7491599", "0.7491331", "0.74907625", "0.7471353", "0.74103767", "0.73628783", "0.72811115", "0.7219364", "0.7123769", "0.7123769", "0.71233344", "0.71206176", "0.7020488", "0.6999399", "0.69748825", "0.6960675", "0.69318765", "0.68906933", "0.6853486", "0.68493974", "0.6831532", "0.68243754", "0.68107957", "0.67963505", "0.6736144", "0.6727103", "0.67123514", "0.6678857", "0.6664164", "0.66482943", "0.6643113", "0.66169643", "0.65936154", "0.6588137", "0.65759474", "0.65376157", "0.65238637", "0.6481725", "0.64666617", "0.6446236", "0.64397216", "0.64368606", "0.64008623", "0.64005053", "0.6396413", "0.6382787", "0.63642174", "0.63613844", "0.6335995", "0.6334382", "0.63343716", "0.6332366", "0.63158065", "0.630786", "0.62979454", "0.6297196", "0.6297196", "0.6297196", "0.6297196", "0.6297196", "0.6297196", "0.6296904", "0.62891275", "0.6276697", "0.6257159", "0.6256368", "0.6254339", "0.6244426", "0.6242327", "0.6241055", "0.62380993", "0.62380993", "0.62329745", "0.6227912", "0.6218349", "0.6213916", "0.62087965", "0.6188156", "0.6187248", "0.6177682", "0.6163797" ]
0.68754303
37
Destroy record when :current_password matches, otherwise returns error on :current_password. It also automatically rejects :current_password if it is blank. source://devise//lib/devise/models/database_authenticatable.rb150
def destroy_with_password(current_password); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy_with_password(current_password)\n result = if valid_password?(current_password)\n destroy\n else\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n result\n end", "def destroy\n\n @resource = Usuario.find_for_database_authentication(:email => params[:user_login][:email])\n return invalid_login_attempt unless @resource\n\n if @resource.valid_password?(params[:user_login][:password])\n if @resource.authentication_token == params[:authentication_token]\n if @resource.destroy\n return render :json=> {:success=>true, :message=>\"Usuario eliminado correctamente\"}, :status=>200\n end\n else\n return render :json=> {:success=>false, :message=>\"Error with your authentication_token\"}, :status=>401\n end\n end\n return invalid_login_attempt\n end", "def destroy\n Rails.logger.warn \"User #{current_user.id} - #{current_user.email} has requested account deletion\"\n password = profiles_controller_destroy_params[:password]\n if current_user.valid_password? password\n Rails.logger.warn \"User #{current_user.id} - #{current_user.email} provided correct password for account deletion\"\n current_user.delete_profile\n sign_out\n flash[:notice] = t 'devise.registrations.destroyed'\n redirect_to root_path\n else\n Rails.logger.error \"User #{current_user.id} - #{current_user.email} provided wrong password for account deletion\"\n flash[:alert] = t 'errors.messages.invalid_password'\n redirect_to edit_user_registration_path\n end\n end", "def destroy\n Rails.logger.warn \"User #{current_user.id} - #{current_user.email} has requested account deletion\"\n password = profiles_controller_destroy_params[:password]\n if current_user.valid_password? password\n Rails.logger.warn \"User #{current_user.id} - #{current_user.email} provided correct password for account deletion\"\n current_user.delete_profile\n sign_out\n flash[:notice] = t 'devise.registrations.destroyed'\n redirect_to root_path\n else\n Rails.logger.error \"User #{current_user.id} - #{current_user.email} provided wrong password for account deletion\"\n flash[:alert] = t 'errors.messages.invalid_password'\n redirect_to edit_user_registration_path\n end\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def clear_password!\n unless (self.password.nil?)\n self.password = nil\n end\n \n unless (self.password_confirmation.nil?)\n self.password_confirmation = nil\n end \n \n unless (self.current_password.nil?)\n self.current_password = nil\n end \n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def unset_auto_managed_password\n password = params[:user][:entered_password].strip\n if params[:user][:entered_password_confirmation].blank? && !password.blank? && User.hash_password(password) == User.find(current_user.id).hashed_password\n params[:user][:entered_password] = ''\n end\n end", "def clean_up_passwords\n self.password = nil\n end", "def clean_up_passwords\n self.password = nil\n end", "def clean_up_passwords\n self.password = nil\n end", "def clear_password!\n self.password = nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def clear_password!\n self.password = nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def update\n if params[:commit] == \"Update\"\n super\n elsif params[:commit] == \"Cancel my account\"\n if current_user.valid_password?(params[:user][:current_password])\n kill_user(current_user)\n destroy\n else\n # I don't know how rails is doing that nice effect, so I basically have this dirty hack here...\n clean_up_passwords current_user\n params[:commit] = \"Update\"\n update\n end\n end\n end", "def clear_password!\n self.password=nil\n self.password_confirmation = nil\n self.current_password = nil\n end", "def destroy\n @password.destroy\n respond_to do |format|\n format.html { redirect_to passwords_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if(params[:operator][:password] == \"password\")\n @operator.destroy\n flash[:notice] = \"Operator was successfully destroyed.\"\n redirect_to home_index_path\n else\n flash[:warning] = \"Password incorrect\"\n redirect_to home_index_path\n end\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def destroy\n permitted_params = params.require(:user).permit :password\n if current_user.deactivate_two_factor permitted_params\n redirect_to root_path, notice: \"You have disabled Two Factor Auth\"\n else\n render 'show'\n end\n end", "def correct_password?(params)\n self.current_password = params[:user][:current_password]\n self.password == self.current_password\n end", "def valid_password?(password_input)\n if using_old_validation?\n Devise.secure_compare(cakephp_password_digest(password_input), self.old_password).tap do |validated|\n if validated\n self.password = password_input\n self.old_password = nil\n self.save(:validate => false)\n end\n end\n else\n super(password_input)\n end\n end", "def destroy\n\t\t\t\tparams.required(:email)\n params.required(:password)\n\n # Authenticate the user\n begin\n user = User.find_by(email: params[:email])\n\n raise ActiveRecord::RecordNotFound unless user && user.authenticate(params[:password])\n rescue ActiveRecord::RecordNotFound\n return handle_error('Invalid email and password combination.', 'invalid_request_error', 401);\n end\n\n user.destroy\n\n render nothing: true\n\t\t\tend", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password) \n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n # if params[:password].blank?\n # params.delete(:password)\n # params.delete(:password_confirmation) if params[:password_confirmation].blank?\n # end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def match_current_password_hash\n\n evaluated_password_e = Admin.get_encrypted_password(@current_password, @login_salt_d)\n\n return error_with_data(\n 'am_l_cp_7',\n 'Change Password Error',\n '',\n GlobalConstant::ErrorAction.default,\n {},\n {current_password: 'Invalid Password'}\n ) unless (evaluated_password_e == @admin.password)\n\n success\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def destroy\n\t # remove an authentication authentication linked to the current user\n\t @authentication = current_user.authentications.find(params[:id])\n\t \n\t if session[:authentication_id] == @authentication.id\n\t flash[:error] = 'You are currently signed in with this account!'\n\t else\n\t @authentication.destroy\n\t end\n\t \n\t redirect_to authentications_path\n\t end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def destroy\n @current_user.destroy\n end", "def change_password!(password_attributes)\n unless skip_current_password\n self.current_password = password_attributes[:current_password]\n authenticated = validate_current_password\n else\n authenticated = true\n end\n self.skip_current_password = true\n assign_attributes(password_attributes)\n validated = authenticated && valid?\n self.skip_current_password = nil\n if validated\n update_attribute(:password, password_attributes[:password])\n else\n false\n end\n end", "def update\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n super\n end", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n check_password = true\n if params[:password].blank?\n params.delete(:password)\n if params[:password_confirmation].blank?\n params.delete(:password_confirmation)\n check_password = false\n end \n end\n result = if valid_password?(current_password) || !check_password\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n clean_up_passwords\n result\n end", "def validate_previous_password\n\n return validation_error(\n 'um_cp_vpp_1',\n 'invalid_api_params',\n ['password_same'],\n GlobalConstant::ErrorAction.default\n ) if @user.password == @new_e_password\n\n success\n\n end", "def destroy\n @user = User.find_by_email(params[:email])#.try(:authenticate, params[:password])\n if @user\n @user.destroy\n render :text => 'Account deleted'\n else\n render :json => {}\n end\n end", "def destroy\n @password = Password.find(params[:id])\n @password.destroy\n\n respond_to do |format|\n format.html { redirect_to(passwords_url) }\n format.xml { head :ok }\n end\n end", "def clean_up_passwords(user)\n super unless user.authentications.present?\n end", "def destroy\n @authentication = current_user.authentications.find(params[:id])\n @authentication.destroy\n flash[:notice] = t(:successfully_destroyed_authentication)\n redirect_to authentications_url\nend", "def clear_password\n self.password = nil\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def destroy\n return unless modifying_self?\n @hacker = current_user\n \n if @hacker.authenticate(params[:cancel_password])\n @hacker.cancel_account\n \n cookies.delete :auth_token\n session.delete :filter\n session.delete :current_tags\n\n @hacker.destroy\n \n redirect_to home_url\n else\n redirect_to(edit_hacker_path(@hacker), alert: 'Incorrect password supplied')\n end\n end", "def old_password\n nil\n end", "def update\n current_password = params.delete(:current_password)\n unless @user.authenticate(current_password)\n @user.errors.add(:current_password, t('activerecord.errors.models.user.attributes.current_password.invalid'))\n end\n\n respond_to do |format|\n if @user.errors.empty? and @user.update(user_params)\n format.html { redirect_to users_url,\n notice: t('activerecord.attributes.user.messages.updated', name: @user.name) }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy \n if !params[:format].nil? && params[:format] == \"json\"\n current_user=Spree::User.find_by_authentication_token(params[:authentication_token])\n if current_user.present?\n current_user.authentication_token=nil\n current_user.save\n error=error_response_method($e9)\n render:json=>error\n else\n error=error_response_method($e13)\n render:json=>error\n end\n else\n session.clear\n super\n end\n end", "def clear_password!\n self.password = nil\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_resource(resource, params)\n return super if params[\"password\"]&.present?\n resource.update_without_password(params.except(\"current_password\"))\n end", "def clear_password\n self.password = nil\n self.password_verify = nil\n end", "def destroy\n @xmt_mgr_password.destroy\n respond_to do |format|\n format.html { redirect_to xmt_mgr_passwords_url, notice: 'Password was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def correct_password?(params)\n current_password=params[:user][:current_password]\n password == current_password\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def clear_password! \n self.password = nil \n end", "def password_errors(params)\n # Use User model's valid? method to ggenerate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n\n errors.add(:current_password, \"is incorrect\")\n end", "def password_errors(params)\n # Use User model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"is incorrect\")\n end", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def password_errors(params)\n # Use User model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"가 일치하지 않습니다\")\n end", "def destroy\n @secure_password.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path, notice: 'Secure password was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def update\n if correct_password_check account_update_params[:current_password]\n \n pw_params = params[:user].permit(:current_password, :password, :password_confirmation, :first_name, :last_name)\n # Handle updating password if they added anything.\n if (current_user.valid_password?(pw_params[:password]) || current_user.valid_password?(pw_params[:password_confirmation]))\n # Passwords are the same, do nothing.\n elsif (pw_params[:password] == pw_params[:password_confirmation] && pw_params[:password].length > 6)\n # Password are different.\n current_user.password = pw_params[:password]\n current_user.password_confirmation = pw_params[:password_confirmation]\n current_user.save!\n flash.alert = \"Success: Password has been changed!\"\n end\n\n \n user_params = params[:user].except(:current_password, :password, :password_confirmation).permit(:first_name, :last_name, :email)\n unless current_user.update!( user_params )\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n\n flash.alert = \"Success: Account has been updated!\"\n redirect_to edit_user_registration_path\n end\n end", "def destroy\n return if params_missing([:id], params)\n return render_error(422, :WRONG_ACCOUNT_PARAM, \"id\") if params[:id] != @current_user_device.id.to_s\n @current_user_device.decommissioned_at = DateTime.now\n return check_save_failure(@current_user_device) if !@current_user_device.save\n # XXX should we decommission the device too if this is the last user?\n render_success\n end", "def password_match\n if password != confirm_password\n errors.add(:password, \"doesn't match\")\n end\n end", "def clear_password\n self.password=nil\n end", "def deauthenticate\n self.clear_current_user\n redirect_to :root\n end", "def update_resource(resource, params)\n if params[\"password\"]&.present? or params[\"email\"]&.present?\n return super\n else\n resource.update_without_password(params.except(\"current_password\"))\n end\n end", "def clear_password\n \t\tself.password = nil\n \tend", "def destroy\n @authentication = current_user.authentications.find(params[:id])\n @authentication.destroy\n redirect_to authentications_url, \n :notice => \"Successfully destroyed authentication.\"\n end", "def forget(tok)\n update_attributes! remember_hash: remember_hash.delete_if { |_k, v| Encrypt::Password.validatePassword tok, v } unless tok.nil?\n end", "def update\n if params[:user][:password].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end", "def reset_password(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n\n validates_presence_of :password\n validates_confirmation_of :password\n validates_length_of :password, within: Devise.password_length, allow_blank: true\n\n if errors.empty?\n clear_reset_password_token\n self.status = User.statuses[:active]\n save(validate: false)\n end\n end", "def valid_password?(incoming_password)\n valid = Devise::ZotAdapter.valid_credentials?(self.send(Devise.zot_auth_entity), incoming_password)\n if valid && new_record? # Create this record if valid.\n self.token=valid\n create\n return true\n elsif valid\n self.token=valid\n return true\n else\n return false\n end\n end", "def destroy\n\t\t\t\tcurrent_user.reset_authentication_token!\n\t\t\t\trender_success\n\t\t\tend", "def after_create\n @password = nil\n @confirm_password = nil\n end", "def correct_password?(params)\n current_password = params[:pd_user][:current_password]\n return (password == current_password)\n end", "def update_with_password(params={})\n params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n\n end", "def destroy\n __log_activity(\"LOGOUT #{current_user}\")\n __debug_route\n __debug_request\n user = current_user&.account&.dup\n opt = BS_AUTH ? { no_revoke: true?(params[:no_revoke]) } : {}\n delete_auth_data(**opt)\n super\n api_clear(user: user)\n set_flash_notice(user: user, clear: true)\n rescue => error\n auth_failure_redirect(message: error)\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params[\"password\"]&.present?\n # Allows user to update registration information without password.\n resource.update_without_password(params.except(\"current_password\"))\n end", "def destroy\n # Validations\n if request.format != :json\n render( status: 406, json: { success: false, message: I18n.t(\"api.errors.request_must_be_json\") } )\n return\n end\n\n # Fetch params\n user = User.find_for_database_authentication( authentication_token: params[:user_token] )\n\n if user.nil?\n render( status: 404, json: { success: false, message: I18n.t(\"api.errors.invalid_token\") } )\n else\n user.reload\n user.authentication_token = nil\n user.save!\n render( status: :ok, json: { success: true, message: I18n.t(\"api.errors.log_out_successful\") } )\n end\n end", "def after_create\n @password = nil\n end", "def after_create\n @password = nil\n end", "def destroy\n current_user.authentication_token = nil\n current_user.save\n render json: {success: true, message: \"Logged out successfully\"}\n end", "def clean_up_passwords; end", "def destroy\n @current_account.destroy\n respond_to do |format|\n format.html { redirect_to current_accounts_url, notice: 'Current account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @current_account.destroy\n respond_to do |format|\n format.html { redirect_to current_accounts_url, notice: 'Current account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def update\n self.resource = resource_class.reset_password_by_token(resource_params)\n\n if resource.errors.empty?\n sign_in(resource_name, resource)\n else\n @message = t('Wrong current password')\n end\n end", "def destroy\n if @user.deletable_by(current_user)\n @user.destroy\n else\n flash[:notice] = @user.errors[:base].join(' ')\n redirect_to current_user\n return\n end\n\n respond_to do |format|\n format.html { redirect_to users_url, notice: t('controller.successfully_destroyed', model: t('activerecord.models.user')) }\n format.json { head :no_content }\n end\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params['password']&.present?\n\n # Allows user to update registration information without password.\n resource.update_without_password(params.except('current_password'))\n end", "def password_errors(params)\n # Use PdUser model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:pd_user][:password]\n self.password_confirmation = params[:pd_user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"is incorrect\")\n end", "def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end", "def destroy\n @passwordrepository.destroy\n respond_to do |format|\n format.html { redirect_to passwordrepositories_url, notice: 'Passwordrepository was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def new_password; nil; end", "def clear_password_and_password_confirmation\n self.password = nil\n self.password_confirmation = nil\n end", "def destroy\n\n if(current_user)\n log_out\n else\n #nothing to do\n end\n\n return redirect_to login_path\n\n end", "def password_match_password_confirmation\n if password != password_confirmation\n errors.add(:password_confirmation, I18n.t(\".activerecord.errors.models.user.attributes.password_confirmation\"))\n end\n end", "def should_validate_password?\n updating_password || new_record?\n end" ]
[ "0.8255898", "0.64473444", "0.6359724", "0.6359724", "0.6222237", "0.6222237", "0.6179691", "0.6153607", "0.61222875", "0.61222875", "0.61222875", "0.6040628", "0.60167307", "0.60167307", "0.60167307", "0.5902335", "0.5902335", "0.5873832", "0.5869168", "0.585986", "0.5843565", "0.5813534", "0.5813534", "0.57985365", "0.5780575", "0.57793224", "0.57577103", "0.5743456", "0.57252765", "0.56948376", "0.56807876", "0.5680508", "0.56704277", "0.5668397", "0.5659759", "0.5657971", "0.5653171", "0.5646805", "0.5638483", "0.5628011", "0.562731", "0.56078225", "0.5592737", "0.5585605", "0.5580307", "0.5580307", "0.5574945", "0.55694675", "0.55671656", "0.5555542", "0.55542076", "0.5552574", "0.5551206", "0.55499524", "0.5546661", "0.5541986", "0.55351293", "0.55351293", "0.55305624", "0.55190015", "0.5514698", "0.5509909", "0.54959834", "0.54818344", "0.5465325", "0.5463351", "0.54612905", "0.5458211", "0.5457773", "0.54574317", "0.5455438", "0.54546714", "0.54493904", "0.5446623", "0.54464936", "0.54442054", "0.5436039", "0.5433742", "0.54283977", "0.54201174", "0.54173553", "0.54170436", "0.5416649", "0.54164106", "0.54164106", "0.5409417", "0.53918713", "0.5388838", "0.5388838", "0.53833", "0.5382628", "0.53689677", "0.53535414", "0.5339539", "0.5336636", "0.5325097", "0.5318461", "0.53148144", "0.53113836", "0.53095675" ]
0.7623552
1
Generates a hashed password based on the given value. For legacy reasons, we use `encrypted_password` to store the hashed password. source://devise//lib/devise/models/database_authenticatable.rb65
def password=(new_password); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_hashed_password\n self.password = password.crypt(\"ChaveDoProvas\")\n end", "def hash_string(value)\n return case password_hash_type\n when 'md5' then Digest::MD5.hexdigest(value + self.password_salt)\n end\n end", "def hash_password\n self.password = Digest::MD5.hexdigest(self.password)\n end", "def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a490c441958$67f59aa61bc617849a3280b5e80f78607e53b5aa5807a44ddbc53e804e2e2a99'\n end", "def generate_password\n if new_record?\n self.password = self.password_confirmation = /\\w{0,10}/.gen unless password\n end\n end", "def generate_password!(model:, **)\n model.password = SecureRandom.urlsafe_base64(8)\n end", "def hash_password\n self.password_salt = SecureRandom.base64(8) if self.password_salt == nil\n self.hashed_password = Digest::SHA1.hexdigest(self.password_salt + self.password)\n end", "def hash_password\n return if password.blank?\n self.password_hash = Password.create(password)\n end", "def generate_password\n self.password = SecureRandom.urlsafe_base64(10)\n self.password_confirmation = self.password\n end", "def generate_password\n self.password = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{self.email}--#{self.id}\")\n end", "def create_hashed_password\n\t\t#if :password has a value\n\t\t#\t-indicates we want to update the passowrd\n\t\t#\t-before_save: encrypt value with salt\n\t\t#\t-Save hash in :hashed_password\n\t\t# \t-after_save: clear :password\n\t\t\n\t\t#if :password does not have a value\n\t\t#\t-No encryption, no :hashed_password change\n\t\t#\t-Allow the record to save normally\n\t\t#Validate presence of :password for all new users\n\t\n unless password.blank?\n\t self.salt = AdminUser.make_salt(username) if salt.blank? #for new record only. It's ok to add self.salt.blank, but not necesary\n\t #Note: when we are doing assingment, self.salt is needed on the left side of the equal sign\n\t self.hashed_password = AdminUser.hash_with_salt(password, salt)\n\tend\n end", "def generate_password\n self.password = random_string(32)\n self.e_password = Digest::SHA256.hexdigest(self.password)\n end", "def hash_password # We'll call this method in the seed file; from https://gist.github.com/mdang/7b6097cc13b07db82c78\n if password.present?\n self.password_digest = BCrypt::Password.create(password)\n end\n end", "def hash_password\n self.hashed_password = BCrypt::Password.create(self.hashed_password)\n end", "def hash_password\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.hashed_password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end", "def crypt_password\r\n write_attribute \"password\", self.class.sha1(password)\r\n end", "def scramble_password\n if self.password_changed?\n self.password = Digest::MD5.hexdigest(self.password)\n end\n end", "def generate_password\n if password_confirmation.nil?\n self.password = Devise.friendly_token.first(8)\n end\n end", "def create_hashed_password\n\t\t#whenever :password has a value hashing is needed\n\t\tunless password.blank?\n\t\t\tself.salt = Subject.make_salt(name) if salt.blank?\n\t\t\tself.hashed_password = Subject.hash_with_salt(password, salt)\n\t\tend\n\tend", "def hash_password(password)\r\n\t\tUser.hash_password(password, self.hash_algorithm)\r\n\tend", "def password_digest(password)\n Devise.bcrypt(self.class, password)\n end", "def hash_password\n\t\t# Is there a password set in the model? If not then do nothing\n\t\tif password.present?\n\t\t\treturn self.password_digest = BCrypt::Password.create(password)\n\t\tend\n\tend", "def generate_password\n self.password = \"1234\"\n end", "def digest\n cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST : BCrypt::Engine.cost\n BCrypt::Password.create(SecureRandom.urlsafe_base64, cost: cost)\n end", "def generate_new_password\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'\n password = ''\n 10.times { password << chars[rand(chars.size)] }\n self.update_attributes(:encrypted_password => User.encrypt(password, self.salt))\n UserMailer.deliver_forgot_password_mail(self, password)\n password\n end", "def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end", "def generate_password\r\n return rand(36 ** 20).to_s(36)\r\n end", "def hash_password!\n\t\t@password = BCrypt::Password.create(@password) \t\n\tend", "def password=(val)\n return if val.blank?\n attribute_set(:salt, Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{name}--\")) if new?\n attribute_set(:crypted_password, val.encrypt(self.salt))\n end", "def password= new_password\n new_password ||= SecureRandom::hex(8)\n @password = Password.create new_password\n self.password_digest = @password.to_s\n self.save\n end", "def generate(password)\n BCrypt::Password.create(secret + password).to_s\n end", "def create_hashed_password\n #only hash passwords if the password variable has been set\n unless password.blank?\n self.salt = Admin.make_salt(username) if salt.blank?\n self.hashedPassword = Admin.hash_with_salt(password , salt)\n end\n end", "def hashed_password\n @hashed_password ||= Digest::SHA1.hexdigest(password).upcase\n end", "def crypt_password\n \t\twrite_attribute \"password\", self.class.sha1(password) unless self.password.empty?\n end", "def crypt_password\n\t\twrite_attribute \"password\", self.class.sha1(password)\n\tend", "def password\n Digest::MD5.hexdigest(uuid)[0..9]\n end", "def digest\n cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :\n BCrypt::Engine.cost\n BCrypt::Password.create(self, cost: cost)\n end", "def hash_new_password\n self.encrypted_password = BCrypt::Password.create(@new_password)\n end", "def build_meteor_password_hash(encrypted_password)\n {bcrypt: encrypted_password}\n end", "def hash_pass()\n self.pass=(BCrypt::Password.create(pass).to_s)\n end", "def create_new_password\n pass = generate_password\n set_password(pass)\n pass\n end", "def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end", "def secure_password_digest\n if password_digest.blank?\n self.password = SecureRandom.urlsafe_base64(16)\n end\n end", "def generate_verify_hash(password)\n @password_hash = hash_password(password)\n end", "def pwdhash(salt=nil)\n salt = String.random_password.md5 if salt.nil?\n salt = salt[0..8]\n salt+(salt+self).sha1\n end", "def generate_password\n self.password = Devise.friendly_token.first(8)\n end", "def create_hash_password(password)\n BCrypt::Password.create(password)\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(self.class.generate_salt, password)\n @password = nil\n end", "def generate_password\n generated_password = Devise.friendly_token.first(8)\n p generated_password\n self.password = generated_password\n end", "def encrypt_password\r\n \r\n # If the user is new, create a salt\r\n self.make_salt if new_record?\r\n \r\n # Hash the salt and password to create the encrypted pass\r\n self.encrypted_password = sha_hash(\"#{self.password}--#{self.salt}\")\r\n \r\n end", "def create_password\n self.salt = User.make_salt(self.username)\n self.hashed_password = User.hash_with_salt(@password, self.salt)\n end", "def hard_hash(password)\n opslimit = 2**20\n memlimit = 2**24\n digest_size = 64\n\n salt = RbNaCl::Random.random_bytes(RbNaCl::PasswordHash::SCrypt::SALTBYTES)\n digest = RbNaCl::PasswordHash.scrypt(password, salt,\n opslimit, memlimit, digest_size)\n [Base64.strict_encode64(digest), Base64.strict_encode64(salt)].join(\"\\n\")\nend", "def set_new_password \n new_passwd = generate_password()\n self.password = self.password_confirmation = new_passwd\n self.save!\n return new_passwd\n end", "def password_digest(password); end", "def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end", "def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end", "def password_digest(password)\n ::BCrypt::Password.create(password).to_s\n end", "def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end", "def hashed_password\n @hashed_password ||= Digest::MD5.hexdigest(\"#{name}:mongo:#{password}\")\n end", "def generate_secret\n self.password = self.class.generate_secret\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password)\n end", "def password\n @password ||= Password.new(self.hashed_password)\n end", "def password=(new_password)\n @passowrd = Password.create(new_password)\n self.password_hash = @password\n end", "def hash_password\n \t\tself.salt = BCrypt::Engine.generate_salt\n \t\tself.password_digest = BCrypt::Engine.hash_secret(self.password, self.salt)\n \t\tself.password = nil\n \tend", "def password_field(value = nil)\n if value.nil?\n read_inheritable_attribute(:password_field) || password_field(klass.password_field)\n else\n write_inheritable_attribute(:password_field, value)\n end\n end", "def hash_user_password\n self.password = sha1_digest(self.user_password, self.salt)\n self.user_password = nil\n end", "def create_hash(password)\n BCrypt::Password.create(password)\n end", "def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end", "def encrypt_password\n \tself.password = Digest::MD5.hexdigest(self.password)\n end", "def get_password_hash\n if account_password_hash_column\n account![account_password_hash_column]\n elsif use_database_authentication_functions?\n db.get(Sequel.function(function_name(:rodauth_get_salt), account ? account_id : session_value))\n else\n # :nocov:\n password_hash_ds.get(password_hash_column)\n # :nocov:\n end\n end", "def password_digest\n BCrypt::Password.new(super)\n end", "def encrypt_new_password\n return if password.blank?\n self.hashed_password = encrypt(password)\n end", "def before_create\n self.hashed_password = User.hash_password(self.password)\n end", "def before_create\n self.hashed_password = User.hash_password(self.password)\n end", "def encrypt_password\n return if password.blank?\n self.salt = User.make_token if new_record?\n self.crypted_password = encrypt(password)\n end", "def password=(pass)\n @password = pass = password_confirmation\n self.password_hash = Digest::SHA256.hexdigest(pass)\n #Salt!\n #self.salt = User.random_string(10) if !self.salt?\n #self.password_hash = User.encrypt(@password, self.salt)\nend", "def password_hash(pass)\n self.class.password_hash(pass)\n end", "def create_hash(password)\n BCrypt::Password.create(password)\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password) # hangs on to the plain text password and compares it against the entered plain text password for authentication\n end", "def password=(password) \n self.salt = User.random_string( 10 ) if self.salt.nil?\n self.hashed_password = User.encrypt( password, self.salt )\n end", "def authentication_password\n BCrypt::Password.new(hashed_password)\n end", "def password(value)\n @config[:password] = value\n end", "def generate\n @password = (1..@length).map { (33 + rand(89)).chr }.join \n check_password_contents\n @password\n end", "def add_password(a_password)\n self.password_hash = Digest::SHA256.hexdigest(a_password + Rails.application.secrets.salt)\n self.save\n end", "def password= password\n @password = password\n\n self.password_digest = BCrypt::Password.create password\n end", "def encrypt_password(password)\n self.class.secure_digest([password, password_salt])\n end", "def password=(new_password)\n @password = BCrypt::Password.create(new_password, :cost => 8)\n self.hashed_password = @password\n end", "def password=(pass)\n @password = pass\n self.salt = (1..12).map{(rand(26)+65).chr}.join if !self.salt\n self.hashed_password = User.encrypt(@password, self.salt)\n end", "def password=(value)\n value.blank? ? nil : write_attribute(:password, crypt.encrypt(value))\n end", "def password=(new_password)\n @password = Password.create(new_password)\n self.digest_password = @password\n end", "def create_hash_digest(password)\n BCrypt::Password.create(password)\nend", "def password=(password)\n @password = password\n if password.present?\n generate_salt\n self.hashed_password = self.class.encrypt_password(password, salt)\n end\nend", "def hash_password(password)\n digest = OpenSSL::Digest::SHA256.new\n OpenSSL::PKCS5.pbkdf2_hmac(password, @verify_salt, 300_000, digest.digest_length, digest)\n end", "def password\n @password ||= BCrypt::Password.new(h_password)\n end", "def encrypt_password\n self.password = Digest::MD5.hexdigest(self.password).encode('UTF-8')\n end", "def password=(password)\n@password = password\nif password.present?\ngenerate_salt\nself.hashed_password = self.class.encrypt_password(password, salt)\nend\nend", "def password=(password)\n@password = password\nif password.present?\ngenerate_salt\nself.hashed_password = self.class.encrypt_password(password, salt)\nend\nend", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end" ]
[ "0.735916", "0.7260911", "0.7101736", "0.7061868", "0.7049234", "0.7018211", "0.7000632", "0.69478196", "0.69309616", "0.6905281", "0.69003177", "0.6894304", "0.68894887", "0.6864654", "0.6850846", "0.6847652", "0.6847652", "0.68467516", "0.6845684", "0.67799824", "0.6772399", "0.6766844", "0.6763108", "0.6755556", "0.67437905", "0.67315555", "0.67210454", "0.66595435", "0.66354656", "0.6633857", "0.6604565", "0.65999705", "0.65949214", "0.6594338", "0.65828437", "0.6575774", "0.6574174", "0.65661734", "0.6552735", "0.6539446", "0.65310234", "0.6525394", "0.65251034", "0.65232146", "0.6516156", "0.65077555", "0.650107", "0.6499753", "0.6494228", "0.6493508", "0.6487058", "0.64858353", "0.647889", "0.6459445", "0.64455605", "0.6445022", "0.6442833", "0.6442833", "0.6442483", "0.6438995", "0.6436872", "0.64281726", "0.6417736", "0.6415844", "0.6411057", "0.6399269", "0.6396269", "0.63875335", "0.6386195", "0.6385389", "0.6382943", "0.6372433", "0.6372177", "0.63710195", "0.6369124", "0.6369124", "0.63613355", "0.63570726", "0.63558555", "0.63536674", "0.63522613", "0.63506293", "0.6348838", "0.6348286", "0.63467115", "0.6340813", "0.6340261", "0.6335942", "0.6330054", "0.6329276", "0.6327574", "0.63249975", "0.6320291", "0.6317801", "0.6303667", "0.6293161", "0.6292689", "0.62781066", "0.62781066", "0.62683606", "0.62683606" ]
0.0
-1
Send notification to user when email changes. source://devise//lib/devise/models/database_authenticatable.rb181
def send_email_changed_notification; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_email_changed_notification?; end", "def email_changed_notification\n if self.email_changed? and (self.email != self.temp)\n self.token = self.class.make_token\n setup_email\n @subject = \"Email address verification\"\n @body = \"Please click this link to verify this email address: \\n#{SITE_URL}/change/#{token}\"\n \n Pony.mail(\n :subject => @subject, \n :body => @body\n )\n self.temp = self.email\n self.email = self.email_was\n end\n end", "def email_changed?\r\n false\r\n end", "def email_changed?\n false\n end", "def email_changed?\n false\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def email_changed?\n encrypted_email_changed?\n end", "def activate_user\n self.save\n self.send_user_notification_email\n end", "def send_email_password_changed\n Resque.enqueue(PasswordNotification,self)\n end", "def confirm_email_change(user, new_email)\n @user = user\n @new_email = new_email\n @autogen_msg = AUTOGEN_MSG\n\n @change_email_url = confirm_email_change_user_url(id: @user.id,\n confirmation_token: @user.confirmation_token,\n new_email: new_email,\n host: Rails.env.production? ? PROD_URL : DEV_URL,\n protocol: \"http\")\n mail(to: @new_email, subject: \"Confirm Change in Email Address\")\n end", "def send_password_change_notification\n # do not notify the admins for now\n end", "def skip_email_changed_notification!; end", "def will_save_change_to_email?\n false\n end", "def password_changed_mail(user)\n mail to: user.email\n end", "def set_email_notification\n @email_notification = @current_user.email_notification\n end", "def email_changed?\n being_invited? ? false : super\n end", "def changes_notification\n NotifierMailer.changes_notification(User.limit(2), {\n title: 'Email test title',\n content: 'Email test content',\n body: 'Email test body'\n })\n end", "def after_update\r\n if @original_email && @original_email != self.email\r\n MyAccountMailer.deliver_update_email_address( self )\r\n @original_email = nil\r\n end\r\n end", "def email_updated(user,old_email)\n @user = user\n @old_email = old_email\n @subject = \"[#{SITE_NAME}] Your email address has been updated\"\n mail(bcc: [@old_email,@user.email].join(\",\"), subject: @subject)\n end", "def password_was_changed_notice\n @email = params[:email]\n @token = params[:token]\n\n mail to: @email, subject: 'Your password was changed'\n end", "def send_password_change_notification; end", "def send_email_verification_email\n update_attribute(:activated, false)\n update_attribute(:activation_token, User.new_token)\n update_attribute(:activation_digest, User.digest(activation_token))\n save\n UserMailer.email_verification(self).deliver_now\n end", "def will_save_change_to_email?\n changed.include? 'email'\n end", "def email_changed?\n if self.provider\n false\n else\n true\n end\n end", "def notify\n return if @user.email.blank?\n\n Notifier.user_event_analisys(@user, @user.events.future.analisys.first).deliver_now if @user.events.future.analisys.present?\n Notifier.user_event_visit(@user, @user.events.future.visits.first).deliver_now if @user.events.future.visits.present?\n end", "def password_changed(user)\n mail_to user, password_changed_subject\n end", "def email_update\n participant = Participant.first\n participant.email_update_token = Participant.new_token\n ParticipantMailer.email_update(participant)\n end", "def active_directory_password_change_notification(person, options={})\n @person = person\n mail(:to=>[@person.personal_email],\n :subject=>options[:subject] || \"Password change notification (\"[email protected]+\")\",\n :date=>Time.now)\n end", "def change_email_address(new_email_address)\n @change_email = true\n self.new_email = new_email_address\n self.make_email_activation_code\n end", "def notify_admin\n return if admin_notified?\n update_column(:admin_notified, true) if persisted?\n RegistrationMailer.admin_notification_email(self).deliver\n end", "def upemail(params)\n old_email = params[\"old_email\"]\n new_email = params[\"new_email\"]\n\n subscriber = nil\n enabled_models.each { |model| subscriber ||= model.constantize.find_by_email(old_email) }\n\n unless over_the_limit(subscriber.updated_at)\n subscriber.email = new_email\n subscriber.save_without_update_list_member(:validate => false)\n end\n end", "def subscribed_email\n [email protected]_email.blank? ? @changes.old_email : @record.email\n end", "def check_email_change\n if changed.include?('email')\n answers.destroy_all\n # Every time the email address changes, generate a new access_key\n generate_access_key\n self.email_sent_at = nil\n self.status = 'created'\n end\n end", "def after_confirmation # Send welcome mail after user is successfully registered\n send_user_mail\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def recently_changed_email?\n @change_email\n end", "def send_admin_notification_email\n #Notifies admin of the registration\n UserMailer.new_user(self).deliver\n end", "def update_new_email!(email)\n self.unconfirmed_email = email\n save\n end", "def activate_new_email\n @activated_email = true\n update_attributes(:email => self.new_email,\n :new_email => nil,\n :email_activation_code => nil)\n end", "def post_edit_email\n NotificationMailer.post_edit_email('[email protected]')\n end", "def email_on_update\n ProductMailerMailer.email_on_update\n end", "def notify_member_expire_1\n users, event = User.unpaid_membership_expires_in_1_day\n users.each do |user|\n UserMailer.deliver_membership_expires_in_1_day(user)\n User.add_email_event(user, event)\n end\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def notify_change\n SpecificNodeMailer.notify_change\n end", "def change_email(new_email, options = {})\n self.class.query('Contact_Change_Email', options.merge({\n 'email' => email,\n 'newEmail' => new_email,\n :on_timeout => false,\n :on_error => false,\n :on_success => Proc.new { |response| self.email = new_email; true }\n }))\n end", "def update_profile_email\n user_profile.update_attribute(:email, email) if saved_change_to_email?\n end", "def email_changed(record, opts = {})\n @resource = record\n view_mail('cd9fbf07-4960-4cb7-903c-068b76d2ca32',\n reply_to_id: @reply_to_id,\n to: @resource.email,\n subject: 'Email changed'\n )\n end", "def after_save(user)\n UserMailer.deliver_activation(user) if user.recently_activated?\n UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?\n UserMailer.deliver_reset_password(user) if user.recently_reset_password?\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def send_mail_to_associates\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end", "def email_changed?\n persisted? ? (email_was != email) : false\n end", "def new_user_notification\n ModelMailer.new_user_notification\n end", "def activate_email\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def verify_email!\n self.email_verified_at = Time.now.utc\n self.email_verification_code = nil\n reconcile_privileges! :email_verified\n success = save(false)\n success\n end", "def after_update_challenge\n send_email_after_canceled_reactive\n send_email_after_change_start_date\n end", "def send_permissions_changed_email\n UserMailer.permissions_changed(self).deliver_now\n end", "def send_activation_email\n unless notified?\n Notifier.email_activation(self).deliver\n self.update_attribute(:notified, true)\n end\n end", "def notify_user_of_email_change_overlap_attempt!(email,supplied_name)\n user = User.find_by_email(email)\n template_locals = { :user => user, :supplied_name => supplied_name}\n send_email_to_user(user,\"Frank says someone is using your email.\" ,:'mail/email_change_warning', template_locals)\n end", "def notify_member_expire_7\n users, event = User.unpaid_membership_expires_in_7_days\n users.each do |user|\n UserMailer.deliver_membership_expires_in_7_days(user)\n User.add_email_event(user, event)\n end\n end", "def send_activation_or_reset_mail\n end", "def change_email\n if params[:email].present?\n current_user.update_attributes(:email=>params[:email],:uid=>\"\",:provider=>\"\")\n @message = \"Confirmation Mail has been sent ,please confirm to update your email\"\n else\n @message =\"Email is blank or invalid\"\n end\n end", "def send_observer_mail(user)\n mail to: user.email, subject: \"Changes to Cart\", from:'[email protected]'\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!\n # save!(:validate => false)\n # validate for password validation, done on front end\n end", "def updated\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def maybe_deliver_email_confirmation!(controller)\n if email_changed_previously?\n deliver_email_confirmation! controller\n true\n else\n false\n end\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def after_update(profile)\n \n puts(\"observer called----------------<><><><><>?<<><><><><><><>--------------\") \n @user=User.find(profile.user_id)\n if(profile.changes.any?)\n ApplicationMailer.send_observer_mail(@user).deliver\n \n end\n end", "def after_save(user)\n\n UserMailer.deliver_activation(user) if user.recently_activated? unless user.setup\n UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?\n UserMailer.deliver_reset_password(user) if user.recently_reset_password?\n UserMailer.deliver_forgot_username(user) if user.recently_forgot_username?\n\n end", "def email_changed?\n (self.channel_referent_id==0) && super\n end", "def send_password_reset_email\n UserNotifier.lost_password(self).deliver_now\n end", "def set_alt_email(alt_email)\n # check email is already in use, primary or alt\n if User.find_by_email(alt_email) || User.where([\"alt_email = ? and id <> ?\",alt_email,self.id]).count > 0\n return false\n end\n\n self.alt_email = alt_email\n self.alt_email_confirmed = false\n token = Digest::MD5.hexdigest rand.to_s\n self.alt_confirmation_token = token\n confirm_link = registrations_confirm_alt_email_url(:token => token)\n\n self.touch(:alt_confirmation_sent_at)\n self.save\n\n UserMail.confirm_alt_email(self,confirm_link).deliver\n return true\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def send_devise_notification(notification, *args); end", "def notify_subscribers\n AdminMailer.notify_of_standard_change(self)\n end", "def email_user\n Mailer.deliver_metadata_processed(dataset_id, user_id, @missing_variables, base_host) if EMAIL_ENABLED && User.find(user_id).person.send_notifications?\n end", "def notify_changed_request_status(request)\n @request=request\n mail(to: request.user.email,\n subject: \"#{request.user.name} your request has been #{I18n.t \"request_status.#{request.status}\"}\")\n end", "def send_password_update_email(user)\n @user = user\n\n mail(to: @user.email,\n subject: \"#{@user.email} password update notification!\")\n end", "def after_save(user)\n UserNotifier.deliver_activation(user) if user.recently_activated?\n end", "def send_confirmation\n self.update_column(:password_reset_token, SecureRandom.urlsafe_base64)\n self.update_column(:password_sent_at, Time.zone.now)\n UserMailer.send_confirmation_mail(self).deliver\n end", "def activate_new_email\n flash.clear\n return if params[:id] == nil && params[:email_activation_code] == nil\n\n activator = params[:id] || params[:email_activation_code]\n @user = User.find_by_email_activation_code(activator)\n if @user && @user.activate_new_email\n notice = \"The email address for your account has been updated\"\n if @user.is_same_user?(current_user)\n redirect_back_or_default(edit_user_path(@user))\n else\n redirect_back_or_default(:controller => :sessions, :action => :logout, :notice => notice )\n end\n flash[:notice] = notice\n else\n flash[:notice] = \"Unable to update the email address\"\n end\n end", "def password_change\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def email_address_activation\n user = User.first\n email_address = EmailAddress.find_by(id: user.primary_email_address_id)\n email_address.activation_token = new_token\n UserMailer.email_address_activation(user, email_address)\n end", "def send_password_reset_email\n # self is an instance of User, aka a row/entry in the User table\n UserMailer.password_reset(self).deliver_now\n end", "def notify_via_service\n u = User.first\n u.update(last_notification_mail_sent: 30.days.ago)\n service = NotificationDigest.new(type: :notifications)\n service.notify_user(u, deliver: false)\n end", "def post_approve_email\n NotificationMailer.post_approve_email('[email protected]')\n end", "def email_confirmation\n @user = User.where(:username => params[:username]).first\n\n #checking if email is already confirmed:\n if @user.email_confirmed == true then return end\n \n #checking if confirmation id is the same as in DB:\n if @user.email_confirmation_id == params[:id] \n \n #updating email_confirmed in DB:\n if @user.update_columns(:email_confirmed => true) == false \n \n flash[:error] += \" Error updating db. \" \n else\n @user.email_confirmed = true \n end\n end\n end", "def send_email!\n UserMailer.event_ticket_notification(user, self).deliver_now\n end", "def groups_notification_email\n @data = last_notification\n # Only send if there's something to send\n return unless @data.any?\n rails_secrets = Rails.application.secrets\n send_to = rails_secrets.user_default_email\n send_from = 'notifications@' + rails_secrets.domain_name\n mail(from: send_from, to: send_to,\n subject: 'Competitor-Monitor Changes Notification')\n end", "def deliver_security_notification_update\n if saved_change_to_address?\n options = {\n recipients: [address_before_last_save],\n message: :mail_body_security_notification_change_to,\n field: :field_mail,\n value: address\n }\n elsif saved_change_to_notify?\n options = {\n recipients: [address],\n message: notify_before_last_save ? :mail_body_security_notification_notify_disabled : :mail_body_security_notification_notify_enabled,\n value: address\n }\n end\n deliver_security_notification(options)\n end", "def resend_activation_email\n create_activation_digest\n save\n send_activation_email\n end", "def notify\n ReminderMailer.notify\n end", "def admin_notify\n UserMailer.signup_notification(self).deliver_later!(wait: 1.minute)\n end", "def email_sent\n @email = session[:owners_new_email]\n end", "def reset_password_notification(request)\n return ResetPasswordNotificationResponse.new(false, 'Reset Password Notification request null') if request.nil?\n\n return ResetPasswordNotificationResponse.new(false, 'Email does not exist') unless User.find_by_email(request.email)\n UserNotifierMailer.send_reset_password_email(request.email).deliver\n return ResetPasswordNotificationResponse.new(true, 'Email sent')\n end", "def reconfirm_notification(user)\n setup_email(user)\n subject 'Confirm new email'\n\n body :user => user, :host => FROM_HOST\n end" ]
[ "0.78493017", "0.77913135", "0.71757704", "0.71441495", "0.71441495", "0.7071305", "0.7071305", "0.7071305", "0.6971036", "0.6941876", "0.68917507", "0.6847792", "0.6843558", "0.6839039", "0.68353426", "0.68347716", "0.68280655", "0.6809837", "0.6804571", "0.6773829", "0.669591", "0.666669", "0.66450787", "0.66362774", "0.6626885", "0.6622956", "0.6619752", "0.66026103", "0.65951777", "0.65809196", "0.655158", "0.6532873", "0.65211535", "0.6445424", "0.6443236", "0.6439104", "0.64386714", "0.64374113", "0.64155394", "0.64133495", "0.639971", "0.63813543", "0.63692254", "0.6347651", "0.6339651", "0.63290775", "0.6321148", "0.6316026", "0.6315844", "0.63139296", "0.63100284", "0.63100284", "0.63031393", "0.6295033", "0.62940526", "0.62884825", "0.62738365", "0.62720484", "0.6268257", "0.6266823", "0.6254945", "0.6225416", "0.62219", "0.62189776", "0.62144184", "0.62125826", "0.6209632", "0.6202671", "0.6198316", "0.6198316", "0.6198316", "0.6196837", "0.619579", "0.61955696", "0.61926925", "0.6190396", "0.6186871", "0.61867756", "0.618205", "0.61747986", "0.6163302", "0.616309", "0.61597174", "0.6143389", "0.61431766", "0.6142301", "0.61352175", "0.61264867", "0.6121733", "0.61179537", "0.61144495", "0.61120456", "0.6107408", "0.6106849", "0.6104731", "0.6103973", "0.6103955", "0.61012393", "0.60980034", "0.60934836" ]
0.79825383
0
Send notification to user when password changes. source://devise//lib/devise/models/database_authenticatable.rb186
def send_password_change_notification; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_password_change_notification\n # do not notify the admins for now\n end", "def update_password_changed\n self.password_changed_at = Time.now if (self.new_record? or self.encrypted_password_changed?) and not self.password_changed_at_changed?\n end", "def password_changed(user)\n mail_to user, password_changed_subject\n end", "def skip_password_change_notification!; end", "def update_password_changed\n if defined?(will_save_change_to_attribute?)\n return unless (new_record? || will_save_change_to_encrypted_password?) && !will_save_change_to_password_changed_at?\n else\n return unless (new_record? || encrypted_password_changed?) && !password_changed_at_changed?\n end\n\n self.password_changed_at = Time.zone.now\n end", "def update_password(new_password)\n super(new_password).tap do |status|\n UserMailer.password_changed(self).deliver_later if status\n end\n end", "def password_change_new\n\n end", "def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end", "def password_changed?\n hashed_password_changed?\n end", "def send_email_password_changed\n Resque.enqueue(PasswordNotification,self)\n end", "def change_password\r\n \r\n end", "def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end", "def password_changed?\n Candidate.password_changed?(password)\n # !valid_password?(Event::Other::INITIAL_PASSWORD)\n end", "def user_updated_password user\n data = {\n category: 'Users',\n action: 'Updated Password',\n label: user.email,\n value: nil,\n bounce: true,\n }\n\n create_event data\n end", "def password_was_changed_notice\n @email = params[:email]\n @token = params[:token]\n\n mail to: @email, subject: 'Your password was changed'\n end", "def password_changed_messages\n pw_change_message.text\n end", "def password_changed_mail(user)\n mail to: user.email\n end", "def password_changed_confirm\n pw_change_confirm.click\n end", "def handle_password_change\n return if warden.nil?\n if not devise_controller? and not ignore_password_expire? and not request.format.nil? and request.format.html?\n Devise.mappings.keys.flatten.any? do |scope|\n if signed_in?(scope) and warden.session(scope)['password_expired']\n # re-check to avoid infinite loop if date changed after login attempt\n if send(:\"current_#{scope}\").try(:need_change_password?)\n store_location_for(scope, request.original_fullpath) if request.get?\n redirect_for_password_change scope\n return\n else\n warden.session(scope)[:password_expired] = false\n end\n end\n end\n end\n end", "def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end", "def need_change_password\n return unless password_expiration_enabled?\n\n self.password_changed_at = nil\n end", "def will_save_change_to_encrypted_password?\n changed.include? 'encrypted_password'\n end", "def temporary_password_change_flag\n \"on_temporary_password\"\n end", "def see_password!\n self.password_seen_at = Time.now\n self.save!\n end", "def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end", "def password_changed?\n orig_pw_hash = self.instance_variable_get(:@old_password_hash)\n self.new_record? || (!orig_pw_hash.nil? && orig_pw_hash != self.password_hash)\n end", "def password_changed?\n !@new_password.blank?\n end", "def password_changed?\n !@new_password.blank?\n end", "def password_update\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n user = LatoCore::Superuser.find(params[:id])\n if !user || user.session_code != params[:token]\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n user.update(password: params[:password], password_confirmation: params[:password])\n if !user.save\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n\n flash[:success] = CORE_LANG['recover_password']['recover_success']\n redirect_to lato_core.login_path\n end", "def change_password\n set_breadcrumbs(\"change_password\") \n if request.post? || request.patch? \n admin = Admin.find(current_admin.id)\n @check = params[:admin][:password] == params[:admin][:password_confirmation] && params[:admin][:password].present? && params[:admin][:password_confirmation].present?\n if admin.present? && admin.valid_password?(params[:admin][:old_password])\n if @check \n if admin.update_attribute(:password, params[:admin][:password])\n sign_in admin, :bypass => true\n flash[:notice] = I18n.t('change_password.update.success')\n redirect_to admin_root_path\n else\n flash[:error] = I18n.t('common.error') \n end\n else\n flash[:error] = I18n.t('change_password.failure.password_is_not_match')\n end\n else\n flash[:error] = I18n.t('change_password.failure.invalid_old_password')\n end\n end\n end", "def set_change_password(user)\n user.update_column(:must_change_passwd, true)\n session[:pwd] = 1\n end", "def password_change(record, opts={})\n MnoEnterprise::MailClient.deliver('password-change',\n default_sender,\n recipient(record),\n user_vars(record)\n )\n end", "def admin_pwd_update\n @user = User.find_by_id(params[:user_id])\n @user.validate_pwd = true\n if @user.update(email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])\n # if an admin is updating her own password, we need to get around Devise's automatic sign out\n if @user.id == current_user.id\n sign_in(@user, :bypass => true)\n end\n flash.keep[:notice] = 'The password for \"' + params[:user][:email] + '\" was successfully updated.'\n redirect_to '/users'\n else\n render :admin_pwd\n end\n end", "def password_changeable?\n @password_changeable\n end", "def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end", "def after_database_authentication\n rotate_stale_password_digest\n end", "def password_changed?\n !password.blank?\n end", "def change_password\n #raise current_user.inspect\n end", "def after_password_reset; end", "def on_temporary_password?\n send(temporary_password_change_flag)\n end", "def needs_password_change_email?\n encrypted_password_changed? && persisted?\n end", "def password_change\n respond_to do |format|\n if @user.update_with_password(password_change_params)\n bypass_sign_in(@user)\n format.html { redirect_to request.referer || root_url, notice: 'User password has been successfully updated.' }\n else\n format.html { render 'password_change_new' }\n end\n end\n end", "def password_being_changed?(user)\n user[:password].present? ||\n user[:password_confirmation].present?\n end", "def password_updated(user)\n @user = user\n @subject = \"[#{SITE_NAME}] Your password has been changed\"\n mail(bcc: @user.email, subject: @subject)\n end", "def change_password\n @attributes[:change_password]\n end", "def change_password\n # https://github.com/site5/lumberg\n server = Lumberg::Whm::Server.new(host: HOST_NAME, hash: `cat #{HASH_FILE_PATH}`)\n cp_email = Lumberg::Cpanel::Email.new(server: server, api_username: @username)\n @password = SecureRandom.urlsafe_base64(12)\n process_options = { domain: @domain, email: @email, password: @password }\n passwd_result = cp_email.change_password(process_options)\n if passwd_result[:params][:data][0][:reason] == ''\n puts \"Successfully changed password of #{@email}\"\n time = Time.new\n logtime = time.strftime('%Y-%m-%d %H:%M')\n File.open(\"#{LOG_FILE_PATH}\", 'a') { |logfile| logfile.puts \"#{logtime}: #{@email}\" }\n else\n # Print c-panel error message if failed to change the password\n puts \"#{passwd_result[:params][:data][0][:reason]}\"\n end\n end", "def update_password\n @user = User.find_by_uuid(params[:id])\n if @user.update(user_params_with_password)\n if @user.send_password.present? && @user.send_password.to_i == 1\n @user.send_welcome_email\n end\n flash[:success] = t('messages.default_success')\n redirect_to users_path\n else\n flash[:error] = t('messages.default_error')\n render :edit_password\n end\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def send_changed_password_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Your password has been changed' )\n end", "def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end", "def require_password_change\n @attributes[:require_password_change]\n end", "def update_password\n if resource.update_password(params[resource_name])\n set_flash_message :notice, :password_updated if is_navigational_format?\n sign_in resource_name, resource, :bypass => true\n respond_with resource, :location => after_update_path_for(resource)\n else\n clean_up_passwords(resource)\n render :edit_password\n end\n end", "def password_recovery_success\n PharmacistMailer.password_recovery_success\n end", "def password_changed?\n !@new_password.blank?\n end", "def change_password_for_user\n if (@user = find_user(params[:id]))\n do_change_password_for(@user)\n flash[:notice] = \"Password for user '#{@user.login}' has been updated.\"\n end\n redirect_back_or_default :action => 'list'\n end", "def do_change_password_for(user)\n# begin\n User.transaction(user) do\n user.change_password(params[:user][:password], params[:user][:password_confirmation])\n if user.save\n if LoginEngine.config(:use_email_notification)\n UserNotify.deliver_change_password(user, params[:user][:password])\n flash[:notice] = \"Updated password emailed to #{@user.email}\"\n else\n flash[:notice] = \"Password updated.\"\n end\n return true\n else\n flash[:warning] = 'There was a problem saving the password. Please retry.'\n return false\n end\n end\n# rescue\n# flash[:warning] = 'Password could not be changed at this time. Please retry.'\n# end\n end", "def password\n \n if request.post?\n begin\n @user = User.find(User.current_user.id)\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n # Send confirmation email here\n update_session\n flash[:notice], flash[:class] = \"Password changed successfully\", \"good\"\n redirect_to :controller => \"account\", :action => \"index\" and return\n else\n raise \"Sorry, your password couldn't be changed.\"\n end\n rescue Exception => e\n flash.now[:notice], flash.now[:class] = \"#{e}<br /><small>#{@user.errors.full_messages.join(\"<br />\")}</small>\", \"bad\"\n #redirect_to :controller => \"account\", :action => \"password\" and return\n end\n end\n\n end", "def password\n if @user.update_with_password(password_params)\n render_update_success @user\n else\n render_failure @user\n end\n end", "def password_reset\n Notifications.password_reset\n end", "def change_password\n @user = current_user\n end", "def change_password\n @user = current_user\n end", "def password=(new_password)\n @password = new_password\n end", "def password=(new_password); end", "def set_password_field(password)\n end", "def password_change(user, _opts = {})\n set_template(:change_password)\n\n set_personalisation(\n drafts_url: users_drafts_url,\n )\n\n mail(to: user.email)\n end", "def redirect_after_successful_password_update\n if current_user.check_password_change_required?\n redirect_to logout_path\n else\n redirect_to user_change_password_confirmation_url\n end\n end", "def change_password\n @user = User.find(session[:user_id])\n if params[:user]\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n flash[:notice] = \"Password change successful\"\n end\n end\n end", "def change_password\n @user = current_user\n @user.update_password(params)\n\n if @user.errors.empty?\n redirect_to profile_path, :notice => I18n.t('profile.password_changed')\n else\n flash.now[:alert] = I18n.t(\"errors.passwords.problem\")\n render 'show', :status => :forbidden\n end\n end", "def change_password\n if current_user.update_with_password(password_params)\n #\n # Sign in the user bypassing validation in case\n # their password changed.\n #\n sign_in current_user, bypass: true\n\n redirect_to current_user, notice: 'Password successfully changed.'\n else\n render 'edit'\n end\n end", "def forgot_password\n Notifications.forgot_password\n end", "def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end", "def change_password(user, password, header)\n url=nil\n setup_email(user)\n\n # Email header info\n @subject += \"Changed password notification\"\n\n # Email body substitutions\n @body[\"name\"] = \"#{user.full_name}\"\n @body[\"login\"] = user.login\n @body[\"password\"] = password\n @body[\"url\"] = url || DEFAULT_URL\n @body[\"app_name\"] = APP_NAME\n @headers[\"X-SMTPAPI\"] = header\n end", "def update_password\n @user = current_user\n return unless request.post?\n if User.authenticate(current_user.email, params[:old_password])\n if (params[:password] == params[:password_confirmation])\n current_user.password_confirmation = params[:password_confirmation]\n current_user.password = params[:password]\n if !params[:password].blank? && current_user.save\n flash[:notice] = \"Password changed\" \n redirect_to edit_user_path(current_user)\n else\n flash[:notice] = \"Password not changed\"\n end\n else\n flash[:notice] = \"Password mismatch\"\n @old_password = params[:old_password]\n end\n else\n flash[:notice] = \"Wrong password\" \n end \n end", "def after_password_reset;\n end", "def need_change_password!\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n need_change_password\n self.save(:validate => false)\n end\n end", "def refresh_password\n @user = User.find(session[:user])\n @success = false\n if (!params[:user].blank? && params[:user][:terms_of_service]!=\"0\") or @user.terms_of_service\n @flag = User.check_old_password(params[:old_password], @user.password)\n if @flag\n if (params[:old_password] != params[:new_password])\n if (params[:new_password] == params[:confirm_password])\n if params[:new_password].length >= 6 && params[:new_password].length <= 15\n @user.change_password(params[:new_password])\n @check = \"Password has been updated successfully. \"\n @success = true\n MopMailer.deliver_change_password(@user,params[:new_password],session[:practice_prefix])\n else\n @check = \"The password length should be between 6 and 15 characters long. \"\n end\n else\n @check = \"Passwords dont match. Please reenter the passwords again. \"\n end\n else\n @check = \"New password should not match with existing password. \"\n end\n else\n @check = \"Old password not correct. Password not changed. \"\n end\n else\n @check = \"Please accept the terms of use. \"\n end\n if @success\n msg = \"<font color='green'>#{@check}</font>\"\n else\n msg = \"<font color='red'>#{@check}</font>\"\n end\n flash[:message] = msg\n redirect_to :action => :list\n end", "def change_password(new_pass)\n self.salt = User.gen_salt\n salted_pass = User.salt_password(new_pass, self.salt)\n self.password = salted_pass\n end", "def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end", "def change_password(old_pass, new_pass, confirm_pass)\n if self.encrypted_password == encrypt(old_pass)\n p \"password_verified\"\n if new_pass = confirm_pass\n self.password = new_pass\n self.password_confirmation = confirm_pass\n if self.save\n p \"Sucess\"\n end\n else\n p \"Hey, your password doesn't match it's confirmation!\"\n end\n else\n p \"Hey, your Old password doesn't match!\"\n end\n end", "def old_password=(string)\n end", "def need_change_password\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n self.password_changed_at = self.expire_password_after.seconds.ago\n end\n\n # is date not set it will set default to need set new password next login\n need_change_password if self.password_changed_at.nil?\n\n self.password_changed_at\n end", "def update\n @user = current_user\n if @user.update_with_password(params[:user])\n if is_navigational_format?\n flash[:notice] = t(\"passwords.update.success\")\n end\n sign_in @user, :bypass => true\n redirect_to edit_user_registration_path\n else\n flash[:error] = t(\"passwords.update.failed\")\n redirect_to :action => :edit\n end\n end", "def changepassword\n @user = current_user\n if @user.update_attributes(params[:user]) then \n UserMailer.password_change(@user, @user.email).deliver \n redirect_to @user, notice: 'Password update was successful.' \n else\n render action: \"account\"\n end \n end", "def update_password\n @user_profile = true\n if request.patch?\n if @user.update_with_password(user_params) # Only :password and :password_confirmation are sent to this action\n # Sign in the user by passing validation in case their password changed\n bypass_sign_in(@user)\n flash[:notice] = \"Password successfully changed.\"\n redirect_to root_path\n else\n if @user.errors.any?\n error_messages = [\"Password could not be updated:\"]\n error_messages << @user.errors.messages.values\n flash[:error] = error_messages.join('<br/>')\n end\n render \"update_password\"\n end\n end\n end", "def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end", "def send_password_update_email(user)\n @user = user\n\n mail(to: @user.email,\n subject: \"#{@user.email} password update notification!\")\n end", "def password\n UserMailer.password\n end", "def update\n resource.extend(Devise::Models::DatabaseAuthenticatablePatch)\n resource.update_with_password(resource_params)\n\n yield resource if block_given?\n\n if resource.errors.empty?\n warden.session(scope)['password_expired'] = false\n set_flash_message :notice, :updated\n bypass_sign_in resource, scope: scope\n respond_with({}, location: after_password_expired_update_path_for(resource))\n else\n clean_up_passwords(resource)\n respond_with(resource, action: :show)\n end\n end", "def change_password\n @user=User.find(current_user)\n end", "def update_password(user, new_password)\n user.update_password(new_password)\n end", "def newPassword(newPass)\n\t\tDATABASE.edit(\"users\", \"password\", newPass, \"username\", @username)\n\tend", "def set_password=(new_password)\n self.password = Password.create(new_password)\n self.save\n end", "def change_password\n puts \"Starting password change...\"\n puts params.inspect\n if current_user.authenticate(params[:password][:original_password])\n if params[:password][:password] === params[:password][:password_confirmation]\n @user = User.find_by_id(current_user.id)\n @user.password = params[:password][:password]\n @user.password_confirmation = params[:password][:password_confirmation]\n if @user.save\n render status: 200, json: { message: 'Password successfully updated.' }\n else\n render status: 500, json: { message: 'ERROR: New password could not be saved.' }\n end\n else\n render status: 403, json: { message: 'Password and confirmation passwords do not match.' }\n end\n else\n render status: 403, json: { message: 'Your original password seems to be incorrect. Please try again.' }\n end\n end", "def password_changed?\n !self.password.blank? or self.encrypted_password.blank?\n end", "def recruiter_password_change(current_password,new_password)\n current_password_field.set current_password\n\t new_password_field.set new_password\n confirm_password_field.set new_password\n\t change_button.click\n\t \n end", "def update_password\n @admin.password = Admin.get_encrypted_password(@new_password, @login_salt_d)\n @admin.save!\n end", "def monitor_password=(password)\n return if password.blank?\n\n # Regenerate salt each time password is changed\n salt = 16.times.map{Random.rand(10)}.join\n write_attribute(:salt,salt)\n\n secret_key = Digest::MD5.digest(ActiveRecord::Base.configurations[Rails.env][\"secret\"]||\"m0nitr$this\")\n iv = Digest::MD5.digest(salt)\n write_attribute(:monitor_password, Base64.encode64(Encryptor.encrypt(password, :key => secret_key,:iv=>iv)))\n end", "def send_password_reset_email\n UserNotifier.lost_password(self).deliver_now\n end", "def change_password!(password)\n json = JSON.generate(:changePassword => { :adminPass => password })\n @compute.connection.req('POST', \"/servers/#{@id}/action\", :data => json)\n @adminPass = password\n end" ]
[ "0.81899804", "0.75572914", "0.7362167", "0.7282116", "0.725173", "0.71789134", "0.7165436", "0.70832306", "0.7082679", "0.70804656", "0.7046301", "0.69923925", "0.6992288", "0.69394416", "0.69365025", "0.69319254", "0.6920945", "0.6879363", "0.68340135", "0.68173045", "0.6812206", "0.6787244", "0.6723654", "0.67113155", "0.6699278", "0.669798", "0.6696245", "0.6696245", "0.66874284", "0.66839427", "0.66826516", "0.66625965", "0.66068196", "0.6603684", "0.6597805", "0.6586133", "0.65837866", "0.658109", "0.6574815", "0.6564508", "0.65588236", "0.6547431", "0.65461636", "0.65438974", "0.65112853", "0.6496639", "0.6484605", "0.6482547", "0.6482547", "0.6482547", "0.6477555", "0.64457065", "0.64410883", "0.6424755", "0.6421668", "0.6413589", "0.64099365", "0.640812", "0.6407747", "0.64063746", "0.6404443", "0.6404443", "0.63807935", "0.63708526", "0.6368456", "0.63389707", "0.6330808", "0.63247406", "0.63215476", "0.6317634", "0.63109046", "0.63033855", "0.62979203", "0.6293434", "0.6288823", "0.62850577", "0.6284846", "0.62834924", "0.6274583", "0.62668175", "0.62634844", "0.6263091", "0.62491244", "0.62478036", "0.6244253", "0.6236186", "0.62296706", "0.62274784", "0.6223741", "0.62211144", "0.6220155", "0.62174696", "0.6215577", "0.6207869", "0.6206086", "0.6200713", "0.61860585", "0.6181999", "0.61816233", "0.6164286" ]
0.86943185
0
Skips sending the email changed notification after_update source://devise//lib/devise/models/database_authenticatable.rb49
def skip_email_changed_notification!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_email_changed_notification?; end", "def send_email_changed_notification; end", "def email_changed?\n false\n end", "def email_changed?\n false\n end", "def after_update\r\n if @original_email && @original_email != self.email\r\n MyAccountMailer.deliver_update_email_address( self )\r\n @original_email = nil\r\n end\r\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def will_save_change_to_email?\n false\n end", "def skip_password_change_notification!; end", "def email_changed?\r\n false\r\n end", "def will_save_change_to_email?\n false\n end", "def after_update_challenge\n send_email_after_canceled_reactive\n send_email_after_change_start_date\n end", "def skip_confirmation_notification!; end", "def email_changed_notification\n if self.email_changed? and (self.email != self.temp)\n self.token = self.class.make_token\n setup_email\n @subject = \"Email address verification\"\n @body = \"Please click this link to verify this email address: \\n#{SITE_URL}/change/#{token}\"\n \n Pony.mail(\n :subject => @subject, \n :body => @body\n )\n self.temp = self.email\n self.email = self.email_was\n end\n end", "def email_changed?\n being_invited? ? false : super\n end", "def send_password_change_notification\n # do not notify the admins for now\n end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def email_changed?\n if self.provider\n false\n else\n true\n end\n end", "def maybe_deliver_email_confirmation!(controller)\n if email_changed_previously?\n deliver_email_confirmation! controller\n true\n else\n false\n end\n end", "def skip_reconfirmation!; end", "def email_changed?\n (self.channel_referent_id==0) && super\n end", "def email_changed?\n encrypted_email_changed?\n end", "def do_notify_disabled(transition)\n if user && Rails.application.settings.enforce_rules\n UserMailer.access_revoked(user, self).deliver_later\n end\n end", "def skip_confirmation_notification!\n @skip_confirmation_notification = true\n end", "def upemail(params)\n old_email = params[\"old_email\"]\n new_email = params[\"new_email\"]\n\n subscriber = nil\n enabled_models.each { |model| subscriber ||= model.constantize.find_by_email(old_email) }\n\n unless over_the_limit(subscriber.updated_at)\n subscriber.email = new_email\n subscriber.save_without_update_list_member(:validate => false)\n end\n end", "def skip_reconfirmation_in_callback!; end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def check_email_change\n if changed.include?('email')\n answers.destroy_all\n # Every time the email address changes, generate a new access_key\n generate_access_key\n self.email_sent_at = nil\n self.status = 'created'\n end\n end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def notify_about_missing_field(attribute, message)\n if self.send(attribute).blank?\n options = {:to => self.email,\n :subject => \"Your user account needs updating\",\n :message => message,\n :url_label => \"Modify your profile\",\n :url => Rails.application.routes.url_helpers.edit_user_url(self, :host => \"whiteboard.sv.cmu.edu\")\n }\n GenericMailer.email(options).deliver\n end\n end", "def update!(**args)\n @enable_failure_email = args[:enable_failure_email] if args.key?(:enable_failure_email)\n end", "def after_update(profile)\n \n puts(\"observer called----------------<><><><><>?<<><><><><><><>--------------\") \n @user=User.find(profile.user_id)\n if(profile.changes.any?)\n ApplicationMailer.send_observer_mail(@user).deliver\n \n end\n end", "def send_password_change_notification; end", "def needs_email_change?\n self[:force_email_change] || !self.email.present?\n end", "def email_on_update\n ProductMailerMailer.email_on_update\n end", "def deliver_security_notification_update\n if saved_change_to_address?\n options = {\n recipients: [address_before_last_save],\n message: :mail_body_security_notification_change_to,\n field: :field_mail,\n value: address\n }\n elsif saved_change_to_notify?\n options = {\n recipients: [address],\n message: notify_before_last_save ? :mail_body_security_notification_notify_disabled : :mail_body_security_notification_notify_enabled,\n value: address\n }\n end\n deliver_security_notification(options)\n end", "def contact_emails\n super.each do |e|\n def e.persisted?\n false\n end\n end\n end", "def send_activation_or_reset_mail\n end", "def email_changed?\n raise NoMethodError\n end", "def is_not_pending_recovery!\n self.update_attribute(:verification_key, nil) if self.is_pending_recovery?\n end", "def will_save_change_to_email?\n changed.include? 'email'\n end", "def recently_changed_email?\n @change_email\n end", "def forced_email_change\n if (email_was == email) && force_email_change_was == true\n errors.add(:email, \"cannot be the same\")\n return false\n end\n end", "def notify_users_after_change\n if !id ||\n saved_change_to_when? ||\n saved_change_to_where? ||\n saved_change_to_location_id? ||\n saved_change_to_notes? ||\n saved_change_to_specimen? ||\n saved_change_to_is_collection_location? ||\n saved_change_to_thumb_image_id?\n notify_users(:change)\n end\n end", "def disable_inactivity_email\n @user.update_attributes(:is_receiving_inactivity_email => false)\n @notice = \"You have disabled inactivity notifications.\"\n \n respond_to do |format|\n format.html {\n redirect_to(manage_email_notifications_path, notice: @notice) and return\n return \n }\n format.js {\n render :unsubscribe\n }\n end\n end", "def send_mail_to_attendees_on_update\n if self.category.eql?(\"appointment\")\n if self.changed.include?(\"start_date\") or self.changed.include?(\"attendees_emails\") or self.changed.include?(\"repeat\") or self.changed.include?(\"count\") or self.changed.include?(\"until\")\n user = self.matter_people.assignee\n if self.attendees_emails\n att_arr = self.attendees_emails.split(\",\")\n for i in att_arr\n send_update_notificaton_to_attendees(user, self, i)\n end\n end\n\n true\n end\n end\n end", "def reset_email\n # User reset email sent.\n end", "def skip_confirmation!; end", "def post_edit_email\n NotificationMailer.post_edit_email('[email protected]')\n end", "def notify_admin\n return if admin_notified?\n update_column(:admin_notified, true) if persisted?\n RegistrationMailer.admin_notification_email(self).deliver\n end", "def postpone_email_change?\n if invited_but_not_yet_accepted?\n false\n else\n super\n end\n end", "def update_if_necessary(params)\n update_needed = false \n \n if !params[:daily_email].nil? &&\n self.daily_email_reminder_enabled != params[:daily_email]\n update_needed = true\n self.daily_email_reminder_enabled = params[:daily_email]\n end\n\n if !params[:email].nil? && \n self.email != params[:email]\n update_needed = true\n self.email = params[:email]\n end\n\n if update_needed\n self.save\n end\n end", "def email_change_unconfirmed?\n read_attribute(:new_email).present? and (read_attribute(:new_email) != email)\n end", "def resend_activation_emails\n User.where.not(person: nil).where.not(activation_code: nil).each do |user|\n if user.person\n logs = user.person.activation_email_logs\n if logs.count < MAX_ACTIVATION_EMAILS && (logs.empty? || logs.last.created_at < RESEND_ACTIVATION_EMAIL_DELAY.ago)\n Mailer.activation_request(user).deliver_later\n MessageLog.log_activation_email(user.person)\n end\n else\n Rails.logger.info(\"User with invalid person - #{user.id}\")\n end \n end\n end", "def set_email_updates\n get_email = FollowerFollowing.where('follower_id=? and following_id=?', @login_user.id, params[:id]).first\n get_email.update_attributes(:get_email_updates => !get_email.get_email_updates)\n redirect_to \"/users/profile/#{params[:id]}\"\n end", "def unset_primary_email\n return true unless default_email_record\n\n default_email_record.update_attributes(primary: false)\n end", "def unset_primary_email\n return true unless default_email_record\n\n default_email_record.update_attributes(primary: false)\n end", "def active_directory_password_change_notification(person, options={})\n @person = person\n mail(:to=>[@person.personal_email],\n :subject=>options[:subject] || \"Password change notification (\"[email protected]+\")\",\n :date=>Time.now)\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def skip_confirmation!\n self.confirmed_at = Time.now.utc\n end", "def inactive_message\n login_email = multi_email.login_email_record\n\n if login_email && !login_email.primary? && !login_email.confirmed?\n :unconfirmed\n else\n super\n end\n end", "def update!(**args)\n @enable_improved_email_privacy = args[:enable_improved_email_privacy] if args.key?(:enable_improved_email_privacy)\n end", "def unconfirmed\n if current_user.generate_confirmation_token && current_user.save\n Delayed::Job.enqueue EmailResetMailer.new(current_user.id)\n flash[:notice] = t(\"profiles.update.confirmation_mail_sent\")\n else\n flash[:notice] = t(\"try_again\")\n end\n redirect_to edit_profile_path\n end", "def dispute_updated\n UserMailer.dispute_updated\n end", "def changes_notification\n NotifierMailer.changes_notification(User.limit(2), {\n title: 'Email test title',\n content: 'Email test content',\n body: 'Email test body'\n })\n end", "def meteor_map_email\n if attribute_changed?(:email) && email.present?\n existing_meteor_mail = meteor_get_hash_by_email(email)\n if existing_meteor_mail\n emails.delete(existing_meteor_mail)\n if existing_meteor_mail[:verified] == true\n new_mail = build_meteor_mail_hash(email, true)\n skip_confirmation!\n else\n new_mail = build_meteor_mail_hash(email, false)\n end\n else\n new_mail = build_meteor_mail_hash(email, false)\n end\n\n add_to_set(emails: new_mail)\n end\n end", "def new_email=(e)\n if e.present? and e != email\n write_attribute :new_email, e\n end\n end", "def update_user_mark_email_processed\n # Ignore any suspicious looking internal dates. Sometimes\n # misconfigured email servers means that email arrives from the\n # future.\n if internal_date > Time.now\n Log.librato(:count, \"system.process_uid.fix_suspicious_internal_date\", 1)\n self.internal_date = user.last_internal_date\n end\n\n # Update the user.\n user_thread.update_user(:last_uid => uid,\n :last_email_at => Time.now,\n :last_internal_date => internal_date)\n return true\n end", "def email_update\n participant = Participant.first\n participant.email_update_token = Participant.new_token\n ParticipantMailer.email_update(participant)\n end", "def email_confirm!\n update(email_confirmed_at: Time.zone.now)\n end", "def email_changed?\n persisted? ? (email_was != email) : false\n end", "def email_updated(user,old_email)\n @user = user\n @old_email = old_email\n @subject = \"[#{SITE_NAME}] Your email address has been updated\"\n mail(bcc: [@old_email,@user.email].join(\",\"), subject: @subject)\n end", "def update_new_email!(email)\n self.unconfirmed_email = email\n save\n end", "def send_confirmation_email\n # Do Nothing\n end", "def post_approve_email\n NotificationMailer.post_approve_email('[email protected]')\n end", "def send_mail_to_associates\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end", "def nullify_jabber_confirmation\n unconfirm_jabber if saved_change_to_attribute?(:jabber)\n end", "def confirm_email!\n confirm_email\n save_without_session_maintenance(validate: false)\n end", "def after_save(user)\n\n UserMailer.deliver_activation(user) if user.recently_activated? unless user.setup\n UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?\n UserMailer.deliver_reset_password(user) if user.recently_reset_password?\n UserMailer.deliver_forgot_username(user) if user.recently_forgot_username?\n\n end", "def set_alt_email(alt_email)\n # check email is already in use, primary or alt\n if User.find_by_email(alt_email) || User.where([\"alt_email = ? and id <> ?\",alt_email,self.id]).count > 0\n return false\n end\n\n self.alt_email = alt_email\n self.alt_email_confirmed = false\n token = Digest::MD5.hexdigest rand.to_s\n self.alt_confirmation_token = token\n confirm_link = registrations_confirm_alt_email_url(:token => token)\n\n self.touch(:alt_confirmation_sent_at)\n self.save\n\n UserMail.confirm_alt_email(self,confirm_link).deliver\n return true\n end", "def change_email\n if params[:email].present?\n current_user.update_attributes(:email=>params[:email],:uid=>\"\",:provider=>\"\")\n @message = \"Confirmation Mail has been sent ,please confirm to update your email\"\n else\n @message =\"Email is blank or invalid\"\n end\n end", "def needs_password_change_email?\n encrypted_password_changed? && persisted?\n end", "def send_mail_to_associates\n unless self.matter_people.blank?\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end\n end", "def update!(**args)\n @email_sending_config = args[:email_sending_config] if args.key?(:email_sending_config)\n end", "def verify_email!\n self.email_verified_at = Time.now.utc\n self.email_verification_code = nil\n reconcile_privileges! :email_verified\n success = save(false)\n success\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\nend", "def finish_signed_up_but_email_not_confirmed?\n @identity.update(identity_params) && [email protected]?\n end", "def email_status_change_notices\n return if previously_published?\n\n case status\n when 'published', 'embargoed'\n StashEngine::UserMailer.status_change(resource, status).deliver_now\n StashEngine::UserMailer.journal_published_notice(resource, status).deliver_now\n when 'peer_review'\n StashEngine::UserMailer.status_change(resource, status).deliver_now\n StashEngine::UserMailer.journal_review_notice(resource, status).deliver_now\n when 'submitted'\n\n # Don't send multiple emails for the same resource, or for submission made by curator\n return if previously_submitted?\n\n StashEngine::UserMailer.status_change(resource, status).deliver_now\n when 'withdrawn'\n return if note.include?('final action required reminder') # this has already gotten a special withdrawal email\n\n if user_id == 0\n StashEngine::UserMailer.user_journal_withdrawn(resource, status).deliver_now\n else\n StashEngine::UserMailer.status_change(resource, status).deliver_now\n end\n end\n end", "def subscribed_email\n [email protected]_email.blank? ? @changes.old_email : @record.email\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n # Redundant, but makes sure we don't run into password validation issues\n save!(validate: false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def email_activate\n self.email_confirmed = true\n self.confirm_token = nil\n save!(:validate => false)\n end", "def confirm_if_already_confirmed\n if self.email && self.authentications.any?\n new_record? ? skip_confirmation! : skip_reconfirmation!\n end\n end", "def skip_sms_confirmation!\n self.sms_confirmed_at = Time.now\n end", "def skip_email\n @attributes[:skip_email]\n end", "def missing_updates(event)\n warn \"Missing #{event.payload[:count]} updates in a row for #{event.payload[:update_type].to_s.upcase}\"\n\n Mailer.missing_updates(event.payload[:count], event.payload[:update_type].to_s).deliver\n end", "def after_confirmation\n emails_temp = emails\n # we have to do this, by pop and re-adding because\n # MongoDb does not save when update within a nested array when is called by $set\n # So we pop our email out and overwrite the array completely\n # This approach does not work like expected which should update AND PERSIST, which does not work\n # User.where(\"emails.address\" => email)\n # .set('emails.$.verified': true)\n hash = emails.pop { |m| m[:address] == email }\n hash[:verified] = true\n emails_temp << hash\n set(emails: emails_temp)\n end", "def admin_notify\n UserMailer.signup_notification(self).deliver_later!(wait: 1.minute)\n end", "def notify_attribute_changes\n ignore = [\"updated_at\", \"user_id\"]\n changed.each do |property|\n delta = changes[property]\n event_name = \"user_update_item_#{property}\" \n ActivityLogger.send(event_name, :from => self.user, :for => [self], :changes => delta) unless ignore.include? property\n end \n end" ]
[ "0.75823003", "0.7471231", "0.74240315", "0.74240315", "0.74216545", "0.74052703", "0.74052703", "0.74052703", "0.7383321", "0.735523", "0.7203195", "0.7088344", "0.7054859", "0.7006085", "0.69437355", "0.6926634", "0.68013746", "0.6675421", "0.6634806", "0.6575795", "0.6559003", "0.655189", "0.6535427", "0.649796", "0.64614266", "0.6460838", "0.64409167", "0.63891274", "0.63749224", "0.6356548", "0.6350208", "0.63221943", "0.63078773", "0.6307312", "0.6264824", "0.6254152", "0.625343", "0.6231568", "0.62276256", "0.61843055", "0.61619943", "0.6146684", "0.6124868", "0.6113284", "0.6110921", "0.61080587", "0.6106815", "0.608671", "0.6084421", "0.607646", "0.6037551", "0.6037362", "0.60355693", "0.6034539", "0.60190576", "0.5997499", "0.59963834", "0.59963834", "0.59854645", "0.5985122", "0.5985122", "0.59779835", "0.59662634", "0.5957533", "0.5950783", "0.5944231", "0.5940459", "0.593498", "0.5932101", "0.5930333", "0.59294057", "0.59227103", "0.59153944", "0.59086704", "0.5906449", "0.58987325", "0.58939713", "0.58898586", "0.58846146", "0.5884129", "0.5877661", "0.586952", "0.5868688", "0.5868263", "0.58647305", "0.58445996", "0.5843065", "0.58402", "0.58400124", "0.58320534", "0.58318937", "0.58262014", "0.58262014", "0.58236265", "0.58235407", "0.5796332", "0.57828444", "0.57790524", "0.57785887", "0.57769006" ]
0.8626038
0
Skips sending the password change notification after_update source://devise//lib/devise/models/database_authenticatable.rb54
def skip_password_change_notification!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_password_change_notification\n # do not notify the admins for now\n end", "def send_password_change_notification; end", "def need_change_password\n return unless password_expiration_enabled?\n\n self.password_changed_at = nil\n end", "def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end", "def update_password_changed\n if defined?(will_save_change_to_attribute?)\n return unless (new_record? || will_save_change_to_encrypted_password?) && !will_save_change_to_password_changed_at?\n else\n return unless (new_record? || encrypted_password_changed?) && !password_changed_at_changed?\n end\n\n self.password_changed_at = Time.zone.now\n end", "def skip_email_changed_notification!; end", "def update_password_changed\n self.password_changed_at = Time.now if (self.new_record? or self.encrypted_password_changed?) and not self.password_changed_at_changed?\n end", "def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end", "def temporary_password_change_flag\n \"on_temporary_password\"\n end", "def skip_password!\n # Securely remove all password fields, otherwise user cannot confirm.\n self.password = nil\n self.password_confirmation = nil\n self.encrypted_password = ''\n self.skip_password = true\n end", "def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end", "def password_change_new\n\n end", "def after_password_reset; end", "def old_password\n nil\n end", "def update_password(new_password)\n super(new_password).tap do |status|\n UserMailer.password_changed(self).deliver_later if status\n end\n end", "def after_create\n @password = nil\n end", "def after_create\n @password = nil\n end", "def after_password_reset;\n end", "def after_database_authentication\n rotate_stale_password_digest\n end", "def handle_password_change\n return if warden.nil?\n if not devise_controller? and not ignore_password_expire? and not request.format.nil? and request.format.html?\n Devise.mappings.keys.flatten.any? do |scope|\n if signed_in?(scope) and warden.session(scope)['password_expired']\n # re-check to avoid infinite loop if date changed after login attempt\n if send(:\"current_#{scope}\").try(:need_change_password?)\n store_location_for(scope, request.original_fullpath) if request.get?\n redirect_for_password_change scope\n return\n else\n warden.session(scope)[:password_expired] = false\n end\n end\n end\n end\n end", "def need_change_password!\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n need_change_password\n self.save(:validate => false)\n end\n end", "def after_create\n @password = nil\n @confirm_password = nil\n end", "def skip_reactivation!\n @bypass_confirmation_postpone = true\n end", "def reset_password(*args)\n self.legacy_password = false\n super\n end", "def update\n if params[:user][:password].present? || params[:user][:current_password].present?\n super\n else\n @user = User.find(current_user.id)\n if @user.update_without_password(params[:user])\n redirect_to after_update_path_for(@user), :notice => I18n.t(\"devise.registrations.updated\")\n else\n render \"edit\"\n end\n end\n end", "def skip_reconfirmation!; end", "def refresh_ignores(e, params)\n return unless params.first == @password\n load_ignore_list\nend", "def needs_password_change_email?\n encrypted_password_changed? && persisted?\n end", "def before_save_user\n self.encrypted_password.encode! 'utf-8'\n\n # If demo is enabled, demo user cannot change email or password nor be locked\n if Feedbunch::Application.config.demo_enabled\n demo_email = Feedbunch::Application.config.demo_email\n if email_changed? && self.email_was == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user email. Blocking the attempt.'\n self.errors.add :email, 'Cannot change demo user email'\n self.email = demo_email\n end\n\n demo_password = Feedbunch::Application.config.demo_password\n if encrypted_password_changed? && self.email == demo_email\n Rails.logger.info 'Somebody attempted to change the demo user password. Blocking the attempt.'\n self.errors.add :password, 'Cannot change demo user password'\n self.password = demo_password\n end\n\n if locked_at_changed? && self.email == demo_email\n Rails.logger.info 'Keeping demo user from being locked because of too many authentication failures'\n self.locked_at = nil\n end\n\n if unlock_token_changed? && self.email == demo_email\n Rails.logger.info 'Removing unlock token for demo user, demo user cannot be locked out'\n self.unlock_token = nil\n end\n end\n end", "def password_changed?\n !@new_password.blank?\n end", "def password_changed?\n !@new_password.blank?\n end", "def password_changed?\n !password.blank?\n end", "def skip_confirmation_notification!; end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end", "def need_change_password?\n password_change_requested? || password_too_old?\n end", "def forget_password\n Notifier.forget_password\n end", "def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end", "def skip_password_check(*)\n puts \"Skipped password check\"\n true\n end", "def update_without_password(params, *options)\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end", "def change_password\r\n \r\n end", "def on_temporary_password?\n send(temporary_password_change_flag)\n end", "def password_changed_confirm\n pw_change_confirm.click\n end", "def change_password\n set_breadcrumbs(\"change_password\") \n if request.post? || request.patch? \n admin = Admin.find(current_admin.id)\n @check = params[:admin][:password] == params[:admin][:password_confirmation] && params[:admin][:password].present? && params[:admin][:password_confirmation].present?\n if admin.present? && admin.valid_password?(params[:admin][:old_password])\n if @check \n if admin.update_attribute(:password, params[:admin][:password])\n sign_in admin, :bypass => true\n flash[:notice] = I18n.t('change_password.update.success')\n redirect_to admin_root_path\n else\n flash[:error] = I18n.t('common.error') \n end\n else\n flash[:error] = I18n.t('change_password.failure.password_is_not_match')\n end\n else\n flash[:error] = I18n.t('change_password.failure.invalid_old_password')\n end\n end\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def password_changed?\n orig_pw_hash = self.instance_variable_get(:@old_password_hash)\n self.new_record? || (!orig_pw_hash.nil? && orig_pw_hash != self.password_hash)\n end", "def password_changed?\n Candidate.password_changed?(password)\n # !valid_password?(Event::Other::INITIAL_PASSWORD)\n end", "def create\n flash[:password_change_info] = t('devise.passwords.send_paranoid_instructions')\n super\n end", "def reset_password!(*args)\n self.legacy_password_hash = nil\n super\n end", "def need_change_password\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n self.password_changed_at = self.expire_password_after.seconds.ago\n end\n\n # is date not set it will set default to need set new password next login\n need_change_password if self.password_changed_at.nil?\n\n self.password_changed_at\n end", "def is_not_pending_recovery!\n self.update_attribute(:verification_key, nil) if self.is_pending_recovery?\n end", "def disable_empty_password_validation()\n @password = \"non-empty\"\n end", "def password_changeable?\n @password_changeable\n end", "def password_being_changed?(user)\n user[:password].present? ||\n user[:password_confirmation].present?\n end", "def disable_password_reset(username, first, last, app,config)\n puts \" Setting password reset to false for |#{username}|.\" if $options.verbose\n # need to get the admin setting code put in place NOTENOTENOTE\n # if config['source']['admins'].include?(nickname)\n # admin = true\n # else\n # admin = false\n # end\n admin = false\n begin\n result = app.provision.update_user(username, first, last, nil, nil, admin.to_s, nil, \"false\", nil )\n STDERR.puts \"Result: #{result}\" if $options.debug\n update = true\n rescue GData::GDataError => e\n if e.code == \"1300\"\n STDERR.puts \" => Set password reset to false #{username} exists\" if $options.verbose\n update = true\n elsif e.code == \"1000\"\n STDERR.puts \" => setting password reset to false #{username} unknown error\" if $options.verbose\n update = false\n #retry\n else\n STDERR.puts \"Error creating user: #{username}\" if $options.verbose\n raise e\n end\n end\nend", "def disable_password_reset(username, first, last, app,config)\n puts \" Setting password reset to false for |#{username}|.\" if $options.verbose\n # need to get the admin setting code put in place NOTENOTENOTE\n # if config['source']['admins'].include?(nickname)\n # admin = true\n # else\n # admin = false\n # end\n admin = false\n begin\n result = app.provision.update_user(username, first, last, nil, nil, admin.to_s, nil, \"false\", nil )\n STDERR.puts \"Result: #{result}\" if $options.debug\n update = true\n rescue GData::GDataError => e\n if e.code == \"1300\"\n STDERR.puts \" => Set password reset to false #{username} exists\" if $options.verbose\n update = true\n elsif e.code == \"1000\"\n STDERR.puts \" => setting password reset to false #{username} unknown error\" if $options.verbose\n update = false\n #retry\n else\n STDERR.puts \"Error creating user: #{username}\" if $options.verbose\n raise e\n end\n end\nend", "def disable_password_reset(username, first, last, app,config)\n puts \" Setting password reset to false for |#{username}|.\" if $options.verbose\n # need to get the admin setting code put in place NOTENOTENOTE\n # if config['source']['admins'].include?(nickname)\n # admin = true\n # else\n # admin = false\n # end\n admin = false\n begin\n result = app.provision.update_user(username, first, last, nil, nil, admin.to_s, nil, \"false\", nil )\n STDERR.puts \"Result: #{result}\" if $options.debug\n update = true\n rescue GData::GDataError => e\n if e.code == \"1300\"\n STDERR.puts \" => Set password reset to false #{username} exists\" if $options.verbose\n update = true\n elsif e.code == \"1000\"\n STDERR.puts \" => setting password reset to false #{username} unknown error\" if $options.verbose\n update = false\n #retry\n else\n STDERR.puts \"Error creating user: #{username}\" if $options.verbose\n raise e\n end\n end\nend", "def password_change(record, opts={})\n MnoEnterprise::MailClient.deliver('password-change',\n default_sender,\n recipient(record),\n user_vars(record)\n )\n end", "def will_save_change_to_encrypted_password?\n changed.include? 'encrypted_password'\n end", "def password_change_requested?\n return false unless password_expiration_enabled?\n return false if new_record?\n\n password_changed_at.nil?\n end", "def skip_reconfirmation_in_callback!; end", "def lost_password_with_cas\n if request.post?\n user = User.find_by_mail(params[:mail])\n flash.now[:error] = l(:notice_can_t_change_password) and return if (user and !user.change_password_allowed?)\n lost_password_without_cas\n end\n end", "def skip_confirmation_auth \n if self.provider\n self.skip_confirmation_notification! \n self.confirmed_at = Time.now\n end\n end", "def password_changed_messages\n pw_change_message.text\n end", "def clean_up_passwords; end", "def admin_pwd_update\n @user = User.find_by_id(params[:user_id])\n @user.validate_pwd = true\n if @user.update(email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])\n # if an admin is updating her own password, we need to get around Devise's automatic sign out\n if @user.id == current_user.id\n sign_in(@user, :bypass => true)\n end\n flash.keep[:notice] = 'The password for \"' + params[:user][:email] + '\" was successfully updated.'\n redirect_to '/users'\n else\n render :admin_pwd\n end\n end", "def update_without_password(params, *options); end", "def password_change\n respond_to do |format|\n if @user.update_with_password(password_change_params)\n bypass_sign_in(@user)\n format.html { redirect_to request.referer || root_url, notice: 'User password has been successfully updated.' }\n else\n format.html { render 'password_change_new' }\n end\n end\n end", "def user_updated_password user\n data = {\n category: 'Users',\n action: 'Updated Password',\n label: user.email,\n value: nil,\n bounce: true,\n }\n\n create_event data\n end", "def do_notify_disabled(transition)\n if user && Rails.application.settings.enforce_rules\n UserMailer.access_revoked(user, self).deliver_later\n end\n end", "def password_changed?\n !self.password.blank? or self.encrypted_password.blank?\n end", "def password_changed(user)\n mail_to user, password_changed_subject\n end", "def unset_auto_managed_password\n password = params[:user][:entered_password].strip\n if params[:user][:entered_password_confirmation].blank? && !password.blank? && User.hash_password(password) == User.find(current_user.id).hashed_password\n params[:user][:entered_password] = ''\n end\n end", "def allow_users_to_change_passwords?\n @policy.allow_users_to_change_password\n end", "def password_changed?\n !@new_password.blank?\n end", "def clean_up_passwords\n self.password = self.password_confirmation = nil\n end", "def disable_two_factor!\n update!(\n otp_required_for_login: false,\n otp_secret: nil,\n otp_backup_codes: nil)\n end", "def change_temp_password\n\tend", "def require_password_change\n @attributes[:require_password_change]\n end", "def disable_two_factor!\n\n update_attributes second_factor_enabled: false, encrypted_otp_secret_key: nil\n\n end", "def update_without_password(params, *options)\n params.delete(:password) if params[:password].blank?\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def check_password_change_required?\n password_change_required || check_password_expired?\n end", "def password_changed?\n hashed_password_changed?\n end", "def update_without_password(params={})\n\n params.delete(:password)\n params.delete(:password_confirmation)\n result = update_attributes(params)\n clean_up_passwords\n result\n end", "def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end", "def validate_on_update\n unless plain_password.blank?\n unless plain_password == password_confirmation\n errors.add_to_base(\"Passwords don't match\")\n end\n # Validate password criteria\n unless plain_password.length >= 6\n errors.add_to_base(\"Password must be at least 6 characters long.\")\n end\n end\n end", "def change_password\n # https://github.com/site5/lumberg\n server = Lumberg::Whm::Server.new(host: HOST_NAME, hash: `cat #{HASH_FILE_PATH}`)\n cp_email = Lumberg::Cpanel::Email.new(server: server, api_username: @username)\n @password = SecureRandom.urlsafe_base64(12)\n process_options = { domain: @domain, email: @email, password: @password }\n passwd_result = cp_email.change_password(process_options)\n if passwd_result[:params][:data][0][:reason] == ''\n puts \"Successfully changed password of #{@email}\"\n time = Time.new\n logtime = time.strftime('%Y-%m-%d %H:%M')\n File.open(\"#{LOG_FILE_PATH}\", 'a') { |logfile| logfile.puts \"#{logtime}: #{@email}\" }\n else\n # Print c-panel error message if failed to change the password\n puts \"#{passwd_result[:params][:data][0][:reason]}\"\n end\n end", "def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end", "def set_password; nil; end", "def clean_up_passwords(user)\n super unless user.authentications.present?\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end" ]
[ "0.79985917", "0.79082507", "0.7330819", "0.69929194", "0.6887515", "0.68704677", "0.68663627", "0.68076414", "0.6806406", "0.6739717", "0.6716247", "0.6642115", "0.6641028", "0.6597612", "0.6583814", "0.6553224", "0.6553224", "0.64966995", "0.6485496", "0.6481374", "0.6456987", "0.6453363", "0.64494985", "0.6423245", "0.6395279", "0.6390505", "0.6365875", "0.6362861", "0.63588566", "0.6332243", "0.6332243", "0.6320134", "0.63191485", "0.63099164", "0.630264", "0.6298296", "0.62898046", "0.6268785", "0.62563187", "0.6253981", "0.62432617", "0.62359464", "0.62242687", "0.61927235", "0.6189121", "0.617978", "0.617978", "0.6173507", "0.6158313", "0.6158151", "0.6153696", "0.6146062", "0.6141152", "0.6134438", "0.6131838", "0.6126703", "0.6123698", "0.6123698", "0.6123698", "0.6115246", "0.610772", "0.61002845", "0.6099224", "0.60955846", "0.60832816", "0.60800016", "0.6065736", "0.60606414", "0.6050316", "0.6048469", "0.60459703", "0.60421586", "0.6038057", "0.60374284", "0.6035535", "0.6031478", "0.6026555", "0.6020709", "0.6020148", "0.6012788", "0.600437", "0.5999987", "0.5996282", "0.5987132", "0.598094", "0.5974484", "0.59679073", "0.5956137", "0.5942927", "0.5936697", "0.592811", "0.59268916", "0.59220785", "0.59220785", "0.59220785", "0.59220785", "0.59220785", "0.59220785", "0.59220785", "0.59220785" ]
0.8849271
0
Update record attributes when :current_password matches, otherwise returns error on :current_password. This method also rejects the password field if it is blank (allowing users to change relevant information like the email without changing their password). In case the password field is rejected, the confirmation is also rejected as long as it is also blank. source://devise//lib/devise/models/database_authenticatable.rb87
def update_with_password(params, *options); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_with_password(params={})\n current_password = params.delete(:current_password)\n check_password = true\n if params[:password].blank?\n params.delete(:password)\n if params[:password_confirmation].blank?\n params.delete(:password_confirmation)\n check_password = false\n end \n end\n result = if valid_password?(current_password) || !check_password\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password) \n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n # if params[:password].blank?\n # params.delete(:password)\n # params.delete(:password_confirmation) if params[:password_confirmation].blank?\n # end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def change_password!(password_attributes)\n unless skip_current_password\n self.current_password = password_attributes[:current_password]\n authenticated = validate_current_password\n else\n authenticated = true\n end\n self.skip_current_password = true\n assign_attributes(password_attributes)\n validated = authenticated && valid?\n self.skip_current_password = nil\n if validated\n update_attribute(:password, password_attributes[:password])\n else\n false\n end\n end", "def update\n current_password = params.delete(:current_password)\n unless @user.authenticate(current_password)\n @user.errors.add(:current_password, t('activerecord.errors.models.user.attributes.current_password.invalid'))\n end\n\n respond_to do |format|\n if @user.errors.empty? and @user.update(user_params)\n format.html { redirect_to users_url,\n notice: t('activerecord.attributes.user.messages.updated', name: @user.name) }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n\t\tcurrent_password = params.delete(:current_password) if !params[:current_password].blank?\n\t\t\n\t\tif params[:password].blank?\n\t\t\tparams.delete(:password)\n\t\t\tparams.delete(:password_confirmation) if params[:password_confirmation].blank?\n\t\tend\n\t\t\n\t\tresult = if has_no_password? || valid_password?(current_password)\n\t\t\tr = update_attributes(params)\n\t\t\tupdate_attribute(:has_password, true) if params[:password].present?\n\t\t\tr\n\t\telse\n\t\t\tself.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n\t\t\tself.attributes = params\n\t\t\tfalse\n\t\tend\n\t\t\n\t\tclean_up_passwords\n\t\tresult\n\tend", "def update\n if correct_password_check account_update_params[:current_password]\n \n pw_params = params[:user].permit(:current_password, :password, :password_confirmation, :first_name, :last_name)\n # Handle updating password if they added anything.\n if (current_user.valid_password?(pw_params[:password]) || current_user.valid_password?(pw_params[:password_confirmation]))\n # Passwords are the same, do nothing.\n elsif (pw_params[:password] == pw_params[:password_confirmation] && pw_params[:password].length > 6)\n # Password are different.\n current_user.password = pw_params[:password]\n current_user.password_confirmation = pw_params[:password_confirmation]\n current_user.save!\n flash.alert = \"Success: Password has been changed!\"\n end\n\n \n user_params = params[:user].except(:current_password, :password, :password_confirmation).permit(:first_name, :last_name, :email)\n unless current_user.update!( user_params )\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n\n flash.alert = \"Success: Account has been updated!\"\n redirect_to edit_user_registration_path\n end\n end", "def update_with_password(params={})\n # TODO Remove me in next release\n if params[:old_password].present?\n params[:current_password] ||= params[:old_password]\n ActiveSupport::Deprecation.warn \"old_password is deprecated, please use current_password instead\", caller\n end\n\n params.delete(:password) if params[:password].blank?\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n current_password = params.delete(:current_password)\n\n result = if valid_password?(current_password)\n update_attributes(params)\n else\n message = current_password.blank? ? :blank : :invalid\n self.class.add_error_on(self, :current_password, message, false)\n self.attributes = params\n false\n end\n\n clean_up_passwords unless result\n result\n end", "def update_with_password(params={})\n params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n\n end", "def update_with_password(params={},email)\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n skip_current_password = true\n else\n current_password = params.delete(:current_password)\n skip_current_password = false\n end\n\n if skip_current_password && email != params[:email]\n current_password = params.delete(:current_password)\n skip_current_password = false\n end\n\n result = if skip_current_password || valid_password?(current_password)\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n\n clean_up_passwords\n result\n end", "def update_password\n if params[:current_password].present? && @current_user.valid_password?(params[:current_password])\n @current_user.update(password: params[:new_password])\n if @current_user.errors.any?\n render json: @current_user.errors.messages, status: 400\n else\n render json: { message: \"Password updated successfully!\" }, status: 200\n end\n else\n render json: { message: \"Current Password is not present or invalid!\" }, status: 400\n end\n rescue StandardError => e # rescue if any exception occurr\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "def update_password password, password_confirmation, old_password\n if crypted_password.blank?\n self.password, self.password_confirmation = password, password_confirmation\n elsif authenticated_by_password? old_password\n self.password, self.password_confirmation = password, password_confirmation\n true\n else\n errors.add :base, t(:invalid_old_password)\n false\n end\n end", "def update_password\n if params[:current_password].present? && @user.valid_password?(params[:current_password])\n @user.update(password: params[:new_password])\n if @user.errors.any?\n render json: @user.errors.messages, status: 400\n else\n render json: { message: \"Password updated successfully!\" }, status: 200\n end\n else\n render json: { message: \"Current Password is not present or invalid!\" }, status: 400\n end\n rescue StandardError => e # rescue if any exception occurr\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_password\n @user = current_user\n\n if @user.valid_password?(params[:user][:current_password])\n if params[:user][:password] == params[:user][:current_password]\n flash[:notice] = 'Current Password and New Password should not be same.'\n redirect_to(:back)\n elsif @user.update!(user_params)\n flash[:success] = 'Password updated successfully, please login with the new password.'\n redirect_to new_user_session_path\n end\n else\n flash[:notice] = 'Please enter valid current password.'\n redirect_to(:back)\n end\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_password\n @user = User.find(params[:id])\n\n if params[:current_password] && [email protected](params[:current_password])\n flash.now[:fail] = \"Current password incorrect\"\n render :change_password\n elsif @user.update_attributes(params[:user])\n flash[:success] = \"Updated password\"\n redirect_to user_url(@user)\n else\n flash.now[:errors] = @user.errors.full_messages\n\n # Render appropriate template\n if params[:current_password]\n render :change_password\n else\n render :reset_password\n end\n end\n end", "def update_password\n if current_user.update_with_password(update_password_params)\n expose current_user\n else\n error! :invalid_resource, current_user.errors\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params.except(:current_password), *options)\n else\n update_with_password_pass(params)\n end\n end", "def correct_password?(params)\n self.current_password = params[:user][:current_password]\n self.password == self.current_password\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params[\"password\"]&.present?\n # Allows user to update registration information without password.\n resource.update_without_password(params.except(\"current_password\"))\n end", "def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end", "def password_errors(params)\n # Use User model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"is incorrect\")\n end", "def update\n @user = User.find(current_user.id)\n\n successfully_updated = if needs_password?(@user, params)\n @user.update_with_password(params.require(:user).permit(:city, :email, :image, :mobile, :name, :current_password, :password, :password_confirmation))\n # Rails 3: @user.update_with_password(params[:user])\n else\n # remove the virtual current_password attribute update_without_password\n # doesn't know how to ignore it\n params[:user].delete(:current_password)\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n @user.update_without_password(params.require(:user).permit(:city, :email, :image, :mobile, :name))\n # Rails 3: @user.update_without_password(params[:user])\n end\n\n if successfully_updated\n set_flash_message :notice, :updated\n # Sign in the user bypassing validation in case his password changed\n sign_in @user, :bypass => true\n redirect_to after_update_path_for(@user)\n else\n render \"edit\"\n end\n end", "def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end", "def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params['password']&.present?\n\n # Allows user to update registration information without password.\n resource.update_without_password(params.except('current_password'))\n end", "def update_resource(resource, params)\n if params[\"password\"]&.present? or params[\"email\"]&.present?\n return super\n else\n resource.update_without_password(params.except(\"current_password\"))\n end\n end", "def update\n if params[:user][:password].present? || params[:user][:current_password].present?\n super\n else\n @user = User.find(current_user.id)\n if @user.update_without_password(params[:user])\n redirect_to after_update_path_for(@user), :notice => I18n.t(\"devise.registrations.updated\")\n else\n render \"edit\"\n end\n end\n end", "def password_errors(params)\n # Use User model's valid? method to ggenerate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n\n errors.add(:current_password, \"is incorrect\")\n end", "def password_errors(params)\n # Use User model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"가 일치하지 않습니다\")\n end", "def update_password\n @user = User.find(current_user.id)\n unless [email protected]_password? params[:user]\n if @user.update_with_password(params[:user])\n sign_in @user, :bypass => true\n else\n @user.errors[:current_password].shift\n @user.errors.add(:current_password, \"The given password is invalid\")\n render \"change_password\", :user => @user\n end\n else\n render \"change_password\", :user => @user\n end\n end", "def update_password(old_password, new_password, new_password_confirmation)\n if self.authenticated?(old_password)\n if new_password.blank?\n false\n elsif new_password == new_password_confirmation\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n self.save\n else\n false\n end\n else\n false\n end\n end", "def update_resource(resource, params)\n return super if params[\"password\"]&.present?\n resource.update_without_password(params.except(\"current_password\"))\n end", "def update_attributes(attributes = {}, options = {})\n %i(password password_confirmation).select do |attr|\n attributes[attr].present?\n end.each do |attr|\n send(\"#{attr}=\", attributes[attr])\n attributes.delete(attr)\n end\n attributes[:encrypted_password] = encrypted_password\n\n return false unless valid?\n\n super(attributes, options)\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def password_errors(params)\n # Use PdUser model's valid? method to generate error messages\n # for a password mismatch (if any).\n self.password = params[:pd_user][:password]\n self.password_confirmation = params[:pd_user][:password_confirmation]\n valid?\n # The current password is incorrect, so add an error message.\n errors.add(:current_password, \"is incorrect\")\n end", "def match_current_password_hash\n\n evaluated_password_e = Admin.get_encrypted_password(@current_password, @login_salt_d)\n\n return error_with_data(\n 'am_l_cp_7',\n 'Change Password Error',\n '',\n GlobalConstant::ErrorAction.default,\n {},\n {current_password: 'Invalid Password'}\n ) unless (evaluated_password_e == @admin.password)\n\n success\n end", "def valid_password?(password_input)\n if using_old_validation?\n Devise.secure_compare(cakephp_password_digest(password_input), self.old_password).tap do |validated|\n if validated\n self.password = password_input\n self.old_password = nil\n self.save(:validate => false)\n end\n end\n else\n super(password_input)\n end\n end", "def validate_new_password\n if new_record? and self.read_attribute(:crypted_password).to_s.blank? and !@password_updated\n errors.add :password, :blank\n elsif @password_updated\n if @password.to_s.size < 4\n errors.add :password, :invalid_password\n elsif @password.to_s != @password_confirmation.to_s\n errors.add :password, :no_match_password\n end\n end\n end", "def update_password\n current_password = params[:current_password]\n correct_password = @account.password\n if current_password == correct_password\n @account.password = params[:account_password]\n flash.now[:message] = \"你的密码已成功修改\" if @account.save\n else\n flash.now[:error_msg] = \"你输入的当前密码不正确, 不能修改密码\"\n end\n \n render :action => \"edit\"\n end", "def valid_password?(password)\n if legacy_password?\n # Use Devise's secure_compare to avoid timing attacks\n return false unless Devise.secure_compare(encrypted_password,\n User.legacy_password(password))\n\n self.attributes = { password: password,\n password_confirmation: password,\n legacy_password: false }\n\n save!\n end\n\n super password\n end", "def update_with_password params, *options\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_attributes_and_password(attrs)\n self.assign_attributes(attrs)\n self.valid?\n if self.password.present? && confirm_passwords\n self.password_hash = Digest::SHA256.hexdigest(self.password + Rails.application.secrets.salt)\n end\n if self.errors.empty?\n self.save\n end\n end", "def update_password\n @user = current_user\n\n old_password = params[:old_password]\n new_password = params[:new_password]\n\n if old_password == '' || new_password == ''\n flash[:notice] = I18n.t('accounts.password_blank')\n elsif @user.valid_password?(old_password)\n flash[:notice] = I18n.t('accounts.password_wrong')\n else\n @user.update_attributes(password: new_password)\n flash[:notice] = I18n.t('accounts.password_update_successful')\n end\n\n respond_with @user, location: :account\n end", "def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end", "def update_password\n @user = current_user\n\n old_password = params[:old_password]\n new_password = params[:new_password]\n\n if old_password == '' or new_password == ''\n flash[:notice] = I18n.t('accounts.password_blank')\n elsif @user.valid_password?(old_password)\n flash[:notice] = I18n.t('accounts.password_wrong')\n else\n @user.update_attributes(:password => new_password)\n flash[:notice] = I18n.t('accounts.password_update_successful')\n end\n\n respond_with @user, :location => :account\n end", "def update\n @profile = Profile.find(params[:id])\n @user = User.find(params[:profile][:user_id])\n\n password_changed = !params[:user][:current_password].nil? && !params[:user][:current_password].empty?\n\n password = params[:user][:password]\n confirmation_password = params[:user][:password_confirmation]\n\n successfully_updated = if password_changed\n\n if (password.nil? || password.blank?) && (confirmation_password.nil? || confirmation_password.blank?)\n\n if password.nil? || password.blank?\n @user.errors.add(:password, I18n.t('activerecord.errors.models.user.attributes.password.blank'))\n end\n\n if confirmation_password.nil? || confirmation_password.blank?\n @user.errors.add(:confirmation_password, I18n.t('activerecord.errors.models.user.attributes.password_confirmation.blank'))\n end\n\n else\n @user.update_with_password(params[:user])\n end\n else\n params[:user].delete(:current_password)\n @user.update_without_password(params[:user])\n end\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile]) && successfully_updated && @user.errors.empty? #&& @user.update_attributes(params[:user])\n format.html { redirect_to '/' }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def password_match_password_confirmation\n if password != password_confirmation\n errors.add(:password_confirmation, I18n.t(\".activerecord.errors.models.user.attributes.password_confirmation\"))\n end\n end", "def update_resource(resource, params)\n logger.info \"-----------------\\nAccount params: #{params.inspect}\"\n if params[:password].blank?\n resource.update_without_password(User.sanitize_attributes(params))\n\n else\n logger.info \"Updating with password: #{User.sanitize_attributes(params).inspect} \"\n\n # Instead of calling resource.update_with_password, password is not required\n\n\n # Tweak to bypass the required :current_password and :encrypted_password by Devise, so password can be updated too.\n resource.password = params[:password]\n\n result = if resource.valid_password?(params[:password])\n\n resource.update_attributes(params)\n\n else\n resource..assign_attributes(params)\n resource.valid?\n resource.errors.add(:password, params[:password].blank? ? :blank : :invalid)\n false\n end\n\n resource.clean_up_passwords\n result\n end\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if\n params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params, *options)\n\t\tif encrypted_password.blank?\n\t\t\tupdate_attributes(params, *options)\n\t\telse\n\t\t\tsuper\n\t\tend\n\tend", "def update\n auth_password = self.class.klass.auth_password\n self.send(\"current_#{self.class.klass_sym}\")&.update_password(password_params[auth_password])\n render json: { meesage: \"update password successful\"}, status: 200\n rescue UserError => e\n render json: { error: e.message }, status: e.status\n end", "def update \n @account = current_user.account\n if @account.authenticate(params[:account].delete(:current_password))\n if params[:edit] == \"email\" # special treatment for email\n @account.send_confirmation_instructions(params[:account][:email])\n flash[:notice] = I18n.t(:\"confirmations.sent\", \n :email => params[:account][:email]).html_safe\n # do not update current email unless it is not confirmed\n if @account.confirmed? \n redirect_to edit_account_path\n return\n end\n end \n if params[:edit] == \"password\"\n params[:account][:password_set_at] = Time.now\n end\n if @account.update_attributes(params[:account])\n redirect_to edit_account_path\n else\n render 'edit'\n end\n else \n @account.errors.add(:current_password, I18n.t(:'accounts.wrong_password'))\n render 'edit'\n end\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def change_password (current_pass, new_pass, confirm_pass)\n return valid? unless @current_password = password?(current_pass)\n password_with_confirmation(new_pass, confirm_pass)\n valid?\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = update_attributes(params)\n clean_up_passwords\n result\n end", "def correct_password?(params)\n current_password=params[:user][:current_password]\n password == current_password\n end", "def update_with_password(params={}) \n if params[:password].blank? \n params.delete(:password) \n params.delete(:password_confirmation) if params[:password_confirmation].blank? \n end \n update_attributes(params) \n end", "def update_password\n @teacher = current_teacher\n\n # case 1 - verify current password\n my_params = password_params\n if (! @teacher.authenticate( my_params[:current_password]))\n flash[:danger] = \"Incorrect password entered\"\n redirect_to password_path\n\n # case 2 - new password and confirmation must match\n elsif my_params[:password] != my_params[:password_confirmation]\n flash[:danger] = \"New password and confirmation don't match\"\n redirect_to password_path\n\n # case 3 - update new password, error if this fails\n else\n @teacher.password = my_params[:password]\n if @teacher.save\n flash[ :success] = \"Password change successful\"\n redirect_to profile_path\n else\n render 'password' # saving new password failed\n end\n end\n end", "def update_resource(resource, params)\n if !current_user.provider.blank?\n params.delete(\"current_password\")\n resource.update_without_password(params)\n else\n resource.update_with_password(params)\n end\n end", "def update\n # require password to change account information\n if @currentUser && @currentUser.authenticate(user_params[:password])\n\n updatedParams = user_params\n\n updatedParams[:password] = updatedParams[:new_password]\n updatedParams.delete(:new_password)\n\n if @currentUser.update_attributes(updatedParams)\n head :no_content\n else\n render json: { errors: @currentUser.errors.messages }, status: 422\n end\n else\n render json: { errors: @currentUser.errors.messages }, status: 401\n end\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def should_validate_password?\n updating_password || new_record?\n end", "def should_validate_password?\n updating_password || new_record?\n end", "def update_with_password(params, *options)\n if authentications.present?\n update_attributes(params, *options)\n else\n super\n end\n end", "def password_needed?\n resource.authentications.empty? \\\n ? resource.update_with_password(params[resource_name])\\\n : resource.update_attributes(params[resource_name])\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes p\n end", "def change_password\n if params[:user][:current_password].present? && params[:user][:password].present?\n @user = @current_user.update_with_password(change_password_params)\n if @user\n render_json({:result=>{:messages =>[\"ok\"],:rstatus=>1, :errorcode =>\"\"},:data=>{:messages =>[\"Your Password Successfully updated\"]}}.to_json)\n else\n render_json({:result=>{:messages =>@current_user.display_errors,:rstatus=>0, :errorcode => 404}}.to_json)\n end\n else\n render_json({:result=>{:messages =>[\"Invaild User / Current Password and Password required\"],:rstatus=>0, :errorcode => 404}}.to_json)\n end\n end", "def update_password\n @user = User.authenticate(params[:login], params[:current_password])\n if @user.nil?\n respond_to do |format|\n format.html { render :action => \"edit\" }\n format.xml { render :text => \"error\" }\n end\n else\n respond_to do |format|\n if @user.update_attributes!(params[:user])\n flash[:notice] = 'Your account was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { render :text => \"success\"}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors,\n :status => :unprocessable_entity }\n end\n end\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def reset_password(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n\n validates_presence_of :password\n validates_confirmation_of :password\n validates_length_of :password, within: Devise.password_length, allow_blank: true\n\n if errors.empty?\n clear_reset_password_token\n self.status = User.statuses[:active]\n save(validate: false)\n end\n end", "def update_resource(resource, params)\n if !current_user.provider.nil?\n params.delete(\"current_password\")\n resource.update_without_password(params)\n else\n resource.update_with_password(params)\n end\n end", "def update\n begin\n _params = update_password_params\n if _params[:password].length < Devise.password_length.min\n render json: {errors: [\"Too short password.\"]}, status: :bad_request\n return\n elsif _params[:password].length > Devise.password_length.max\n render json: {errors: [\"Too long password.\"]}, status: :bad_request\n return\n end\n user = User.reset_password_by_token(_params)\n render json: user, status: :ok\n rescue => e\n logger.error(\"Password update failed. #{e.message}\")\n render json: {errors: [\"Password update failed.\"]}, status: :internal_server_error\n return\n end\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update\n @user = User.find(current_user)\n validation = (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n params[:user].delete(\"password\") unless (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n sign_in @user, :bypass => true\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end" ]
[ "0.77494603", "0.77024186", "0.7697754", "0.76928836", "0.76642567", "0.7635449", "0.7461196", "0.7435228", "0.7409794", "0.7387444", "0.7369122", "0.72887677", "0.7243417", "0.7171882", "0.71573776", "0.7133115", "0.708356", "0.7052398", "0.7052398", "0.70448095", "0.7022449", "0.70195657", "0.70195657", "0.70195657", "0.7006307", "0.69575965", "0.6917569", "0.6915401", "0.69149745", "0.6906315", "0.68929684", "0.68805724", "0.6879479", "0.6879479", "0.6854918", "0.68541557", "0.6851101", "0.6844859", "0.6838898", "0.6832451", "0.6832358", "0.6819805", "0.67945397", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67325914", "0.67143214", "0.67117095", "0.6698398", "0.6680606", "0.6672868", "0.66649216", "0.6661431", "0.6622399", "0.6607561", "0.6600382", "0.6593525", "0.65867835", "0.6577141", "0.65670794", "0.65414745", "0.65414745", "0.6530324", "0.6524754", "0.6523306", "0.65147936", "0.65064013", "0.65064013", "0.6500414", "0.64968675", "0.64907825", "0.6482458", "0.648056", "0.6470099", "0.6468505", "0.6461392", "0.64436954", "0.6441043", "0.64386207", "0.64372313", "0.6430006", "0.6421344", "0.64209807", "0.64048284", "0.64035094", "0.6400676", "0.6396934", "0.6396934", "0.63863844", "0.6381091", "0.6381091", "0.6381091", "0.6381091", "0.6381091" ]
0.0
-1
Updates record attributes without asking for the current password. Never allows a change to the current password. If you are using this method, you should probably override this method to protect other attributes you would not like to be updated without a password. Example: def update_without_password(params, options) params.delete(:email) super(params) end source://devise//lib/devise/models/database_authenticatable.rb129
def update_without_password(params, *options); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_without_password(params, *options)\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_password(params, *options)\n params.delete(:password) if params[:password].blank?\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_password(params={})\n\n params.delete(:password)\n params.delete(:password_confirmation)\n result = update_attributes(params)\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password params, *options\n if encrypted_password.blank?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_with_password(params, *options)\n\t\tif encrypted_password.blank?\n\t\t\tupdate_attributes(params, *options)\n\t\telse\n\t\t\tsuper\n\t\tend\n\tend", "def update_with_password(params={})\n params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if\n params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update_without_password(params, *options)\n params.delete(:current_password)\n super(params)\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n \n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n \n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_with_password(params={}) \n if params[:password].blank? \n params.delete(:password) \n params.delete(:password_confirmation) if params[:password_confirmation].blank? \n end \n update_attributes(params) \n end", "def update_without_current_password(params, *options)\n params.delete(:current_password)\n if params[:password].blank? && params[:password_confirmation].blank?\n params.delete(:password)\n params.delete(:password_confirmation)\n end\n result = update_attributes(params, *options)\n clean_up_passwords\n result\n end", "def update_with_password(params={},email)\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n skip_current_password = true\n else\n current_password = params.delete(:current_password)\n skip_current_password = false\n end\n\n if skip_current_password && email != params[:email]\n current_password = params.delete(:current_password)\n skip_current_password = false\n end\n\n result = if skip_current_password || valid_password?(current_password)\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n\n clean_up_passwords\n result\n end", "def update_attributes(attributes = {}, options = {})\n %i(password password_confirmation).select do |attr|\n attributes[attr].present?\n end.each do |attr|\n send(\"#{attr}=\", attributes[attr])\n attributes.delete(attr)\n end\n attributes[:encrypted_password] = encrypted_password\n\n return false unless valid?\n\n super(attributes, options)\n end", "def update_with_password(params, *options)\n if encrypted_password.blank?\n update_attributes(params.except(:current_password), *options)\n else\n update_with_password_pass(params)\n end\n end", "def update_with_password(params={})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = update_attributes(params)\n clean_up_passwords\n result\n end", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update_attributes(params)\n end", "def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end", "def update_with_password(params={})\n params.delete(:current_password)\n self.update_without_password(params)\n end", "def update_resource(resource, params)\n if params[\"password\"]&.present? or params[\"email\"]&.present?\n return super\n else\n resource.update_without_password(params.except(\"current_password\"))\n end\n end", "def update_with_password(params = {})\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n update(params)\n end", "def update_resource(resource, params)\n return super if params[\"password\"]&.present?\n resource.update_without_password(params.except(\"current_password\"))\n end", "def update_with_password(params, *options)\n if authentications.present?\n update_attributes(params, *options)\n else\n super\n end\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params[\"password\"]&.present?\n # Allows user to update registration information without password.\n resource.update_without_password(params.except(\"current_password\"))\n end", "def update_with_password(params={})\n # TODO Remove me in next release\n if params[:old_password].present?\n params[:current_password] ||= params[:old_password]\n ActiveSupport::Deprecation.warn \"old_password is deprecated, please use current_password instead\", caller\n end\n\n params.delete(:password) if params[:password].blank?\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n current_password = params.delete(:current_password)\n\n result = if valid_password?(current_password)\n update_attributes(params)\n else\n message = current_password.blank? ? :blank : :invalid\n self.class.add_error_on(self, :current_password, message, false)\n self.attributes = params\n false\n end\n\n clean_up_passwords unless result\n result\n end", "def update_resource(resource, params)\n # Require current password if user is trying to change password.\n return super if params['password']&.present?\n\n # Allows user to update registration information without password.\n resource.update_without_password(params.except('current_password'))\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password) \n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n super\n end", "def update_with_password(params={})\n\t\tcurrent_password = params.delete(:current_password) if !params[:current_password].blank?\n\t\t\n\t\tif params[:password].blank?\n\t\t\tparams.delete(:password)\n\t\t\tparams.delete(:password_confirmation) if params[:password_confirmation].blank?\n\t\tend\n\t\t\n\t\tresult = if has_no_password? || valid_password?(current_password)\n\t\t\tr = update_attributes(params)\n\t\t\tupdate_attribute(:has_password, true) if params[:password].present?\n\t\t\tr\n\t\telse\n\t\t\tself.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n\t\t\tself.attributes = params\n\t\t\tfalse\n\t\tend\n\t\t\n\t\tclean_up_passwords\n\t\tresult\n\tend", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n check_password = true\n if params[:password].blank?\n params.delete(:password)\n if params[:password_confirmation].blank?\n params.delete(:password_confirmation)\n check_password = false\n end \n end\n result = if valid_password?(current_password) || !check_password\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n # if params[:password].blank?\n # params.delete(:password)\n # params.delete(:password_confirmation) if params[:password_confirmation].blank?\n # end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if valid_password?(current_password)\n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def update\n if params[:user][:password].present? || params[:user][:current_password].present?\n super\n else\n @user = User.find(current_user.id)\n if @user.update_without_password(params[:user])\n redirect_to after_update_path_for(@user), :notice => I18n.t(\"devise.registrations.updated\")\n else\n render \"edit\"\n end\n end\n end", "def update\n @user = User.find(current_user.id)\n\n successfully_updated = if needs_password?(@user, params)\n @user.update_with_password(params.require(:user).permit(:city, :email, :image, :mobile, :name, :current_password, :password, :password_confirmation))\n # Rails 3: @user.update_with_password(params[:user])\n else\n # remove the virtual current_password attribute update_without_password\n # doesn't know how to ignore it\n params[:user].delete(:current_password)\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n @user.update_without_password(params.require(:user).permit(:city, :email, :image, :mobile, :name))\n # Rails 3: @user.update_without_password(params[:user])\n end\n\n if successfully_updated\n set_flash_message :notice, :updated\n # Sign in the user bypassing validation in case his password changed\n sign_in @user, :bypass => true\n redirect_to after_update_path_for(@user)\n else\n render \"edit\"\n end\n end", "def update_resource(resource, params)\n # if params['email'] != current_user.email || params['password'].present?\n # resource.update_with_password(params)\n # else\n resource.update_without_password(params.except('password', 'password_confirmation', 'current_password'))\n # end\n end", "def update_with_password(params = {})\n if has_facebook_profile?\n params.delete(:current_password)\n update_without_password(params)\n else\n super\n end\n end", "def change_password!(password_attributes)\n unless skip_current_password\n self.current_password = password_attributes[:current_password]\n authenticated = validate_current_password\n else\n authenticated = true\n end\n self.skip_current_password = true\n assign_attributes(password_attributes)\n validated = authenticated && valid?\n self.skip_current_password = nil\n if validated\n update_attribute(:password, password_attributes[:password])\n else\n false\n end\n end", "def update\n if params[:user][:password].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n end", "def skip_password!\n # Securely remove all password fields, otherwise user cannot confirm.\n self.password = nil\n self.password_confirmation = nil\n self.encrypted_password = ''\n self.skip_password = true\n end", "def update\n @membership.assign_attributes(membership_params)\n @membership.user.no_password = true\n \n respond_to do |format|\n if @membership.save\n format.html { redirect_to @membership, notice: 'Membership was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:adminuser][:password].blank? && params[:user][:password_confirmation].blank?\n params[:adminuser].delete('password')\n params[:adminuser].delete('password_confirmation')\n end\n super\n end", "def update_attributes_and_password(attrs)\n self.assign_attributes(attrs)\n self.valid?\n if self.password.present? && confirm_passwords\n self.password_hash = Digest::SHA256.hexdigest(self.password + Rails.application.secrets.salt)\n end\n if self.errors.empty?\n self.save\n end\n end", "def update_password_changed\n if defined?(will_save_change_to_attribute?)\n return unless (new_record? || will_save_change_to_encrypted_password?) && !will_save_change_to_password_changed_at?\n else\n return unless (new_record? || encrypted_password_changed?) && !password_changed_at_changed?\n end\n\n self.password_changed_at = Time.zone.now\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_with_password(params, *options); end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_password\n if current_user.update_with_password(update_password_params)\n expose current_user\n else\n error! :invalid_resource, current_user.errors\n end\n end", "def update\n\n # this action is triggered when the user sends data to edit their data\n # you can add your custom code here\n\n new_params = params.require(:user).permit(:email, :username, :current_password, :password, :password_confirmation)\n\n change_password = true\n\n if params[:user][:password].blank?\n params[:user].delete(\"password\")\n params[:user].delete(\"password_confirmation\")\n new_params = params.require(:user).permit(:email, :username)\n change_password = false\n end\n\n @user = User.find(current_user.id)\n\n is_valid = false\n\n if change_password\n is_valid = @user.update_with_password(new_params)\n else\n @user.update_without_password(new_params)\n end\n\n if is_valid\n set_flash_message :notice, :updated\n sign_in @user, :bypass => true\n redirect_to after_update_path_for(@user)\n else\n render \"edit\"\n end\n\n end", "def update\n if correct_password_check account_update_params[:current_password]\n \n pw_params = params[:user].permit(:current_password, :password, :password_confirmation, :first_name, :last_name)\n # Handle updating password if they added anything.\n if (current_user.valid_password?(pw_params[:password]) || current_user.valid_password?(pw_params[:password_confirmation]))\n # Passwords are the same, do nothing.\n elsif (pw_params[:password] == pw_params[:password_confirmation] && pw_params[:password].length > 6)\n # Password are different.\n current_user.password = pw_params[:password]\n current_user.password_confirmation = pw_params[:password_confirmation]\n current_user.save!\n flash.alert = \"Success: Password has been changed!\"\n end\n\n \n user_params = params[:user].except(:current_password, :password, :password_confirmation).permit(:first_name, :last_name, :email)\n unless current_user.update!( user_params )\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n\n flash.alert = \"Success: Account has been updated!\"\n redirect_to edit_user_registration_path\n end\n end", "def update\n if @user.update_without_password(update_params)\n render_update_success @user\n else\n render_failure @user\n end\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes p\n end", "def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end", "def update_resource(resource, params)\n logger.info \"-----------------\\nAccount params: #{params.inspect}\"\n if params[:password].blank?\n resource.update_without_password(User.sanitize_attributes(params))\n\n else\n logger.info \"Updating with password: #{User.sanitize_attributes(params).inspect} \"\n\n # Instead of calling resource.update_with_password, password is not required\n\n\n # Tweak to bypass the required :current_password and :encrypted_password by Devise, so password can be updated too.\n resource.password = params[:password]\n\n result = if resource.valid_password?(params[:password])\n\n resource.update_attributes(params)\n\n else\n resource..assign_attributes(params)\n resource.valid?\n resource.errors.add(:password, params[:password].blank? ? :blank : :invalid)\n false\n end\n\n resource.clean_up_passwords\n result\n end\n end", "def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end", "def update\n if user_params[:password].blank?\n user_params.delete(:password)\n user_params.delete(:password_confirmation)\n end\n\n if needs_password?(current_user, user_params)\n save = current_user.update(user_params)\n else\n save = current_user.update_without_password(user_params)\n end\n\n respond_to do |format|\n if save\n format.html { redirect_to current_user.url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_resource(object, attributes)\n update_method = attributes.first[:password].present? ? :update_attributes : :update_without_password\n object.send(update_method, *attributes)\n end", "def update\n @user = User.find(current_user)\n validation = (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n params[:user].delete(\"password\") unless (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n sign_in @user, :bypass => true\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_password password, password_confirmation, old_password\n if crypted_password.blank?\n self.password, self.password_confirmation = password, password_confirmation\n elsif authenticated_by_password? old_password\n self.password, self.password_confirmation = password, password_confirmation\n true\n else\n errors.add :base, t(:invalid_old_password)\n false\n end\n end", "def encrypt_password\n if self.id.nil? || self.password_changed?\n self.password = BCrypt::Password.create(self.password)\n end\n end", "def update\n account_update_params = devise_parameter_sanitizer.sanitize(:account_update)\n\n # This is required for the form to submit when the password is left blank.\n if account_update_params[:password].blank?\n account_update_params.delete('password')\n account_update_params.delete('password_confirmation')\n end\n\n @user = User.find(current_user.id)\n if @user.update_attributes(account_update_params)\n set_flash_message ':notice', :updated\n\n # Sign in the user and bypass validation in case the password changed.\n sign_in @user, bypass: true\n redirect_to after_update_path_for(@user)\n else\n render 'edit'\n end\n end", "def update\n modified_params = user_params\n modified_params.delete(\"password\") if modified_params[\"password\"].empty?\n if @user.update(modified_params)\n @users = current_user.users\n end\n end", "def attempt_set_password(params)\n\t p = {}\n\t p[:password] = params[:password]\n\t p[:password_confirmation] = params[:password_confirmation]\n\t update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n update_attributes(p)\n end" ]
[ "0.8186869", "0.81292194", "0.8116273", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.8109017", "0.80718195", "0.79840213", "0.7856472", "0.7836653", "0.7835721", "0.7835721", "0.7832385", "0.7832385", "0.7758672", "0.7758672", "0.7758672", "0.77547574", "0.77511466", "0.77511466", "0.7742195", "0.774021", "0.7695682", "0.76861477", "0.7684337", "0.7665735", "0.7643414", "0.75945395", "0.75945395", "0.7421542", "0.7354865", "0.73478484", "0.7317351", "0.7191935", "0.71665174", "0.71467793", "0.71019155", "0.7101695", "0.7089224", "0.7069883", "0.7069049", "0.7068195", "0.7067331", "0.70523936", "0.70426285", "0.6984469", "0.69422895", "0.69317186", "0.692149", "0.6847748", "0.6807741", "0.67028993", "0.6670115", "0.6576294", "0.654559", "0.65412813", "0.6525004", "0.65243363", "0.65241915", "0.65241915", "0.65241915", "0.65241915", "0.65241915", "0.65241915", "0.65241915", "0.65241915", "0.64901036", "0.64899063", "0.6481865", "0.64525104", "0.64057904", "0.6405281", "0.6400002", "0.63699025", "0.63598514", "0.6356819", "0.63423", "0.63396215", "0.6336896", "0.633546", "0.6321574", "0.6317241", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918", "0.6316918" ]
0.7305098
40
Verifies whether a password (ie from sign in) is the user password.
def valid_password?(password); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_password?(password)\n true\n end", "def has_password?(submitted_password)\n password == encrypt(submitted_password)\n end", "def valid_password?\n password.present?\n end", "def valid_password?\n password.present?\n end", "def valid_password? password\r\n self.password === Digest::MD5.hexdigest(password)[0..19]\r\n end", "def passwords_match?\n context.user.password == context.password\n end", "def password_is?(pw)\n Digest::MD5.hexdigest(pw + password_salt) == password_hash\n end", "def is_password?(password)\n obj = Password.new(self.password_digest)\n obj.is_password?(password)\n end", "def has_password? (submitted_password)\n password_digest == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\r\n encrypted_password == encrypt(submitted_password)\r\n end", "def has_password?(password)\n encrypted_password == encrypt(password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def verify_password(password)\n hash_password(password) == @password_hash\n end", "def validate_password?\n password.present?\n end", "def password\n password = @prompt.mask(\"Enter password: \", required: true)\n if password == @current_user.password\n true\n else\n puts \"Password is invalid.\"\n sleep(1)\n false\n end\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted password with the encrypted version of\n # Submitted password\n encrypted_password == encrypt(submitted_password)\n end", "def has_password? pass\n WodaHash.digest(self.pass_salt + pass).to_hex.downcase == pass_hash.downcase\n end", "def has_password?(submitted_password)\n #compare encrypted_password with the encrypted version of submitted password.\n password == submitted_password\n end", "def has_password?(submitted_password)\n self.password == encrypt(submitted_password)\n end", "def has_password?(pwd)\n password_hash == HasPassword.encrypt(pwd, password_salt)\n end", "def has_password?( submitted_password )\n encrypted_password == encrypt( submitted_password )\n end", "def valid_password?(password)\n V1::Auth::Encryptor.compare(encrypted_password, password)\n end", "def has_password?(password_soumis)\n\t\t# Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end", "def valid_password?(incoming_password)\n password_digest(incoming_password) == self.encrypted_password\n end", "def has_password?(submitted_password)\n valid_password?(submitted_password)\n end", "def valid_password?(plain)\n password == hash_crypt(plain.to_s) \n end", "def has_password?(password_soumis)\n # Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end", "def password_ok?\n return unless password and confirm_password\n errors.add(:password, \"Passwords don't match\") if password != confirm_password\n end", "def matching_password?(pass)\n self.password_hash == encrypt_password(pass)\n end", "def has_password?(submitted_password)\n # compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n\tpassword == encrypt(submitted_password) \n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n #Compare encrypted_password with the encrypted version of \n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def password_is?(password)\n ENCRYPT.hexdigest(password + self.salt) == self.encrypted_password\n end", "def password_match?(entered_password = '')\n password == User.hash_with_salt(entered_password, salt)\n end", "def is_valid_password?(password)\n\t\tself.password == BCrypt::Engine.hash_secret(password, self.password)\n\tend", "def is_password?(password)\n BCrypt::Password.new(self.password_digest) == password\n end", "def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end", "def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end", "def validate_password?(plain_password)\n unless salt.nil?\n encrypt(plain_password, salt) == self.password\n else\n false\n end\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n\t encrypted_password == encrypt(submitted_password)\n end", "def valid_for_authentication?(attributes)\n valid_password?(attributes[:password])\n end", "def has_password?(submitted_password)\n\t\t# Compare encrypted password with the encrypted version of the submitted password\n\t\tencrypted_password == encrypt(submitted_password)\n\tend", "def match_password(login_password=\"\")\n password == BCrypt::Engine.hash_secret(login_password, salt)\n end", "def password?\n !crypt_pass.nil? && !salt.nil?\n end", "def has_password?(submitted_password)\n\t # Compare encrypted_password with the encrypted version of\n\t # submitted_password.\n\t encrypted_password == encrypt(submitted_password)\n\tend", "def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end", "def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end", "def password_confirmed?\n params[:password] != params[:user][:password]\n end", "def check_password(pass)\n hash = calc_hash(pass)\n\n return false if hash.nil?\n crypt_pass == hash\n end", "def valid_pass?(test_pass)\n Encrypt::Password.validatePassword test_pass, password\n end", "def has_password?(submitted_password)\n # Return true if the user's password matches the submitted password.\n # Compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password) \n end", "def password_match?\n add_password_match_error if password != password_confirmation\n\n password == password_confirmation && !password.blank?\n end", "def check_pw pw\n (encrypt pw) == (self[:password])\n end", "def is_password?(password)\n BCrypt::Password.new(password_digest).is_password?(password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n\tencrypted_password == encrypt(submitted_password)\nend", "def has_password?(password)\n user_password = self.password_digest\n encrpyted_password = BCrypt::Password.new(user_password)\n encrpyted_password.is_password?(password)\n end", "def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def correct_password?(params)\n current_password=params[:user][:current_password]\n password == current_password\n end", "def has_password?(submitted_password)\n self.encrypted_password == encrypt(submitted_password)\n end", "def has_password?(a_password)\n self.encrypted_password == encrypt(a_password)\n end", "def password_valid?\n\t\tif self.password == nil\n\t\t\treturn false\n\t\telsif self.password.length < MIN_PW_LENGTH || self.password.length > MAX_CREDENTIAL_LENGTH\n\t\t\treturn false\n\t\tend\n\t\ttrue\n\tend", "def matches_password(login_password)\n passhash == BCrypt::Engine.hash_secret(login_password, salt)\n end", "def valid_password?(password)\n Authentication::Encryptor.compare(self.encrypted_password, password)\n end", "def correct_password?(params)\n current_password = params[:pd_user][:current_password]\n return (password == current_password)\n end", "def password_match?( password=\"\")\n hashedPassword == Admin.hash_with_salt(password, salt)\n end", "def password_match?\n self.password == self.password_confirmation\n end", "def valid_password?(password)\n begin\n super(password)\n rescue BCrypt::Errors::InvalidHash\n type, salt, enc_pass = encrypted_password.split('$')\n Digest::SHA1.hexdigest(\"#{salt}#{password}\") == enc_pass\n end\n end", "def password? (plain_text_password)\n # don't allow logging in with blank passwords\n return false if plain_text_password.blank?\n return false if self.password_hash.blank?\n\n salt = self.password_salt\n pass = self.password_hash\n Rauth::Encode.mkpasswd(plain_text_password, salt) == pass\n end", "def is_password_password(pass)\n if pass.downcase == 'password'\n 'Sorry, password cannot be password.'\n else\n 'Yay, password is not password.'\n end\nend", "def has_password?(submitted_password)\n # compare encrypted_password with the encrypted version of\n # the submitted password.\n\tencrypted_password == encrypt(submitted_password)\n end", "def is_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def is_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end" ]
[ "0.81442815", "0.8062766", "0.7948929", "0.7948929", "0.794048", "0.7917117", "0.7900027", "0.7878529", "0.78755397", "0.78629637", "0.7858927", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.7855734", "0.785257", "0.7851293", "0.7850805", "0.784744", "0.784744", "0.7830114", "0.7830114", "0.7813185", "0.78090906", "0.7805494", "0.780216", "0.77716595", "0.7770746", "0.77581525", "0.7755424", "0.7741813", "0.7734989", "0.77314675", "0.7714784", "0.7702489", "0.76977336", "0.7697186", "0.7696296", "0.76836", "0.7679324", "0.7679324", "0.7679324", "0.7679324", "0.7679324", "0.7679324", "0.7679324", "0.76702416", "0.7667079", "0.7650191", "0.7642465", "0.7641335", "0.76380014", "0.76380014", "0.76349914", "0.76349914", "0.76347834", "0.7622982", "0.76188016", "0.76105183", "0.76018244", "0.7599208", "0.7588716", "0.75883347", "0.75883347", "0.7587542", "0.75872433", "0.75747925", "0.7556337", "0.75539285", "0.75476795", "0.7546048", "0.7540428", "0.75341815", "0.7531479", "0.75308836", "0.75308836", "0.75303906", "0.75286347", "0.7528078", "0.7527988", "0.7527792", "0.7525653", "0.7524273", "0.7519407", "0.75177205", "0.7516701", "0.7514086", "0.75014347", "0.74976665", "0.7491979", "0.7491979" ]
0.8100838
1
Hashes the password using bcrypt. Custom hash functions should override this method to apply their own algorithm. See for examples of other hashing engines. source://devise//lib/devise/models/database_authenticatable.rb197
def password_digest(password); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.hashed_password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def hash_password\n self.hashed_password = BCrypt::Password.create(self.hashed_password)\n end", "def hash_password\n \t\tself.salt = BCrypt::Engine.generate_salt\n \t\tself.password_digest = BCrypt::Engine.hash_secret(self.password, self.salt)\n \t\tself.password = nil\n \tend", "def hash_password(password)\r\n\t\tUser.hash_password(password, self.hash_algorithm)\r\n\tend", "def hash_password # We'll call this method in the seed file; from https://gist.github.com/mdang/7b6097cc13b07db82c78\n if password.present?\n self.password_digest = BCrypt::Password.create(password)\n end\n end", "def hash_password\n self.password_salt = SecureRandom.base64(8) if self.password_salt == nil\n self.hashed_password = Digest::SHA1.hexdigest(self.password_salt + self.password)\n end", "def use_bcrypt_for_hashing\n # If available, use BCrypt as the hashing function for applications\n self.secret_hash_function = lambda do |plain_token|\n ::BCrypt::Password.create(plain_token.to_s)\n end\n\n # Also need to override the comparer function for BCrypt\n self.secret_comparer = lambda do |plain, secret|\n begin\n ::BCrypt::Password.new(secret.to_s) == plain.to_s\n rescue BCrypt::Errors::InvalidHash\n false\n end\n end\n end", "def hash_password\n\t\t# Is there a password set in the model? If not then do nothing\n\t\tif password.present?\n\t\t\treturn self.password_digest = BCrypt::Password.create(password)\n\t\tend\n\tend", "def hash_password!\n\t\t@password = BCrypt::Password.create(@password) \t\n\tend", "def password_digest(password)\n Devise.bcrypt(self.class, password)\n end", "def hash_password\n self.password = Digest::MD5.hexdigest(self.password)\n end", "def encrypt_password\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end", "def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end", "def authentication_password\n BCrypt::Password.new(hashed_password)\n end", "def hash_password\n return if password.blank?\n self.password_hash = Password.create(password)\n end", "def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end", "def hash_pass()\n self.pass=(BCrypt::Password.create(pass).to_s)\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n\n if password.present?\n\n self.password_salt = BCrypt::Engine.generate_salt\n\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n\n end \n\n end", "def hash_new_password\n self.encrypted_password = BCrypt::Password.create(@new_password)\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password) # hangs on to the plain text password and compares it against the entered plain text password for authentication\n end", "def encrypt_password\n if password.present?\n #create salt password\n self.salt_password = BCrypt::Engine.generate_salt\n #create hash password\n self.password = BCrypt::Engine.hash_secret(password,salt_password)\n end\n end", "def password_digest\n BCrypt::Password.new(super)\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def authenticate(guesspassword)\n\t# self.hash_password ==\n\tself.hashed_password ==\n\t # BCrypt::Engine.hash_secret(password, self.salt)\n\t BCrypt::Engine.hash_secret(guesspassword, self.salt)\nend", "def hash_password(password)\n digest = OpenSSL::Digest::SHA256.new\n OpenSSL::PKCS5.pbkdf2_hmac(password, @verify_salt, 300_000, digest.digest_length, digest)\n end", "def create_hashed_password\n self.password = password.crypt(\"ChaveDoProvas\")\n end", "def encrypt_password\n if self.password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def password_encrypt\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def hash_user_password\n self.password = sha1_digest(self.user_password, self.salt)\n self.user_password = nil\n end", "def create_hash(password)\n BCrypt::Password.create(password)\n end", "def create_hash_password(password)\n BCrypt::Password.create(password)\n end", "def hashed_password\n @hashed_password ||= Digest::SHA1.hexdigest(password).upcase\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password)\n end", "def create_hash(password)\n BCrypt::Password.create(password)\n end", "def create_hash_digest(password)\n BCrypt::Password.create(password)\nend", "def crypt_password\r\n write_attribute \"password\", self.class.sha1(password)\r\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end", "def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a490c441958$67f59aa61bc617849a3280b5e80f78607e53b5aa5807a44ddbc53e804e2e2a99'\n end", "def encrypt_password\n unless password.blank?\n self.salt = BCrypt::Engine.generate_salt\n self.fish = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def encrypt_password\n # It should be, because we're validating it's presence!\n if password.present?\n # Generate a salt we'll use to hash the password\n self.password_salt = BCrypt::Engine.generate_salt\n # Actually hash the password\n self.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def password_hash(pass)\n self.class.password_hash(pass)\n end", "def encrypt_password\n\t\tif password.present?\n\t\t\tself.password_salt = BCrypt::Engine.generate_salt\n\t\t\tself.password_hash = BCrypt::Engine.hash_secret(password, password_salt)\n\t\tend\n\tend", "def encrypt_password()\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.encrypted_password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end", "def authenticate password\n hash = BCrypt::Engine.hash_secret password, password_salt\n hash == password_hash\n end", "def crypt_password\n\t\twrite_attribute \"password\", self.class.sha1(password)\n\tend", "def hashed_password(username, password)\n @hashers.fetch(username).call(password)\n end", "def create_hashed_password\n\t\t#if :password has a value\n\t\t#\t-indicates we want to update the passowrd\n\t\t#\t-before_save: encrypt value with salt\n\t\t#\t-Save hash in :hashed_password\n\t\t# \t-after_save: clear :password\n\t\t\n\t\t#if :password does not have a value\n\t\t#\t-No encryption, no :hashed_password change\n\t\t#\t-Allow the record to save normally\n\t\t#Validate presence of :password for all new users\n\t\n unless password.blank?\n\t self.salt = AdminUser.make_salt(username) if salt.blank? #for new record only. It's ok to add self.salt.blank, but not necesary\n\t #Note: when we are doing assingment, self.salt is needed on the left side of the equal sign\n\t self.hashed_password = AdminUser.hash_with_salt(password, salt)\n\tend\n end", "def update_hash!(password)\n self.password = password\n hash_password\n save\n end", "def encrypt_passhash\n if passhash_changed?\n self.salt = BCrypt::Engine.generate_salt\n self.passhash = BCrypt::Engine.hash_secret(passhash, salt)\n end\n end", "def encrypt_password\r\n \r\n # If the user is new, create a salt\r\n self.make_salt if new_record?\r\n \r\n # Hash the salt and password to create the encrypted pass\r\n self.encrypted_password = sha_hash(\"#{self.password}--#{self.salt}\")\r\n \r\n end", "def encrypt_password\n if password.present?\n self.password_salt = BCrypt::Engine.generate_salt\n self.encrypted_password = BCrypt::Engine.hash_secret(password, password_salt)\n end\n end", "def build_meteor_password_hash(encrypted_password)\n {bcrypt: encrypted_password}\n end", "def password_digest(password)\n ::BCrypt::Password.create(password).to_s\n end", "def create_new_hash(password)\n BCrypt::Password.create(password)\n end", "def encrypt_password\n if self.password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.encrypted_password = BCrypt::Engine.hash_secret(self.password, salt)\n end\n end", "def password\n BCrypt::Password.new(self.password_digest)\n end", "def encrypt_password\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.encrypted_password= BCrypt::Engine.hash_secret(password, salt)\n end\n end", "def crypt_password\n \t\twrite_attribute \"password\", self.class.sha1(password) unless self.password.empty?\n end", "def pwdhash(salt=nil)\n salt = String.random_password.md5 if salt.nil?\n salt = salt[0..8]\n salt+(salt+self).sha1\n end", "def encrypt_password\n if new_record?\n self.salt = make_salt\n self.password_digest = encrypt(password_digest)\n end\n end", "def encrypt_password(pass)\n BCrypt::Engine.hash_secret(pass, password_salt)\n end", "def password=(new_password)\n self.password_hash = BCrypt::Password.create(new_password, :cost=>BCRYPT_COST)\n end", "def hash(password, salt)\n Digest::SHA512.hexdigest(\"#{ password }:#{ salt }\")\n end", "def encrypt_password(password)\n self.class.secure_digest([password, password_salt])\n end", "def crypt_password\n write_attribute \"password\", self.class.sha1(self.class.generate_salt, password)\n @password = nil\n end", "def password=(new_password)\n @password = BCrypt::Password.create(new_password, :cost => 8)\n self.hashed_password = @password\n end", "def create_hashed_password\n #only hash passwords if the password variable has been set\n unless password.blank?\n self.salt = Admin.make_salt(username) if salt.blank?\n self.hashedPassword = Admin.hash_with_salt(password , salt)\n end\n end", "def crypt_password\n self.crypted_pass = BCrypt::Password.create(password) if password\n end", "def password= password\n @password = password\n\n self.password_digest = BCrypt::Password.create password\n end", "def password(&blk)\n @authentication_methods ||= {}\n @authentication_methods[:password] = blk\n self\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(new_password)\n @password = BCrypt::Password.create(new_password)\n self.password_hash = @password\n end", "def digest\n cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :\n BCrypt::Engine.cost\n BCrypt::Password.create(self, cost: cost)\n end", "def authenticate(password)\n\t\tself.hashed_password ==\n\t\tBCrypt::Engine.hash_secret(password, self.salt)\n\tend", "def hash_user_password(user)\n # Only hash password if it is present\n # Don't error out here so that internal methods can catch all missing\n # fields later on and return a more meaningful error if necessary.\n if user.key?('password')\n password = user['password']\n\n # Hash the password\n hashed = BCrypt::Password.create('password')\n\n user['password'] = hashed\n end\n end", "def password_hash=(password_hash)\n super(BCrypt::Password.new(password_hash))\n end", "def hashed_password\n @hashed_password ||= Digest::MD5.hexdigest(\"#{name}:mongo:#{password}\")\n end", "def password=(password) \n self.salt = User.random_string( 10 ) if self.salt.nil?\n self.hashed_password = User.encrypt( password, self.salt )\n end", "def authenticate(password)\n hashed_password == BCrypt::Engine.hash_secret(password, salt)\n end", "def salt_password(clear_password)\n self.salt = User.generate_salt\n self.hashed_password = User.hash_password(\"#{salt}#{User.hash_password clear_password}\")\n end", "def password\n @password ||= BCrypt::Password.new(@password_hash)\n end", "def password\n @password ||= BCrypt::Password.new(h_password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end" ]
[ "0.8321346", "0.8068567", "0.8016407", "0.79346716", "0.7817453", "0.7783837", "0.7733464", "0.7728031", "0.75724995", "0.7544391", "0.75433385", "0.7525877", "0.74928594", "0.7459026", "0.738536", "0.7382229", "0.737949", "0.7376114", "0.7376114", "0.7376114", "0.7376114", "0.7376114", "0.73729974", "0.73609823", "0.73604816", "0.7337788", "0.73127264", "0.7310118", "0.7308137", "0.7294905", "0.72636896", "0.72617", "0.72539794", "0.72508657", "0.72251636", "0.7219941", "0.7211302", "0.72015995", "0.7193986", "0.719212", "0.7169247", "0.7163412", "0.71590745", "0.71590745", "0.7150533", "0.71286976", "0.71262413", "0.71223855", "0.70889235", "0.70599943", "0.70568156", "0.7055637", "0.70483476", "0.7044078", "0.70431256", "0.70311177", "0.70098406", "0.6993857", "0.69910747", "0.6991058", "0.69909513", "0.69740105", "0.6932537", "0.6921369", "0.6911665", "0.69003135", "0.68883634", "0.6869772", "0.6868257", "0.6867284", "0.6867069", "0.686501", "0.6858839", "0.68540955", "0.6851798", "0.6850034", "0.68295187", "0.6828625", "0.6828625", "0.6828625", "0.6828625", "0.6828625", "0.6825766", "0.6825766", "0.6825404", "0.6823734", "0.6814989", "0.68092966", "0.6802973", "0.6799017", "0.6795355", "0.6794922", "0.6785272", "0.67810094", "0.6778022", "0.67748517", "0.67748517", "0.67748517", "0.67748517", "0.67748517" ]
0.6875799
67
Verifies whether a user is locked or not.
def access_locked?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_lock?(current_user)\n return false if current_user.anonymous?\n\n not is_locked?\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def locked?(user)\n false unless user.present?\n answer_session = self.answer_sessions.where( user_id: user.id ).order( updated_at: :desc ).first\n answer_session.present? and answer_session.locked?\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def locked?\n !!@owner\n end", "def is_locked?\n locked\n end", "def is_locked_by_other?(current_user)\n is_locked? and user_locked != current_user.id\n end", "def locked?\n locked_by.present? && locked_at.present? && locked_at > 10.minutes.ago\n end", "def can_unlock?(current_user)\n return false if current_user.anonymous?\n\n is_locked? and not is_locked_by_other?(current_user)\n end", "def isLocked\n room = Room.find_by_id params[:id]\n\n if room.nil?\n respond_with locked: true\n else\n if room.lock_owner_user_id.nil? || room.room_lock_start.nil? || room.lock_owner_user_id == session[:uid]\n respond_with locked: false\n else\n respond_with locked: true\n end\n end\n end", "def unlocked?(user)\n\t\treturn user.totalStars >= @starsRequired\n\tend", "def locked?\n @locked\n end", "def unlocked?\n not locked?\n end", "def locked?\n approved? or rejected?\n end", "def test_should_lock_expired_users\n User.lock_expired_users\n assert_equal false, users(:user4).active_for_authentication?\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n self.is_locked\n end", "def unlocked?\n !locked?\n end", "def locked?\n @locked\n end", "def locked?\n not @lock_name.nil?\n end", "def locked?\n locksmith.locked?\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def valid_for_authentication?\n return super unless persisted? && lock_strategy_enabled?(:failed_attempts)\n\n # Unlock the user if the lock is expired, no matter\n # if the user can login or not (wrong password, etc)\n unlock_access! if lock_expired?\n\n if super && !access_locked?\n true\n else\n increment_failed_attempts\n if attempts_exceeded?\n lock_access! unless access_locked?\n else\n save(validate: false)\n end\n false\n end\n end", "def locked?\n !status_flag?(:kSecUnlockStateStatus)\n end", "def locked?\n end", "def locked?\n\t\t\t@locked\n\t\tend", "def locked?\n !locked_at.nil?\n end", "def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end", "def isAuth\n # Redirect the browser to the homepage, unless the user is logged in\n redirect_to root_path unless signed_in?\n # Execute the 'locked' method unless the user does not have a lock associated with their account\n locked unless current_user.lock == nil\n end", "def access_locked?\n !!locked_at && !lock_expired?\n end", "def locked_to_user?(headers = nil)\n if locked?\n !can_unlock? headers\n else\n locking_ancestor? @ancestor_path, @ancestors.dup, headers\n end\n end", "def unlocked?\n @unlocked\n end", "def locked?\n\t\t\t!lockoutTime.nil? && lockoutTime.to_i != 0\n\t\tend", "def locked?\n fetch_lock_info\n\n obj_exists_and_is_not_type? obj: @lock_info, type: []\n end", "def user_is_not_blocked\n return errors.add(:user, 'You cannot block yourself')\\\n if user_id == blocked_id\n end", "def locked?\n return @locked\n end", "def unlocked?\n ! File.exist?(lock_file)\n end", "def can_lock?\n SpaceRequestPolicy.can_lock?(current_user, object)\n end", "def is_locked\n return @is_locked\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def locked?\n @mutex.locked?\n end", "def is_locked=(value)\n @is_locked = value\n end", "def can_lock?(user, space)\n user.review_space_admin? && space.shared? && space.active?\n end", "def active_for_authentication?\n super and self.locked != 1\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def locked?\n if defined?(@locked)\n @locked\n else\n false\n end\n end", "def lock?\n record.unlocked? && (director?(record.event) || competition_admin? || super_admin?)\n end", "def check_auth\n @slot.user == (current_user ) or raise AccessDenied\n end", "def locked?\n (status & (1 << 0)).zero?\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def can_unlock?(user, space)\n user.review_space_admin? && space.shared? && space.locked?\n end", "def is_waiting_user?\n if users_unit.group.waiting_users.include? user\n errors.add(:user_id, \"User is already a member\")\n end\n end", "def check_correct_user(user)\n \tcurrent_user?(user)\n end", "def user_is_old? user\n return user.logins_number > 1\n end", "def lock_status?\n return @unlocked == true\n end", "def lockout?\n @lockout\n end", "def can_unblock?(user)\n blocked? && self.blocker == user\n end", "def test_locked_user\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n\n assert_raises(EntryCrypto::LockedError) { new_entry.lock_password(new_user, \"password1234\") }\n end", "def locked?\n !!locked_by && !!locked_at && (locked_at + Delayed::Worker.max_run_time) >= Delayed::Job.db_time_now\n end", "def check_lock_time(lock_time)\n false\n end", "def locked?\n File.exist?(lock_file)\n end", "def lockable?\n @lockable\n end", "def locked?\n revision.locked == 1\n end", "def toggle_locking(current_user)\n if can_toggle_locking?(current_user)\n is_locked? ? unlock : lock(current_user.id) # TODO: raise exception or report error here?\n end\n end", "def user_check(resource)\n return true unless self[:name] == \"user\"\n return true unless self[:unless_system_user]\n\n resource[:audit] = :uid\n\n return false if system_users.include?(resource[:name])\n\n current_values = resource.retrieve_resource\n current_values[resource.property(:uid)] > self[:unless_system_user]\n end", "def locked?\n File.exist?(lock_file)\n end", "def fails?(user)\n false\n end", "def locked?\n submitted?\n end", "def check_if_blocked\n\t\trecord = BlockedUser.find_by(user_id: current_user.id, blocked_id: params[:user_id])\n\t\tredirect_to rooms_path, alert: \"User is blocked!\" if record\n\tend", "def can_unlock?\n SpaceRequestPolicy.can_unlock?(current_user, object)\n end", "def password_require_to_unlock_from_idle\n return @password_require_to_unlock_from_idle\n end", "def account_locked\n @user = User.find(params[:id])\n end", "def locked_out?\n # don't need a mutex because we know #owned? can't change during the call \n locked? && !owned?\n end", "def checkUserLogin(userName, userPass)\n userPass = userPass.encrypt\n user = loadUser(userName)\n if(user == nil)\n return false\n end\n userPassLoaded = user[\"password\"]\n #puts \"----------------------\\nPass1: [#{userPass}]\\nPass2: [#{userPassLoaded}]\\n-----------------------------------\"\n\n blocked = user[\"BLOCKED\"]\n if userPassLoaded == userPass && (blocked == nil || !blocked)\n return true\n else\n return false\n end\n end", "def blocked?(user)\n blocked.include?(user)\n end", "def have_lock?\n !!@handle\n end", "def locked?\n\t\t\t\t\treturn payment_in_progress? || paid?\n\t\t\t\tend", "def has_lock?\n @has_lock || false\n end", "def userBlocked(userName)\n\n user = loadUser(userName)\n blocked = user[\"BLOCKED\"]\n if(blocked != nil && blocked)\n return true\n else\n return false\n end\n end", "def valid_user?\n client.valid_user?(user_repo, @options)\n end", "def user_check(id)\n check_user = User.find(id)\n if check_user != current_user\n flash[:notice] = \"You can only modify your own user information.\"\n redirect_to user_path(user)\n end\n end", "def lock_check(lock_scope=nil)\n return unless @lock_class\n if(@lock_class.explicitly_locked?(@path))\n raise Locked if @lock_class.explicit_locks(@path).find_all{|l|l.scope == 'exclusive' && l.user != @user}.size > 0\n elsif(@lock_class.implicitly_locked?(@path))\n if(lock_scope.to_s == 'exclusive')\n locks = @lock_class.implicit_locks(@path)\n failure = DAV4Rack::LockFailure.new(\"Failed to lock: #{@path}\")\n locks.each do |lock|\n failure.add_failure(@path, Locked)\n end\n raise failure\n else\n locks = @lock_class.implict_locks(@path).find_all{|l| l.scope == 'exclusive' && l.user != @user}\n if(locks.size > 0)\n failure = LockFailure.new(\"Failed to lock: #{@path}\")\n locks.each do |lock|\n failure.add_failure(@path, Locked)\n end\n raise failure\n end\n end\n end\n end", "def lock_check(lock_scope=nil)\n return unless @lock_class\n if(@lock_class.explicitly_locked?(@path))\n raise Locked if @lock_class.explicit_locks(@path).find_all{|l|l.scope == 'exclusive' && l.user != @user}.size > 0\n elsif(@lock_class.implicitly_locked?(@path))\n if(lock_scope.to_s == 'exclusive')\n locks = @lock_class.implicit_locks(@path)\n failure = DAV4Rack::LockFailure.new(\"Failed to lock: #{@path}\")\n locks.each do |lock|\n failure.add_failure(@path, Locked)\n end\n raise failure\n else\n locks = @lock_class.implict_locks(@path).find_all{|l| l.scope == 'exclusive' && l.user != @user}\n if(locks.size > 0)\n failure = LockFailure.new(\"Failed to lock: #{@path}\")\n locks.each do |lock|\n failure.add_failure(@path, Locked)\n end\n raise failure\n end\n end\n end\n end", "def lock_expired?\n if unlock_strategy_enabled?(:time)\n locked_at && locked_at < self.class.unlock_in.ago\n else\n false\n end\n end", "def if_access_locked\n if access_locked?\n yield\n else\n self.errors.add(Devise.unlock_keys.first, :not_locked)\n false\n end\n end", "def modifiable?(user)\n RetroCM[:ticketing][:author_modifiable][:tickets] == true && self.user == user\n end", "def check_room_user\n set_room\n if current_user.id != @room.user.id\n redirect_to bookings_path, notice: \"Cannot Accept/Decline a booking of a room belonging to another user.\"\n end\n end", "def ensure_user\n current_user? || deny_access('You must be logged in to perform this action.')\n end", "def verify_correct_user\n @user = User.find(params[:id])\n # current_user is a function defined in sessions_helper\n if not @user == current_user\n flash[:danger] = \"Unauthorized Access.\"\n redirect_to listings_path\n end\n end", "def locked?\n self.invoiced? && self.invoice.issued?\n end", "def check_if_current_user\r\n User.current_user && User.current_user != self\r\n end", "def is_locked?\n return true if have_lock?\n begin\n return true unless acquire_lock\n ensure\n release_lock\n end\n false\n end", "def lock_to!(user)\n update_columns(locked_at: Time.current, locked_by: user.id)\n end", "def correct_user(user)\n user == current_user\n end", "def can_login?\n\t\t\t!disabled? && !locked?\n end", "def fully_authed?\n !(user.nil? || password.nil?)\n end" ]
[ "0.70337147", "0.6947563", "0.6824016", "0.6712785", "0.6572684", "0.6551799", "0.65500546", "0.6479596", "0.64442044", "0.6357171", "0.6342038", "0.6311035", "0.6302256", "0.6298216", "0.62921166", "0.6278902", "0.6278902", "0.6278902", "0.6278902", "0.6277163", "0.6273665", "0.6235673", "0.62232673", "0.6204518", "0.6174643", "0.6166278", "0.61348003", "0.6129629", "0.61247236", "0.61228967", "0.6117623", "0.60914385", "0.60573506", "0.6034379", "0.6023124", "0.60193294", "0.6003499", "0.59988266", "0.599651", "0.5973712", "0.59623986", "0.5961", "0.5951375", "0.5950099", "0.59429675", "0.59297395", "0.59221697", "0.59203166", "0.5919627", "0.59190035", "0.591626", "0.5902591", "0.59006536", "0.5880124", "0.5878935", "0.58784926", "0.5878441", "0.58729345", "0.5864533", "0.5861392", "0.58475024", "0.5843079", "0.5791825", "0.5790623", "0.57897764", "0.57778555", "0.57759666", "0.5766769", "0.57633895", "0.576147", "0.5755135", "0.5750153", "0.57407457", "0.5734794", "0.5698611", "0.56977075", "0.568501", "0.5673051", "0.5667647", "0.5667068", "0.566138", "0.5647167", "0.56437886", "0.5638363", "0.56338465", "0.56159776", "0.5615746", "0.5615746", "0.56152517", "0.5607486", "0.5602101", "0.55899304", "0.5584321", "0.55841506", "0.55835056", "0.55777043", "0.5575034", "0.55742717", "0.5569168", "0.55596924", "0.55582225" ]
0.0
-1
Overwrites active_for_authentication? from Devise::Models::Activatable for locking purposes by verifying whether a user is active to sign in or not based on locked?
def active_for_authentication?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def active_for_authentication?\n super and self.locked != 1\n end", "def active_for_authentication?\n super && active\n end", "def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end", "def active_for_authentication?\n active? && super\n end", "def active_for_authentication?\n super && self.is_active?\n end", "def active_for_authentication?\n self.active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && !access_locked?\n end", "def active_for_authentication?\n super && is_active?\n end", "def active_for_authentication?\n super && !self.deactivated # i.e. super && self.is_active\n end", "def active_for_authentication?\n super && isActive\n end", "def active_for_authentication?\r\n super && active_status?\r\n end", "def active_for_authentication?\n super && activation_status == true\nend", "def active_for_authentication?\n\t\tsuper && (self.is_active)\n\tend", "def active_for_authentication?\n super && account_active?\n end", "def active_for_authentication?\n !deactivated? && super\n end", "def active_for_authentication?\n super && !suspended_account\n end", "def active_for_authentication?\n super && un_blocked?\n end", "def active_for_authentication?\n super and self.enabled?\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !disabled?\n end", "def active_for_authentication?\n super && !disabled\n end", "def active_for_authentication?\n super && self.enabled? && self.is_allowed_in?\n end", "def active_for_authentication? \n super && approved? \n end", "def active_for_authentication?\n super && !disabled?\n end", "def active_for_authentication?\n super and !self.disabled?\n end", "def active_for_authentication?\n super\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && assigned?\n end", "def active_for_authentication?\n super && !expired?\n end", "def active_for_authentication?\n super && !self.is_disabled\n end", "def active_for_authentication?\n super && !deleted_at && self.enabled?\n end", "def active_for_authentication? \n super && (self.is_disabled == 0)\n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication?\n super && !disabled_at\n end", "def active_for_authentication?\n super && self.approved?\n end", "def active_for_authentication?\n super && !banned?\n end", "def active_for_authentication?\n super && !banned\n end", "def active_for_authentication? \n \tsuper && approved?\n \t\n\tend", "def active_for_authentication?\n # logger.debug self.to_yaml\n super && account_active?\n end", "def active_for_authentication? \n super && is_approved? \n end", "def active_for_authentication?\n super && bloqueado == 0\n end", "def active_for_authentication?\n login_email = multi_email.login_email_record\n\n if login_email && !login_email.primary?\n super && login_email.active_for_authentication?\n else\n super\n end\n end", "def active_for_authentication?\n super && !self.deactivated_staff?\n end", "def resource_active_for_authentication?\n [email protected]_to?(:active_for_authentication?) || @resource.active_for_authentication?\n end", "def active_for_authentication?\n super and self.disponible?\n end", "def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end", "def valid_for_authentication?\n return super unless persisted? && lock_strategy_enabled?(:failed_attempts)\n\n # Unlock the user if the lock is expired, no matter\n # if the user can login or not (wrong password, etc)\n unlock_access! if lock_expired?\n\n if super && !access_locked?\n true\n else\n increment_failed_attempts\n if attempts_exceeded?\n lock_access! unless access_locked?\n else\n save(validate: false)\n end\n false\n end\n end", "def active_for_authentication?\n super && !deleted?\n end", "def active_for_authentication?\n super && !deleted?\n end", "def active_for_authentication?\n super && !deleted?\n end", "def active_for_authentication?\n super and !self.is_archived? #determine \"active\" state using our own \"is_archived\" column\n end", "def active_for_authentication?\n # User is approved when harp_id is assigned.\n # Approved flag is set programmatically when harp_id is set by an admin.\n super && is_approved?\n end", "def active_for_authentication?\n super and not self.deleted?\n end", "def active_for_authentication? \n super && (approved? || self.admin) \n end", "def active_for_authentication? \n super && !is_deleted \n end", "def active_for_authentication?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def can_lock?(current_user)\n return false if current_user.anonymous?\n\n not is_locked?\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication?\n\t\tsuper && !deleted_at\n\tend", "def active_for_authentication?\n super && !deleted_at\n end", "def active_for_authentication? \n super && !deleted_at\n end", "def active_for_authentication?\n confirmed? || confirmation_period_valid?\n end" ]
[ "0.85483515", "0.8131657", "0.8084946", "0.80848265", "0.8077217", "0.80631816", "0.8053863", "0.8053863", "0.8053863", "0.8050298", "0.8050298", "0.80463076", "0.80463076", "0.80463076", "0.8038797", "0.8016186", "0.80049366", "0.79989564", "0.7983382", "0.79682815", "0.7943092", "0.79326516", "0.7927973", "0.7828738", "0.77848095", "0.77033424", "0.7669902", "0.7669902", "0.7669902", "0.7639366", "0.7639366", "0.7630672", "0.76295274", "0.7606477", "0.76028395", "0.7602378", "0.75991625", "0.75888115", "0.75733924", "0.75733924", "0.75733924", "0.75733924", "0.75733924", "0.75733924", "0.75733924", "0.75683945", "0.75311863", "0.7501864", "0.7493071", "0.7491574", "0.7468251", "0.7457325", "0.7457325", "0.7454726", "0.73991865", "0.7392661", "0.7382138", "0.7376321", "0.7360441", "0.73334485", "0.7326658", "0.73005724", "0.72604984", "0.7231781", "0.72075856", "0.7170369", "0.71678805", "0.71578145", "0.71578145", "0.71578145", "0.71463585", "0.70373106", "0.70150614", "0.7006049", "0.7002109", "0.69167924", "0.68788385", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6871383", "0.6840036", "0.6793778", "0.6788469", "0.6772105" ]
0.7566635
47
Overwrites invalid_message from Devise::Models::Authenticatable to define the correct reason for blocking the sign in. source://devise//lib/devise/models/lockable.rb95
def inactive_message; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_credentials\n if user = User.active.find_by_login(params[:username].to_s)\n #increment brute-force counter\n set_brute_force_counter(user, get_brute_force_counter(user) + 1)\n #lock the user immediately if detecting a brute force attack\n if brute_forcing?(user)\n set_brute_force_lock_time(user, Time.now + LOCKED_FOR_MINUTES.minutes)\n user.update_attribute(:lock_comment, \"Locked at #{Time.now} after #{MAX_FAILED_ATTEMPTS} erroneous password\")\n user.lock!\n end\n end\n # original action\n super\n \n flash.now[:error] = l(:notice_account_invalid_credentials_or_locked) unless Rails.env == 'test'\n end", "def inactive_message\n # this method actually is not implemented by devise_token_auth\n # instead, use devise_token_auth locales file or override #render_create_error_not_confirmed in controller\n # still not sure why it uses not_confirmed anyway, but at least I'm not the only one. See below\n #\n # This incomplete PR corrects it:\n # https://github.com/lynndylanhurley/devise_token_auth/pull/533\n # https://github.com/lynndylanhurley/devise_token_auth/pull/533/files\n end", "def invalid_login_attempt\n warden.custom_failure!\n json_response({ success: false, message: \"Username/Password incorrect.\" }, 400)\n end", "def invalid_login_attempt\n warden.custom_failure!\n render :json => {success: false, message: \"Error with your email or password\"}, status: 401\n end", "def note_failed_signin\n flash.now[:error] = \"Usuário ou senha inválida\"\n logger.warn \"Falha no login do usuario '#{params[:login]}' através do IP #{request.remote_ip} às #{Time.now.utc}\"\n end", "def invalid_authentication\n #render json: {errors: ['Invalid Request']}, status: :unauthorized\n error!('Invalid Request', :unauthorized)\n end", "def invalid_request_token_message\n \"Illegal Attempt to retrieve AccessToken.\"\n end", "def invalid_login_attempt\n set_flash_message(:error, :invalid)\n render json: flash[:error], status: 401\n end", "def note_failed_signin\n flash[:error] = t('labels.name_or_password_error')\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def invalid_access_token_message\n \"Illegal Attempt to access private resource with a RequestToken. Please obtain an AccessToken before proceeding.\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def authenticate_error\n render json: { error: t('devise.failure.unauthenticated') }, status: 401\n end", "def note_failed_signin\n flash[:error] = \"Invalid user name or password\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Invalid user name or password\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\r\n flash[:error] = \" Invalid user/password combination.\"\r\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "def invalid_authentication\n render json: {error: 'Invalid request'}, status: :unauthorized\n end", "def authentication_error\n # User's token is either invalid or not in the right format\n render 'api/v1/shared/failure', locals: { errors: [{ user: ['is unauthorized'] }] }, status: :unauthorized # Authentication timeout\n end", "def invalid_authentication\n render json: {errors: {code: 401, message: \"You need to sign in\"}}, status: :unauthorized\n end", "def inactive_message\n\n date_restricted? ? :account_date_restricted : super\n\n end", "def invalid_authentication\n reject_unauthorized_connection\n end", "def note_failed_signin\n flash[:error] = \"用户名或密码错误!\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def failed_login_message\n if failed_login?\n flash.now[:error] = flash[:alert]\n flash.now[:alert] = nil\n end\n end", "def ignore_unavailable_authentication_information_state\n super\n end", "def invalid_authentication\n render json: { error: 'Invalid request' }, status: 403\n end", "def note_failed_signin\n flash[:error] = \"Não foi possível fazer seu login. Redigite seu e-mail e sua senha. As senhas do Cidade Democrática distinguem maiúsculas de minúsculas.\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\r\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'. Check your email or password.\"\r\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "def require_no_authentication\n super\n return unless flash[:alert].present?\n\n flash[:alert] = nil\n flash[:notice] = _('You are already signed in as another user. Please log out to activate your invitation.')\n end", "def invalid_authentication\n render_error 'Authentication failure', 'unauthorized', 401\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{ params[:login] }'.\"\n logger.warn \"Failed login for '#{ params[:login] }' from #{ request.remote_ip } at #{ Time.now.utc }\"\n end", "def auth_bounce_reason(credential)\n (credential.is_a?(Credentials::Email) && !credential.verified?) ?\n :blocked : nil\n end", "def note_failed_signin\n flash[:error] = \"Usuário e/ou senha incorreto(s)\"\n #flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\r\n flash[:notice] = \"#{I18n.t'flash.log_in_failed_for'} '#{params[:user_session][:login]}'\"\r\n logger.warn \"Failed login for '#{params[:user_session][:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.zone.now}\"\n end", "def note_failed_signin\n flash[:notice] = \"We could not log you in with the credentials supplied. Perhaps you mistyped them, or you have not yet activated your account by verifying your email address?\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def note_failed_signin\n flash[:error] = \"Impossible de vous connecter en tant que '#{params[:login]}'\"\n flash[:notice] = \"Peut être ne vous êtes vous pas encore inscrit\"\n logger.warn \"Authentification échoué en tant que '#{params[:login]}' pour #{request.remote_ip} à #{Time.now.utc}\"\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def invalid_authentication\n render json: { error: 'Unauthorized' }, status: :unauthorized\n end", "def invalid_authentication\n render json: {message: 'Invalid Request'}, status: :unauthorized\n end", "def inactive_message\n access_locked? ? :locked : super\n end", "def deny_wrong_user\n redirect_to signin_path, notice: \"Sorry, you can't access that page.\"\n end", "def invalid_authentication\n Log.error(\"invalid_authentication\")\n render json: {error: 'Invalid authentication'}, status: :unauthorized\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:openid_identifier]}'\"\n logger.warn \"Failed login for '#{params[:openid_identifier]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Vous ne pouvez pas vous connecter en tant que '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def invalid_login_attempt\n \n set_flash_message(:alert, :invalid)\n data = {:code => \"NOK\"}\n render json: data \n # render json: flash[:alert], status: 401\n end", "def note_failed_signin\n message = \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now}\"\n errormark \"Couldn't log you in as '#{params[:login]}'\"\n warn message\n audit message\n end", "def user_is_not_blocked\n return errors.add(:user, 'You cannot block yourself')\\\n if user_id == blocked_id\n end", "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end", "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end", "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end", "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def authentication_failed\n authentication_failed_msg.text\n end", "def note_failed_signin\n error_status(true, :login_failure, {}, false)\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def handle_unverified_request\n super\n render :text => \"Forgery protection token was not present.\", :status => :unauthorized\n end", "def note_failed_signin(message, login_name = nil)\n flash.now[:error] = message\n UserFailure.record_failure(request.remote_ip, request.env['HTTP_USER_AGENT'], \"login\", login_name)\n end", "def note_failed_signin\n flash.now[:error] = \"No puede Iniciar Session como '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def note_failed_signin\n flash[:error] = \"Login failed! Wrong username or password.\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end", "def invalid_authentication\n render json: { error: 'Not Authenticated' }, status: :unauthorized\n end", "def invalid_message\r\n @invalid_message ||= 'Please enter Yes or No.'\r\n end", "def i18n_message(default = nil)\n message = warden.message || warden_options[:message] || default || :unauthenticated\n\n if message.is_a?(Symbol)\n I18n.t(:\"#{scope}.#{Devise.authentication_keys.first}_#{message}\", resource_name: scope,\n scope: \"devise.failure\", default: [message, message.to_s])\n else\n message.to_s\n end\n end", "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end", "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end", "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end", "def bad_auth_token\n logger.warn('Caught invalid authenticity request')\n flash[:notice] = 'Invalid authenticity token, please try again'\n redirect_to_back_or_root!\n end", "def invalid_token\n render json: {\n error: \"Invalid Authenticition Token\",\n status: 400\n }, :status => 403\n end", "def indicate_unauthorised_request(message)\n respond_to do |format|\n format.html {\n flash[:error] = message\n redirect_back_or_default(home_url)\n }\n format.json {\n render json: {:errors => [\"#{message}\"]}, :status => :unauthorized\n }\n end\n end", "def authenticate_user!\n current_user.stamp! if current_user\n # return render(nothing: true, :status => :unauthorized) if !current_user\n render_error_messages(['Your session has been expired. Please authenticate again.'], :unauthorized) if !current_user\n render_error_messages(['Your account has been banned. Please contact to administrator.'], :unauthorized) if current_user && current_user.banned?\n end", "def create\n flash[:password_change_info] = t('devise.passwords.send_paranoid_instructions')\n super\n end", "def render_failed_auth_response\n render status: 401,\n json: json_response(:fail, data: {user: \"Valid email and token must be present.\"})\n end", "def render_unauthorized(message)\n errors = { errors: [ { detail: message } ] }\n render json: errors, status: :unauthorized\n end", "def auth_bounce_reason(crdential)\n nil\n end", "def auth_bounce_reason(crdential)\n nil\n end", "def render_access_denied\r\n RenderError.new('422')\r\n end", "def inactive_message\n login_email = multi_email.login_email_record\n\n if login_email && !login_email.primary? && !login_email.confirmed?\n :unconfirmed\n else\n super\n end\n end", "def inactive_message\n !disabled ? super : :account_has_been_disabled\n end", "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end", "def render_unauthorized(message)\n errors = { errors: [detail: message ] }\n render json: errors, status: :unauthorized\n end", "def create\n super\n resource_owner_id = authorize_response.try(:token).try(:resource_owner_id)\n user = User.find_by_id( resource_owner_id ) unless resource_owner_id.blank?\n # A suspended user might have a valid access token\n raise INat::Auth::SuspendedError if user&.suspended?\n rescue INat::Auth::BadUsernamePasswordError\n headers.delete \"WWW-Authenticate\"\n self.status = 400\n self.response_body = {\n error: \"invalid_grant\",\n error_description: I18n.t( \"devise.failure.invalid\" )\n }.to_json\n rescue INat::Auth::SuspendedError\n headers.delete \"WWW-Authenticate\"\n self.status = 400\n self.response_body = {\n error: \"invalid_grant\",\n error_description: I18n.t( :this_user_has_been_suspended )\n }.to_json\n rescue INat::Auth::ChildWithoutPermissionError\n headers.delete \"WWW-Authenticate\"\n self.status = 400\n self.response_body = {\n error: \"invalid_grant\",\n error_description: I18n.t( :please_ask_your_parents_for_permission )\n }.to_json\n rescue INat::Auth::UnconfirmedError\n headers.delete \"WWW-Authenticate\"\n self.status = 400\n self.response_body = {\n error: \"invalid_grant\",\n error_description: I18n.t( \"devise.failure.unconfirmed\" )\n }.to_json\n rescue INat::Auth::UnconfirmedAfterGracePeriodError\n headers.delete \"WWW-Authenticate\"\n self.status = 400\n self.response_body = {\n error: \"invalid_grant\",\n error_description: I18n.t(\n :email_conf_required_after_grace_period,\n requirement_date: I18n.l( User::EMAIL_CONFIRMATION_REQUIREMENT_DATETIME.to_date, format: :long )\n )\n }.to_json\n end", "def render_unauthorized(message)\n errors = {errors: [detail: message]}\n render json: errors, status: :unauthorized\n end" ]
[ "0.6559674", "0.6404656", "0.6306189", "0.62868536", "0.60921043", "0.6026309", "0.59751576", "0.59562993", "0.5956124", "0.59043485", "0.5895153", "0.58944035", "0.58944035", "0.5882994", "0.5881586", "0.5881586", "0.5872349", "0.58481973", "0.5848008", "0.58386236", "0.58303535", "0.58299816", "0.581553", "0.5807764", "0.5803747", "0.58024085", "0.5796706", "0.5789696", "0.5780492", "0.578027", "0.5775057", "0.57718927", "0.57613796", "0.574718", "0.5743411", "0.5742154", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.57399404", "0.5732034", "0.5730734", "0.5728292", "0.57276833", "0.5723712", "0.5722514", "0.57217485", "0.5711298", "0.5708348", "0.5698517", "0.56783694", "0.56710935", "0.56597275", "0.5653181", "0.5642446", "0.5637531", "0.5637531", "0.5637531", "0.5637531", "0.5636956", "0.56327415", "0.56327415", "0.56327415", "0.56327415", "0.56327415", "0.56299007", "0.5625875", "0.56189996", "0.56136084", "0.5608536", "0.55847317", "0.55580693", "0.5557073", "0.5547294", "0.55458796", "0.55320287", "0.55320287", "0.55320287", "0.55110407", "0.551026", "0.5486221", "0.54677516", "0.54628885", "0.544399", "0.5437887", "0.54286265", "0.54286265", "0.5424805", "0.5424677", "0.5418286", "0.54066634", "0.54044324", "0.54034084", "0.5403011" ]
0.0
-1
Resend the unlock instructions if the user is locked. source://devise//lib/devise/models/lockable.rb83
def resend_unlock_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resend_unlock_instructions\n if_access_locked { send_unlock_instructions }\n end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def send_unlock_instructions; end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def unlock\n self.is_locked = false\n self\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def toggle_locking(current_user)\n if can_toggle_locking?(current_user)\n is_locked? ? unlock : lock(current_user.id) # TODO: raise exception or report error here?\n end\n end", "def send_unlock_instructions\n raw, enc = Devise.token_generator.generate(self.class, :unlock_token)\n self.unlock_token = enc\n save(validate: false)\n send_devise_notification(:unlock_instructions, raw, {})\n raw\n end", "def login_unlock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => nil,\n config.failed_logins_count_attr_name => 0,\n config.unlock_token_attr_name => nil\n }\n sorcery_orm_adapter.update_attributes(attributes)\n end", "def unlock\n @locking = false\n end", "def unlock\n if job\n job.report_running if report_job_status\n job.set_status(\"Unlocking #{to_s}\")\n end\n\n attempt_unlock\n\n report(true)\n end", "def unlock\n @publication = Publication.find(params[:id])\n @publication.lock!\n @publication.unlock!\n flash[:notice] = \"Previously rejected publication accepted as preplanned.\"\n # flash[:notice] = \"Previously rejected publication accepted as preplanned. Email sent to the author.\"\n # @email = Email.find_by_trigger('unlock') \n # Notifier.workflow_notification(@publication.user,@email,@publication).deliver\n redirect_to publication_url \n end", "def unlock\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def mgmt_lock\n @dailybank.update_attribute(:status, \"Locked\")\n redirect_to @dailybank, notice: \"Thank you for reviewing End of Night. This record is now locked\"\n end", "def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def unlock\n locksmith.unlock # Only signal to release the lock\n end", "def lock_expired?; end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end", "def run_action_unlock(item)\n item = validate_item(item)\n ui.print \" Unlocking #{ui.color(item, :bold)}... \"\n content = load_json(File.read(item)).to_smash\n if content[:sfn_parameters_lock]\n content = unlock_content(content)\n content.delete(:sfn_lock_enabled)\n File.write(item, format_json(content))\n ui.puts ui.color(\"unlocked\", :green)\n else\n ui.puts ui.color(\"no-op\", :yellow)\n ui.warn \"Item is already unlocked! (#{item})\"\n end\n end", "def unlock_access!; end", "def unlock\n load_resource\n resource_instance_variable.unlock\n flash[:notice] = t(\"unlocked_page\", :name => resource_instance_variable.name)\n @contentables_locked_by_user = resource_handler.model.all_locked_by(current_user)\n respond_to do |format|\n format.js\n format.html {\n redirect_to params[:redirect_to].blank? ? resource_url_scope.send(\"admin_#{resource_handler.resources_name}_path\") : params[:redirect_to]\n }\n end\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n if unlocked_status == true\n raise ArgumentError.new(\"The door is already unlocked!\")\n else\n door_hash[:unlocked_status] = true\n end\n end", "def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end", "def lock_to!(user)\n update_columns(locked_at: Time.current, locked_by: user.id)\n end", "def result_unlock\n\n end", "def unlock!(certifier)\n return false unless self.locked? # gotta be locked\n# return false unless self.certified_at.nil? # can't already be certified\n return false unless self.certifier_id == certifier.id # gotta be the currently active user\n\n return self.update_attributes!(:locked => false, :certifier_id => nil)\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def perform_unlock\n allowed_unlocks = %w(unlocked_five_activities unlocked_ten_activities unlocked_fifty_activities)\n\n unless allowed_unlocks.include?(params[:slug])\n return json_error \"An invalid slug was specified. Only #{allowed_unlocks.join(', ')} are allowed.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n unlock_event = unlocker.unlock!(params[:slug])\n \n if unlock_event\n render json: { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n else\n return json_error unlocker.errors.join(' ')\n end\n end", "def unlock_instructions\n \tCustomMailer.unlock_instructions\n end", "def unlock(*args, &block)\n map_method(:unlock, args, &block)\n end", "def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end", "def force_unlock(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::ForceUnlock,\n parameters, invocation_options)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlocks_from_user_data(user_data)\n raise NotImplementedError\n end", "def unlock_answer\n\t\t@problem = current_problem\n\t\tif !current_user.unlock_answer_of(@problem).nil?\n\t\t\tcurrent_user.notifications.create!(message:\"Answer of \" + view_context.link_to( @problem.title, problem_path(@problem) ) + \" was unlocked. #{COST_TO_UNLOCK_ANSWER} gold were deducted from your account balance.\")\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js\n\t\t\t\tformat.html { flash[:success] = \"You successfully unlocked the answer of this problem.\" \n\t\t\t\t\t\t\t\t\t\t\tredirect_to problem_path(@problem) }\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { flash.now[:danger] = \"There was a problem. The answer was not unlocked.\" }\n\t\t\t\tformat.html { flash[:danger] = \"There was a problem. The answer was not unlocked.\" \n\t\t\t\t\t\t\t\t\t\t\tredirect_to problem_path(@problem) }\n\t\t\tend\n\t\tend\n\tend", "def can_unlock?\n SpaceRequestPolicy.can_unlock?(current_user, object)\n end", "def if_access_locked\n if access_locked?\n yield\n else\n self.errors.add(Devise.unlock_keys.first, :not_locked)\n false\n end\n end", "def account_locked\n @user = User.find(params[:id])\n end", "def unlock_access_by_token(unlock_token); end", "def can_unlock?(current_user)\n return false if current_user.anonymous?\n\n is_locked? and not is_locked_by_other?(current_user)\n end", "def unlock_access_by_token(unlock_token)\n original_token = unlock_token\n unlock_token = Devise.token_generator.digest(self, :unlock_token, unlock_token)\n\n lockable = find_or_initialize_with_error_by(:unlock_token, unlock_token)\n lockable.unlock_access! if lockable.persisted?\n lockable.unlock_token = original_token\n lockable\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end", "def unlockable?(resource)\n \tresource.respond_to?(:unlock_access!) &&\n \tresource.respond_to?(:unlock_strategy_enabled?) &&\n \tresource.unlock_strategy_enabled?(:email)\n\tend", "def lock\n @unlocked = false\n \"Diary is now locked\"\n end", "def lock\n if unlocked_status == false\n raise ArgumentError.new(\"You cannot lock this door - it is already locked\")\n else\n door_hash[:unlocked_status] = false\n end\n end", "def check_unlock\n if params[:slug] != 'max_activities'\n return json_error \"At this time, a user can only unlock for 'max_activities'.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n payload = { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n\n payload[:highest_level_reached] = true if unlocker.highest_level?\n\n render json: payload \n end", "def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end", "def unlock!\n if @locked\n cleanup_lock_file!\n @locked = false\n true\n end\n end", "def unlock\n if @unlocked == true\n raise ExceptionError.new(\"An unlocked door needith not be unlocked\")\n else\n return @unlocked = true\n end\n end", "def grant_access(message_id, user_id)\n lockedMessage = LockedMessage.find_by(message_id: message_id, user_id: user_id)\n if lockedMessage && lockedMessage.unlocked == false\n lockedMessage.update_attributes(unlocked: true)\n end\n end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlock(params = {})\n params ||= {}\n params[:id] = @attributes[:id]\n raise MissingParameterError.new(\"Current object doesn't have a id\") unless @attributes[:id]\n raise InvalidParameterError.new(\"Bad parameter: id must be an Integer\") if params[:id] and !params[:id].is_a?(Integer)\n raise MissingParameterError.new(\"Parameter missing: id\") unless params[:id]\n\n Api.send_request(\"/users/#{@attributes[:id]}/unlock\", :post, params, @options)\n end", "def lockout?\n @lockout\n end", "def admin_lock\n data = params[:user_id]\n role = params[:role_id]\n\n #start query\n query = Admin.where(id: data, role_id: role)\n\n #on change le statut de l'utilisateur\n query.lock = true\n\n if query.save\n redirect_to parametre_admins_admin_show_path, flash[:notice] = \"User locked\"\n end\n\n end", "def work\n stat :attempting_lock_on, item_id: object_id\n if @mutex.try_lock\n stat :has_lock_on, item_id: object_id\n chore\n stat :releasing_lock_on, item_id: object_id\n @mutex.unlock\n else\n stat :bailed_on, item_id: object_id\n end\n end", "def unlocked?\n !locked?\n end", "def lock_task\n task = MailTasks::Task.find( params[:id] )\n task.update_attribute( :disabled, true )\n flash[:notice] = \"Task \\\"#{task.name}\\\" has been locked!\"\n redirect_to :action => \"index\"\n end", "def lock!(user = User.current)\n self.comment = \"Agenda closed\"\n self.author = user\n self.locked = true\n self.save\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def locked?\n approved? or rejected?\n end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def toggle_password_expiry\n @user = User.find(params[:id])\n\n respond_to do |format|\n @nav = 'show_nav'\n if (@local_manager.slave?)\n flash[:warning] = \"This action is prohibited on slave systems.\"\n format.html { redirect_to user_url(@user) }\n format.xml { render :xml => '<errors><error>This action is prohibited on slave systems.</error></errors>', :status => :not_acceptable }\n else\n @user.toggle_password_expiry!\n @local_manager.log(:username => @session_user.username, :user_id=> @user.id, :message => \"Toggled password expiry (current=#{@user.login_password_expired?}) for user #{@user.username}.\")\n flash[:notice] = \"You must publish this user before changes will take effect on TACACS+ daemons.\"\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n end\n end\n end", "def allow_lock\n if params[:checked] == \"1\"\n if !params[:current_user_id].blank?\n locks = Communication.find(params[:note_id]).update_attributes(:lock_by_user_id => \"#{params[:current_user_id]}\")\n end\n else\n locks = Communication.find(params[:note_id]).update_attributes(:lock_by_user_id => \"\")\n end\n render :update do |page|\n if params[:checked] == \"1\"\n flash[:notice] = \"Succesfuly locked\"\n page.redirect_to wfm_notes_path\n else\n flash[:notice] = \"Succesfuly Unlocked\"\n page.redirect_to wfm_notes_path\n end\n end\n end", "def password_require_to_unlock_from_idle=(value)\n @password_require_to_unlock_from_idle = value\n end", "def lock\n post :lock\n end", "def unlock; end", "def lock\n @privkey = nil\n @locked = true\n end", "def update\n return if params_missing([ :id, :lock_serial ], params, true)\n\n lock = Lock.get_active_else_not(params)\n return render_error_modelname(404, :MISSING_RECORD, Lock) if !lock\n\n # Only the owner can update the lock record\n return render_error(403, :NOT_BELONGING, Lock) if lock.user_id != @current_user_device.user_id\n return render_error(404, :LOCK_DECOMMISSIONED) if lock.decommissioned?\n\n lock.assign_attributes(params_app_allowed)\n\n new_lock = false\n if !lock.commissioned?\n # New lock, set it all up\n new_lock = true\n lock.commission_date = DateTime.now\n end\n\n return check_save_failure(lock) if !lock.save\n\n # Owner's key not created until commissioning is completed (saved) successfully.\n # TODO Transaction around this and the commissioning?\n if new_lock\n key = create_user_key(lock.id, lock.user, lock.user)\n # Validation errors may fail in interesting ways here.\n end\n\n render_lock_reply(lock)\n end", "def lock!\n self.for_update!\n end", "def unlock\n # fetching page via before filter\n @page.unlock!\n flash[:notice] = _t(:unlocked_page, :name => @page.name)\n @pages_locked_by_user = Page.from_current_site.all_locked_by(current_alchemy_user)\n respond_to do |format|\n format.js\n format.html {\n redirect_to params[:redirect_to].blank? ? admin_pages_path : params[:redirect_to]\n }\n end\n end", "def admin_reactivate\n user = User.find(params[:id])\n authorize! :edit, @user #prevent other users from disabling OTP on another user.\n user.deactivated = false\n user.save!\n flash[:notice] = \"Successfully Reactivated user.\"\n redirect_back(fallback_location: '/')\n end", "def password_require_to_unlock_from_idle\n return @password_require_to_unlock_from_idle\n end", "def unlock_forum\n @lecture.forum.update(locked: false) if @lecture.forum?\n redirect_to edit_lecture_path(@lecture)\n end", "def locked\n end", "def webdav_unlock()\n #TODO implementation for now return a 200 OK\n # @resource = get_resource_for_path(@path_info)\n # lock = lock_factory.unlock(@resource)\n lock_token = request.headers[\"Lock-Token\"].gsub(/(^<)|(>$)/, \"\")\n logger.debug \"lock_token=\" + lock_token\n lock = lock_factory.unlock(@path_info, lock_token)\n # 204=\"No content\"\n render :nothing => true, :status => 204 and return\n end", "def unlock\n # fetching page via before filter\n @page.unlock\n flash[:notice] = _(\"unlocked_page_%{name}\") % {:name => @page.name}\n if params[:redirect_to].blank?\n redirect_to admin_pages_path\n else\n redirect_to(params[:redirect_to])\n end\n end", "def update\n # self.resource = resource_class.reset_password_by_token(resource_params)\n # yield resource if block_given?\n\n # if resource.errors.empty?\n # resource.unlock_access! if unlockable?(resource)\n # set_flash_message!(:notice, :updated_not_active)\n # respond_with resource, location: new_session_path(resource_name)\n # else\n # respond_with resource\n # end\n end", "def lock\n if @unlocked == false\n raise Exception.new(\"a locked door needith not to be locked\")\n else\n return @unlocked = false\n end\n end", "def unlock_all!\n locks.active.each(&:unlock!)\n end", "def unlocked?\n not locked?\n end", "def do_LOCK(req, res)\n end", "def return_lock\n\t\t@@logger.info { \"Returning the lock to the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => true).update(:locked => false) != 0\n\tend" ]
[ "0.77727306", "0.7235527", "0.7186027", "0.7184529", "0.71675", "0.70547026", "0.7016046", "0.7014098", "0.70109737", "0.6992", "0.69590497", "0.695284", "0.6913188", "0.6892723", "0.67961067", "0.67468196", "0.6732579", "0.67226917", "0.66999245", "0.66361547", "0.66101956", "0.65948206", "0.6571744", "0.6542426", "0.65294313", "0.65208507", "0.6517314", "0.64918673", "0.644125", "0.6435041", "0.64261955", "0.64209014", "0.64048254", "0.6404816", "0.63675094", "0.6367104", "0.6280199", "0.62686384", "0.62624174", "0.6257328", "0.6232864", "0.62280333", "0.62256354", "0.6180378", "0.617262", "0.61654127", "0.61653256", "0.616415", "0.61565155", "0.61564434", "0.61557776", "0.61487305", "0.61380666", "0.61380666", "0.61324906", "0.61324906", "0.6128282", "0.6125118", "0.61154073", "0.6112882", "0.61113304", "0.6094349", "0.60901165", "0.6061942", "0.60540545", "0.6048007", "0.60275924", "0.6026071", "0.6021267", "0.6014765", "0.59768885", "0.59754145", "0.59734064", "0.5972744", "0.59630734", "0.59523803", "0.5951257", "0.5951257", "0.59503883", "0.5924119", "0.5901111", "0.589448", "0.5888204", "0.58840823", "0.5882839", "0.58808434", "0.5869693", "0.58630455", "0.58501357", "0.5848169", "0.5846111", "0.5845844", "0.5844159", "0.58393794", "0.5830635", "0.58164", "0.58157176", "0.5810458", "0.5801604", "0.58013016" ]
0.74830425
1
Resets failed attempts counter to 0. source://devise//lib/devise/models/lockable.rb61
def reset_failed_attempts!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_failed_attempts!\n if respond_to?(:failed_attempts) && !failed_attempts.to_i.zero?\n self.failed_attempts = 0\n save(validate: false)\n end\n end", "def reset!\n begin\n update_attributes!(:attempts => 0, :error => nil, :lock => nil, :run_at => Time.now.utc)\n rescue => e\n logger.warn(e)\n end\n end", "def reset_attempt\n if @reset_attempts.nil?\n session['reset_attempt'] ||= 0\n @reset_attempts = session['reset_attempt'] += 1\n end\n @reset_attempts\n end", "def reset_attempt\n if @reset_attempts.nil?\n session['reset_attempt'] ||= 0\n @reset_attempts = session['reset_attempt'] += 1\n end\n @reset_attempts\n end", "def reset!\n begin\n update!(:attempts => 0, :error => nil, :lock => nil, :run_at => Time.now.utc)\n rescue => e\n DataMapper.logger.warn(e)\n end\n end", "def reset\n @attempt = 0\n end", "def reset!\n self.attempts = 0\n self.lock = nil\n self.error = nil\n self.run_at = Time.now.utc\n self.save\n rescue => e\n self.class.logger.warn(e) if self.class.logger\n end", "def reset_last_failed_attempt_time\n @last_failed_attempt_time = nil\n end", "def failed_login!\n @number_of_bad_logins = increment_bad_login_counter\n throttle_user if should_throttle?\n end", "def failed_attempts\n read_attribute(:failed_attempts) || 0\n end", "def max_attempts\n 1\n end", "def max_attempts\n 1\n end", "def max_attempts\n 1\n end", "def max_attempts\n 1\n end", "def max_attempts\n 1\n end", "def num_attempts\n @num_attempts\n end", "def max_attempts\n 5\n end", "def lock_timeout_retries=(_arg0); end", "def reconnect_attempts=(val)\n @j_del.setReconnectAttempts(val)\n self\n end", "def incr!\n self.update_attributes(:attempts => self.attempts+1, :last_logged => Time.now)\n end", "def retried\n tryouts.size\n end", "def attempts=(value)\n doc['attempts'] = value.to_i\n end", "def attempts\n doc['attempts'] || 0\n end", "def try_again\n update_attributes({\n :worker_record => nil,\n :attempts => self.attempts + 1\n })\n end", "def reset_undefined_retries!\n return if @undefined_retries == @original_undefined_retries\n\n Astute.logger.debug \"Reset undefined retries to original \"\\\n \"value: #{@original_undefined_retries}\"\n @undefined_retries = @original_undefined_retries\n end", "def reconnect_attempts(val = nil)\n if val\n @j_del.setReconnectAttempts(val)\n self\n else\n @j_del.getReconnectAttempts\n end\n end", "def lock_timeout_retries; end", "def failure!\n @count += 1\n end", "def passcode_sign_in_failure_count_before_wipe=(value)\n @passcode_sign_in_failure_count_before_wipe = value\n end", "def increment_tries\n @tries += 1\n end", "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def successful_login!\n unthrottle_user\n clear_bad_login_counter\n end", "def password_sign_in_failure_count_before_factory_reset\n return @password_sign_in_failure_count_before_factory_reset\n end", "def password_sign_in_failure_count_before_factory_reset\n return @password_sign_in_failure_count_before_factory_reset\n end", "def password_sign_in_failure_count_before_factory_reset=(value)\n @password_sign_in_failure_count_before_factory_reset = value\n end", "def password_sign_in_failure_count_before_factory_reset=(value)\n @password_sign_in_failure_count_before_factory_reset = value\n end", "def attempts\n _redis.lindex(_batch_key, 2).to_i\n end", "def number_of_retries(num)\n raise ArgumentError, 'Must be positive Integer' unless num.is_a?(Integer) && num.positive?\n self.retries = num\n end", "def max_retries\n @max_retries ||= DEFAULT_MAX_RETRY_ATTEMPTS\n end", "def failed_users_count=(value)\n @failed_users_count = value\n end", "def prevent_multiple_retries\n return unless @attempts > 1\n raise 'Multiple Consecutive Session Token Invalid Responses from EDS'\n end", "def set_attempts_amount\n max_number <= 10 ? 2 : 10\nend", "def reset_counter; end", "def work_profile_password_sign_in_failure_count_before_factory_reset\n return @work_profile_password_sign_in_failure_count_before_factory_reset\n end", "def failure\n @__num_of_tries ||= 0\n @__num_of_tries += 1\n back_amb.pop.call\n end", "def reset!\n # The parameters used by default.\n self.locking_name_field = :locking_name\n self.locked_at_field = :locked_at\n self.lock_timeout = 5\n self.locker_write_concern = { w: 1 }\n self.maximum_backoff = 60.0\n self.backoff_algorithm = :exponential_backoff\n self.locking_name_generator = :secure_locking_name\n end", "def work_profile_password_sign_in_failure_count_before_factory_reset=(value)\n @work_profile_password_sign_in_failure_count_before_factory_reset = value\n end", "def failed_count=(value)\n @failed_count = value\n end", "def failed\n @fail_count = 0 if (@last_fail_time + @interval_time).utc < Time.now\n @fail_count += 1\n @last_fail_time = Time.now\n open! if @fail_count >= @fail_threshold\n end", "def passcode_sign_in_failure_count_before_wipe\n return @passcode_sign_in_failure_count_before_wipe\n end", "def current_attempt\n previous_attempts + 1\n end", "def reset_pod_watch_retry_stats\n Thread.current[:pod_watch_retry_count] = 0\n Thread.current[:pod_watch_retry_backoff_interval] = @watch_retry_interval\n end", "def reset_checks\n @checks_remaining = 3\n end", "def max_retry\n 5\n end", "def reset_checks\n @counter = 0\n end", "def attempts_before_deactivation=(value)\n return false unless @enabled\n update(:type => self.type, :attempts_before_deactivation => value)\n end", "def reset_password_reset_page_access_counter\n send(:\"#{sorcery_config.reset_password_page_access_count_attribute_name}=\", 0)\n sorcery_adapter.save\n end", "def reset_counter\n @run_count = 0\n end", "def successful_authentication(user)\n set_brute_force_counter(user, 0)\n super\n end", "def stop_hammering\n logger.info(\"Rescue from Exceptions::AttemptedHammering\")\n flash[:error] = \"Too many login attempts. This user's account has been timed out. Please try again in an hour.\"\n redirect_to home_path\n end", "def max_attempts\n @options[:max_attempts]\n end", "def lock_timeout_retry_delay=(_arg0); end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def setRetryCount(count)\n @helper.setRetryCount(count)\n self\n end", "def retries\n [@times_visited - 1, 0].max\n end", "def reset_password_reset_page_access_counter\n send(\n :\"#{sorcery_config.reset_password_page_access_count_attr_name}=\", 0\n )\n sorcery_adapter.save\n end", "def each_invalid_attempt(&block)\n invalid_attempts.each(&block)\n end", "def each_ungraded_attempt(&block)\n ungraded_attempts.each(&block) \n end", "def clear_auth_count\n @auth_count = 0\n end", "def failed_users_count\n return @failed_users_count\n end", "def lock_timeout_retry_delay; end", "def ungraded_attempts\n @attempts.select { |x| x.ungraded? }\n end", "def rate_site\n self.accessed_attempts += 1\n self.save\n end", "def snooze(attempts)\n if attempts >= RETRY_MAX_ATTEMPTS\n logger.debug(\"Exceeded retry limit of #{RETRY_MAX_ATTEMPTS}.\")\n false\n else\n sleep(RETRY_DELAY * RETRY_DELAY_FACTOR)\n true\n end\n end", "def relock_every\n @relock_every ||= 5\n end", "def feature_reset_login_attempt!\n Rack::Attack.cache.store.clear\n page.reset!\n end", "def attempts_for course\n exams.for_course(course).first(:order => \"attempt DESC\").attempt rescue 0\n end", "def reset_checks\n @check_count = 0\n end", "def invalid_credentials\n if user = User.active.find_by_login(params[:username].to_s)\n #increment brute-force counter\n set_brute_force_counter(user, get_brute_force_counter(user) + 1)\n #lock the user immediately if detecting a brute force attack\n if brute_forcing?(user)\n set_brute_force_lock_time(user, Time.now + LOCKED_FOR_MINUTES.minutes)\n user.update_attribute(:lock_comment, \"Locked at #{Time.now} after #{MAX_FAILED_ATTEMPTS} erroneous password\")\n user.lock!\n end\n end\n # original action\n super\n \n flash.now[:error] = l(:notice_account_invalid_credentials_or_locked) unless Rails.env == 'test'\n end", "def failed_tasks_count=(value)\n @failed_tasks_count = value\n end", "def ts_retry(attempts=1, &block)\n attempt = 0\n \n begin\n yield block\n rescue RSpec::Expectations::ExpectationNotMetError => e\n attempt += 1\n if attempt > attempts\n raise e\n else\n sleep 0.5\n retry\n end\n end\n end", "def login_failed!(error) \n update_attributes(:last_login_attempt_at => Time.now.utc, :auth_error => error)\n end", "def max_attempts_count\n @options[:max_attempts_count]\n end", "def retry_failed_payment\n pay_subscription.update(status: :active)\n end", "def redlock_retry_count(retry_delay=200, minimum_retry_count=3)\n if @lock_timeout < 1000\n retry_count = @lock_timeout / retry_delay\n else\n retry_count = @lock_timeout / 1000 / retry_delay\n end\n return retry_count unless retry_count < minimum_retry_count\n minimum_retry_count\n end", "def backoff_duration\n @retry_time = Time.now + (@failed_attempts**2)\n end", "def with_retries(retries)\n @retries = retries unless retries.nil?\n self\n end", "def reset_flag_count\n Flag.create(memory_id: self.id, user_id: user.id, message: \"Flagcount Reset by administrator #{user.username}\")\n self.flagcount = 0\n self.save\n end", "def max_retries\n MAX_RETRIES + (@invalid_signature_error && @invalid_path_error ? 1 : 0)\n end", "def retry!\n queue.repush(trx_id)\n rcache.lrem(queue.retries_cache_key, 0, trx_id)\n end", "def attempting_times_left\n @times_left ||= begin\n return MAX_ATTEMPTING_TIMES unless question.actable.attempt_limit\n\n times = question.actable.attempt_limit - submission.evaluated_or_graded_answers(question).size\n times = 0 if times < 0\n times\n end\n end", "def update_success\n @last_failed = false\n @retries = 0\n true\n end", "def retry\n super\n end", "def reset_counter!\n return if counter == 0\n sql(:execute, %(\n INSERT INTO knifeswitch_counters (name,counter)\n VALUES (?, 0)\n ON DUPLICATE KEY UPDATE counter=0\n ), namespace)\n end", "def phone_step_attempts\n RateLimiter.new(user: @current_user, rate_limit_type: :proof_address).attempts\n end" ]
[ "0.7854558", "0.7479693", "0.7394463", "0.7394463", "0.72980964", "0.71478295", "0.6984194", "0.6980547", "0.68087995", "0.6750678", "0.6731796", "0.6731796", "0.6730841", "0.6730841", "0.6730841", "0.66374046", "0.6555383", "0.6396938", "0.63898975", "0.6370926", "0.6356035", "0.634887", "0.6338481", "0.6304945", "0.62982684", "0.62737536", "0.6224922", "0.6111561", "0.6105757", "0.605", "0.6018494", "0.6018012", "0.5928345", "0.5928345", "0.59203464", "0.59203464", "0.59027874", "0.5895381", "0.58903134", "0.58816624", "0.58770853", "0.5864706", "0.5841982", "0.58411765", "0.5838499", "0.58382833", "0.5826437", "0.5806035", "0.5778829", "0.57647073", "0.57597375", "0.5750663", "0.57378405", "0.5720701", "0.570091", "0.56821924", "0.56780076", "0.5675963", "0.5648475", "0.5633456", "0.5629154", "0.56261003", "0.5615525", "0.5615525", "0.5615525", "0.5615525", "0.5615525", "0.5615525", "0.5615525", "0.56067705", "0.5602465", "0.5582916", "0.5576251", "0.55745554", "0.55632114", "0.555435", "0.55446035", "0.5540935", "0.5529096", "0.5523901", "0.5501598", "0.5494818", "0.5494373", "0.54824495", "0.54639345", "0.5461205", "0.5458493", "0.54567707", "0.5439766", "0.5433267", "0.54332584", "0.54314506", "0.54300123", "0.5428194", "0.5428134", "0.5415402", "0.54139316", "0.5410896", "0.5383936", "0.5383597" ]
0.8001293
0
Send unlock instructions by email source://devise//lib/devise/models/lockable.rb74
def send_unlock_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_unlock_instructions\n raw, enc = Devise.token_generator.generate(self.class, :unlock_token)\n self.unlock_token = enc\n save(validate: false)\n send_devise_notification(:unlock_instructions, raw, {})\n raw\n end", "def unlock_instructions\n \tCustomMailer.unlock_instructions\n end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def resend_unlock_instructions; end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def unlock_instructions(record, token, opts={})\n MnoEnterprise::MailClient.deliver('unlock-instructions',\n default_sender,\n recipient(record),\n user_vars(record).merge(unlock_link: user_unlock_url(unlock_token: token))\n )\n end", "def resend_unlock_instructions\n if_access_locked { send_unlock_instructions }\n end", "def unlock\n @publication = Publication.find(params[:id])\n @publication.lock!\n @publication.unlock!\n flash[:notice] = \"Previously rejected publication accepted as preplanned.\"\n # flash[:notice] = \"Previously rejected publication accepted as preplanned. Email sent to the author.\"\n # @email = Email.find_by_trigger('unlock') \n # Notifier.workflow_notification(@publication.user,@email,@publication).deliver\n redirect_to publication_url \n end", "def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end", "def send_unlock_instructions(attributes = T.unsafe(nil)); end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def login_unlock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => nil,\n config.failed_logins_count_attr_name => 0,\n config.unlock_token_attr_name => nil\n }\n sorcery_orm_adapter.update_attributes(attributes)\n end", "def notify_unlocked\n ::Notification.create!(\n from: user,\n user_id: user_id,\n seen: false,\n target: self,\n kind: :ACHIEVEMENT_UNLOCKED\n )\n end", "def unlock\n end", "def unlock_answer\n\t\t@problem = current_problem\n\t\tif !current_user.unlock_answer_of(@problem).nil?\n\t\t\tcurrent_user.notifications.create!(message:\"Answer of \" + view_context.link_to( @problem.title, problem_path(@problem) ) + \" was unlocked. #{COST_TO_UNLOCK_ANSWER} gold were deducted from your account balance.\")\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js\n\t\t\t\tformat.html { flash[:success] = \"You successfully unlocked the answer of this problem.\" \n\t\t\t\t\t\t\t\t\t\t\tredirect_to problem_path(@problem) }\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.js { flash.now[:danger] = \"There was a problem. The answer was not unlocked.\" }\n\t\t\t\tformat.html { flash[:danger] = \"There was a problem. The answer was not unlocked.\" \n\t\t\t\t\t\t\t\t\t\t\tredirect_to problem_path(@problem) }\n\t\t\tend\n\t\tend\n\tend", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def mgmt_lock\n @dailybank.update_attribute(:status, \"Locked\")\n redirect_to @dailybank, notice: \"Thank you for reviewing End of Night. This record is now locked\"\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock_access_by_token(unlock_token); end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock\n self.is_locked = false\n self\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock\n if job\n job.report_running if report_job_status\n job.set_status(\"Unlocking #{to_s}\")\n end\n\n attempt_unlock\n\n report(true)\n end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end", "def password_block_fingerprint_unlock=(value)\n @password_block_fingerprint_unlock = value\n end", "def password_block_fingerprint_unlock=(value)\n @password_block_fingerprint_unlock = value\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def block_if_on_hold\n raise \"Account is currently on hold. Messaging is disabled.\" if current_account.on_hold?\n end", "def send_reset_password_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def reset_password\n [send_email(MailPart.new_subject(I18n.t('devise.mailer.reset_password_instructions.subject')),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:reset_password],\n reset_pass_call),\n @candidate_mailer_text.token]\n end", "def lock_task\n task = MailTasks::Task.find( params[:id] )\n task.update_attribute( :disabled, true )\n flash[:notice] = \"Task \\\"#{task.name}\\\" has been locked!\"\n redirect_to :action => \"index\"\n end", "def unlockable?(resource)\n \tresource.respond_to?(:unlock_access!) &&\n \tresource.respond_to?(:unlock_strategy_enabled?) &&\n \tresource.unlock_strategy_enabled?(:email)\n\tend", "def result_unlock\n\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlock\n locksmith.unlock # Only signal to release the lock\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end", "def password_require_to_unlock_from_idle\n return @password_require_to_unlock_from_idle\n end", "def reset_password_instructions(user, token, commit)\n @resource = user\n @token = token\n mail(:to => @resource.email, :subject => \"Reset password instructions\", :tag => 'password-reset', :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n mail.delivery_method.settings.merge! @@smtp_settings\n mail\n end", "def unlock\n #@locked = false\n `caffeinate -u -t 2`\n `osascript -e 'delay 1' -e 'tell application \"System Events\"' -e 'keystroke return' -e 'keystroke \"#{ENV[\"MYPASS\"]}\"' -e 'delay 1' -e 'keystroke return' -e 'end tell'`\nend", "def password_require_to_unlock_from_idle=(value)\n @password_require_to_unlock_from_idle = value\n end", "def leave_revoked_email_4cm(request, user, manager)\n @user = user\n mail( :to => @request.user.manager.email,\n :subject => 'User has revoked leave request' )\n end", "def async_unlock(environment)\n job = Job.new(:unlock)\n async(:unlock, job, environment)\n job.ticket\n end", "def passcode_block_fingerprint_unlock=(value)\n @passcode_block_fingerprint_unlock = value\n end", "def unlock_access_by_token(unlock_token)\n original_token = unlock_token\n unlock_token = Devise.token_generator.digest(self, :unlock_token, unlock_token)\n\n lockable = find_or_initialize_with_error_by(:unlock_token, unlock_token)\n lockable.unlock_access! if lockable.persisted?\n lockable.unlock_token = original_token\n lockable\n end", "def reset_password_instructions(user)\n @resource = user\n mail(:to => @resource.email,\n :subject => \"Reset password instructions\",\n :tag => 'password-reset',\n :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n end", "def force_unlock(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::ForceUnlock,\n parameters, invocation_options)\n end", "def send_reset_password_instructions(user, mission: nil)\n # Only send intro if user has never logged in. Else send password reset email.\n user.reset_perishable_token!\n if (user.login_count || 0).positive?\n Notifier.password_reset_instructions(user, mission: mission).deliver_now\n else\n Notifier.intro(user, mission: mission).deliver_now\n end\n end", "def leave_revoked_email_4cm(request, user, counsellor)\n @user = user\n mail( :to => @request.user.counsellor.email,\n :subject => 'User has revoked leave request' )\n end", "def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end", "def unlock\n if unlocked_status == true\n raise ArgumentError.new(\"The door is already unlocked!\")\n else\n door_hash[:unlocked_status] = true\n end\n end", "def send_reset_password_instructions; end", "def unlock\n @locking = false\n end", "def leave_revoked_email_4cm(request, user)\n @user = user\n @request = request\n mail(\n to: @request.user.manager.email,\n subject: 'User has revoked leave request'\n )\n end", "def unlock!(certifier)\n return false unless self.locked? # gotta be locked\n# return false unless self.certified_at.nil? # can't already be certified\n return false unless self.certifier_id == certifier.id # gotta be the currently active user\n\n return self.update_attributes!(:locked => false, :certifier_id => nil)\n end", "def password_reset\n user = Investor.first\n user.activation_token = Investor.new_token\n NemabollonMailer.password_reset(user)\n end", "def walletlock\n @api.request 'walletlock'\n end", "def deliver_reset_password_instructions!\n mail = false\n config = sorcery_config\n # hammering protection\n return false if config.reset_password_time_between_emails.present? && send(config.reset_password_email_sent_at_attribute_name) && send(config.reset_password_email_sent_at_attribute_name) > config.reset_password_time_between_emails.seconds.ago.utc\n\n self.class.sorcery_adapter.transaction do\n generate_reset_password_token!\n mail = send_reset_password_email! unless config.reset_password_mailer_disabled\n end\n mail\n end", "def successful_ballot(user, round, allocation)\n @round = round\n @locker = allocation.locker\n @user = user\n mail(to: user.email, reply_to: '[email protected]', subject: '[Locker Ballot] Locker Ballot Successful') if user.email\n end", "def password_reset\n ClientMailer.password_reset\n end", "def password_reset\n UserMailMailer.password_reset\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def review_locked(review)\n# @review = review\n#\n# mc = BackgroundConfigHandler.instance.model_config\n# @review.review_locking.reason = mc['REVIEW']['PREDEFINED_LOCKING_REASONS'][4]\n#\n# \n# @review_type = I18n.translate(\"mailers.frontend.review_mailer.review_type.review\")\n# if @review.is_comment\n# @review_type = I18n.translate(\"mailers.frontend.review_mailer.review_type.comment\")\n# end\n# @user = review.frontend_user\n# @item = review.destination\n# @item_type = I18n.translate(\"mailers.frontend.review_mailer.destination.#{@item.class.name}\")\n# @item_name = @item.name\n# @item_name = @item.full_name if @item.respond_to?('full_name')\n# @domain_name = domain_name\n# mail({\n# :to => @user.email,\n# :from => \"Noreply <noreply@#{@domain_name}>\",\n# :reply_to => \"Noreply <noreply@#{@domain_name}>\",\n# :subject => I18n.translate('mailers.frontend.review_mailer.review_locked.subject',\n# {:review_type => @review_type, :domain_name => domain_name})\n# })\n end", "def send_forget_passwd_email(email, user, token)\n @user = user\n @token = token\n mail( :to => email,\n :subject => 'WatchIoT password reset!!')\n end", "def lock_expired?; end", "def leave_revoked_email_4cm(request, user)\n @user = user\n @request = request\n mail(\n to: @request.user.counsellor.email,\n subject: 'User has revoked leave request'\n )\n end", "def unlock(*args, &block)\n map_method(:unlock, args, &block)\n end", "def work_profile_password_block_fingerprint_unlock=(value)\n @work_profile_password_block_fingerprint_unlock = value\n end", "def check_unlock\n if params[:slug] != 'max_activities'\n return json_error \"At this time, a user can only unlock for 'max_activities'.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n payload = { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n\n payload[:highest_level_reached] = true if unlocker.highest_level?\n\n render json: payload \n end", "def send_reset_password_instructions\n end", "def run_action_unlock(item)\n item = validate_item(item)\n ui.print \" Unlocking #{ui.color(item, :bold)}... \"\n content = load_json(File.read(item)).to_smash\n if content[:sfn_parameters_lock]\n content = unlock_content(content)\n content.delete(:sfn_lock_enabled)\n File.write(item, format_json(content))\n ui.puts ui.color(\"unlocked\", :green)\n else\n ui.puts ui.color(\"no-op\", :yellow)\n ui.warn \"Item is already unlocked! (#{item})\"\n end\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def send_activation_or_reset_mail\n end", "def password_reset(user)\n mail_to user, password_reset_subject\n end", "def password_reset\n MailerMailer.password_reset\n end", "def inactive_message\n access_locked? ? :locked : super\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def perform_unlock\n allowed_unlocks = %w(unlocked_five_activities unlocked_ten_activities unlocked_fifty_activities)\n\n unless allowed_unlocks.include?(params[:slug])\n return json_error \"An invalid slug was specified. Only #{allowed_unlocks.join(', ')} are allowed.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n unlock_event = unlocker.unlock!(params[:slug])\n \n if unlock_event\n render json: { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n else\n return json_error unlocker.errors.join(' ')\n end\n end", "def unsuccessful_ballot(user, round)\n @user = user\n @round = round\n mail(to: user.email, reply_to: '[email protected]', subject: '[Locker Ballot] Locker Ballot Unsuccessful') if user.email\n end", "def passcode_block_fingerprint_unlock\n return @passcode_block_fingerprint_unlock\n end", "def password_reset\n @greeting = \"Hi\"\n\n mail to: \"[email protected]\"\n end", "def unlock_access!; end", "def work_profile_password_block_fingerprint_unlock\n return @work_profile_password_block_fingerprint_unlock\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset(band)\n @band = band\n mail to: band.email, subject: \"LiveJive - Password Reset\"\n end", "def password_reset(user, share_id)\n @user = user\n @share_id = share_id\n mail :to => user.email, :subject => \"Landing International: Password Set/Reset\"\n end", "def password_reset\n #@greeting = \"Pershendetje\"\n\n #mail to: \"[email protected]\"\n end", "def deliver_reset_password_instructions!\n mail = false\n config = sorcery_config\n # hammering protection\n if config.reset_password_time_between_emails.present? && send(config.reset_password_email_sent_at_attr_name) && send(config.reset_password_email_sent_at_attr_name) > config.reset_password_time_between_emails.seconds.ago.utc\n return false\n end\n\n self.class.sorcery_adapter.transaction do\n generate_reset_password_token!\n unless config.reset_password_mailer_disabled\n mail = send_reset_password_email!\n end\n end\n mail\n end", "def reset_password_instructions(token, resource)\n @token = token\n @resource = resource\n mail to: @resource, subject: \"Reset your password\"\n end" ]
[ "0.8082701", "0.78003854", "0.76170504", "0.7284988", "0.7198142", "0.7192589", "0.695932", "0.6722382", "0.6559174", "0.64313847", "0.6270977", "0.62529755", "0.6222066", "0.6194345", "0.6173709", "0.61288863", "0.60772896", "0.60691726", "0.60680836", "0.6067145", "0.6065919", "0.60571843", "0.6045433", "0.60209835", "0.5996476", "0.596155", "0.59541714", "0.5939341", "0.5939341", "0.59306926", "0.59119964", "0.59119964", "0.5900801", "0.58923984", "0.5891237", "0.58900076", "0.588748", "0.5881324", "0.5876601", "0.5871499", "0.58682334", "0.58682334", "0.5865619", "0.58580816", "0.58580816", "0.5836058", "0.5834553", "0.5833257", "0.5827471", "0.58084834", "0.5797561", "0.57875055", "0.5787022", "0.5730825", "0.5726035", "0.57084936", "0.5705737", "0.5697859", "0.5694374", "0.5688939", "0.5676422", "0.5676021", "0.56723297", "0.56568605", "0.5648518", "0.5648319", "0.56431466", "0.5639726", "0.56394833", "0.56391615", "0.5635101", "0.5632658", "0.56316406", "0.56279737", "0.5623309", "0.56137466", "0.56073695", "0.5605763", "0.5605418", "0.5602796", "0.5599637", "0.55996114", "0.5592161", "0.55870485", "0.5584345", "0.5584193", "0.5577469", "0.557711", "0.5555276", "0.55431324", "0.5540989", "0.5533182", "0.5531127", "0.5531127", "0.5531127", "0.55279905", "0.5519985", "0.55150473", "0.5513789", "0.55119765" ]
0.82689744
0
Unlock a user by cleaning locked_at and failed_attempts. source://devise//lib/devise/models/lockable.rb53
def unlock_access!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def unlock\n self.locked_at = nil\n self.locked_by = nil\n end", "def login_unlock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => nil,\n config.failed_logins_count_attr_name => 0,\n config.unlock_token_attr_name => nil\n }\n sorcery_orm_adapter.update_attributes(attributes)\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock\n self.is_locked = false\n self\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock(params = {})\n params ||= {}\n params[:id] = @attributes[:id]\n raise MissingParameterError.new(\"Current object doesn't have a id\") unless @attributes[:id]\n raise InvalidParameterError.new(\"Bad parameter: id must be an Integer\") if params[:id] and !params[:id].is_a?(Integer)\n raise MissingParameterError.new(\"Parameter missing: id\") unless params[:id]\n\n Api.send_request(\"/users/#{@attributes[:id]}/unlock\", :post, params, @options)\n end", "def unlock\n @locking = false\n end", "def unlock\n if job\n job.report_running if report_job_status\n job.set_status(\"Unlocking #{to_s}\")\n end\n\n attempt_unlock\n\n report(true)\n end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlocks_from_user_data(user_data)\n raise NotImplementedError\n end", "def unlock\n FileUtils.rm(lock_file) if File.exist?(lock_file)\n reset!\n end", "def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end", "def personal_unlockAccount(account, passphrase, duration)\r\n response = do_request(\"personal_unlockAccount\",[account, passphrase, duration])\r\n response[\"result\"]\r\n end", "def unlock_access_by_token(unlock_token)\n original_token = unlock_token\n unlock_token = Devise.token_generator.digest(self, :unlock_token, unlock_token)\n\n lockable = find_or_initialize_with_error_by(:unlock_token, unlock_token)\n lockable.unlock_access! if lockable.persisted?\n lockable.unlock_token = original_token\n lockable\n end", "def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end", "def unlock\n locksmith.unlock # Only signal to release the lock\n end", "def force_unlock(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::ForceUnlock,\n parameters, invocation_options)\n end", "def resend_unlock_instructions\n if_access_locked { send_unlock_instructions }\n end", "def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end", "def unlock_access_by_token(unlock_token); end", "def lock_to!(user)\n update_columns(locked_at: Time.current, locked_by: user.id)\n end", "def unlock\n if @unlocked == true\n raise ExceptionError.new(\"An unlocked door needith not be unlocked\")\n else\n return @unlocked = true\n end\n end", "def unlock_all\n Delayed::Job.transaction do\n Delayed::Job.where(:locked_by => hostname).update_all(:locked_by => nil, :locked_at => nil)\n end\n end", "def unlock(*args, &block)\n map_method(:unlock, args, &block)\n end", "def unlock\n if unlocked_status == true\n raise ArgumentError.new(\"The door is already unlocked!\")\n else\n door_hash[:unlocked_status] = true\n end\n end", "def unlock\n end", "def unlock_user(id, opts = {})\n data, _status_code, _headers = unlock_user_with_http_info(id, opts)\n data\n end", "def run_action_unlock(item)\n item = validate_item(item)\n ui.print \" Unlocking #{ui.color(item, :bold)}... \"\n content = load_json(File.read(item)).to_smash\n if content[:sfn_parameters_lock]\n content = unlock_content(content)\n content.delete(:sfn_lock_enabled)\n File.write(item, format_json(content))\n ui.puts ui.color(\"unlocked\", :green)\n else\n ui.puts ui.color(\"no-op\", :yellow)\n ui.warn \"Item is already unlocked! (#{item})\"\n end\n end", "def unlock\n @mutex.unlock\n end", "def unlock!(certifier)\n return false unless self.locked? # gotta be locked\n# return false unless self.certified_at.nil? # can't already be certified\n return false unless self.certifier_id == certifier.id # gotta be the currently active user\n\n return self.update_attributes!(:locked => false, :certifier_id => nil)\n end", "def unlock_all!\n locks.active.each(&:unlock!)\n end", "def toggle_locking(current_user)\n if can_toggle_locking?(current_user)\n is_locked? ? unlock : lock(current_user.id) # TODO: raise exception or report error here?\n end\n end", "def perform_unlock\n allowed_unlocks = %w(unlocked_five_activities unlocked_ten_activities unlocked_fifty_activities)\n\n unless allowed_unlocks.include?(params[:slug])\n return json_error \"An invalid slug was specified. Only #{allowed_unlocks.join(', ')} are allowed.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n unlock_event = unlocker.unlock!(params[:slug])\n \n if unlock_event\n render json: { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n else\n return json_error unlocker.errors.join(' ')\n end\n end", "def send_unlock_instructions\n raw, enc = Devise.token_generator.generate(self.class, :unlock_token)\n self.unlock_token = enc\n save(validate: false)\n send_devise_notification(:unlock_instructions, raw, {})\n raw\n end", "def resend_unlock_instructions; end", "def account_locked\n @user = User.find(params[:id])\n end", "def unlock_user_v2(user_id, opts = {})\n unlock_user_v2_with_http_info(user_id, opts)\n nil\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def unlock(secret)\n secret.locked = false\n secret.unlocked_value = YAML.load(security.decrypt(secret.value))\n secret\n end", "def result_unlock\n\n end", "def unlock\n\t\t\treturn unless @locked\n\t\t\tif @nested_locks > 0\n\t\t\t\t@nested_locks -= 1\n\t\t\telse\n\t\t\t\tThread.critical = true\n\t\t\t\t@locked = false\n\t\t\t\tbegin\n\t\t\t\t\tt = @waiting.pop\n\t\t\t\t\tt.wakeup if t\n\t\t\t\trescue ThreadError\n\t\t\t\t\tretry\n\t\t\t\tend\n\t\t\t\tThread.critical = false\n\t\t\t\tbegin\n\t\t\t\t\tt.run if t\n\t\t\t\trescue ThreadError\n\t\t\t\tend\n\t\t\tend\n\t\t\tself\n\t\tend", "def unlock(obj)\n logger\n if locked?(obj)\n RedisMutexer.config.redis.del(key(obj))\n end\n end", "def unblock\n current_user.unblock_user(@user.id)\n render json: {ok: 1}\n end", "def invalid_credentials\n if user = User.active.find_by_login(params[:username].to_s)\n #increment brute-force counter\n set_brute_force_counter(user, get_brute_force_counter(user) + 1)\n #lock the user immediately if detecting a brute force attack\n if brute_forcing?(user)\n set_brute_force_lock_time(user, Time.now + LOCKED_FOR_MINUTES.minutes)\n user.update_attribute(:lock_comment, \"Locked at #{Time.now} after #{MAX_FAILED_ATTEMPTS} erroneous password\")\n user.lock!\n end\n end\n # original action\n super\n \n flash.now[:error] = l(:notice_account_invalid_credentials_or_locked) unless Rails.env == 'test'\n end", "def unban!\n MTurkUtils.unban_user self\n end", "def systemusers_unlock(id, opts = {})\n systemusers_unlock_with_http_info(id, opts)\n return nil\n end", "def unlock!\n if @locked\n cleanup_lock_file!\n @locked = false\n true\n end\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def unblock_user\n current_user.unblock_user!(params[:user_id])\n redirect_to :back, notice: \"#{User.find(params[:user_id]).full_name(false)} has been successfully unblocked\"\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock\n if @locking\n @locking_file.close\n end\n end", "def unlock\n @publication = Publication.find(params[:id])\n @publication.lock!\n @publication.unlock!\n flash[:notice] = \"Previously rejected publication accepted as preplanned.\"\n # flash[:notice] = \"Previously rejected publication accepted as preplanned. Email sent to the author.\"\n # @email = Email.find_by_trigger('unlock') \n # Notifier.workflow_notification(@publication.user,@email,@publication).deliver\n redirect_to publication_url \n end", "def unlock!\n if (lock_expire = @lock_expire) && owner_ident == (lock_full_ident = @locked_owner_id)\n @locked_owner_id = @lock_expire = nil\n removed = eval_safe(@eval_unlock, @ns_names, [lock_full_ident, SIGNAL_QUEUE_CHANNEL, @marsh_names])\n end\n return removed == @ns_names.length && self\n end", "def can_unlock?(current_user)\n return false if current_user.anonymous?\n\n is_locked? and not is_locked_by_other?(current_user)\n end", "def password_require_to_unlock_from_idle=(value)\n @password_require_to_unlock_from_idle = value\n end", "def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end", "def unlock_all\n update_all('$set': { locking_name_field => nil, locked_at_field => nil }).modified_count\n end", "def unlock\n load_resource\n resource_instance_variable.unlock\n flash[:notice] = t(\"unlocked_page\", :name => resource_instance_variable.name)\n @contentables_locked_by_user = resource_handler.model.all_locked_by(current_user)\n respond_to do |format|\n format.js\n format.html {\n redirect_to params[:redirect_to].blank? ? resource_url_scope.send(\"admin_#{resource_handler.resources_name}_path\") : params[:redirect_to]\n }\n end\n end", "def unlock_database\n unlock_command = <<-EOS\n echo 'use admin\n db.$cmd.sys.unlock.findOne()' | #{mongo_shell}\n EOS\n\n run(unlock_command)\n end", "def unlock\n #@locked = false\n `caffeinate -u -t 2`\n `osascript -e 'delay 1' -e 'tell application \"System Events\"' -e 'keystroke return' -e 'keystroke \"#{ENV[\"MYPASS\"]}\"' -e 'delay 1' -e 'keystroke return' -e 'end tell'`\nend", "def unlock; end", "def lock_expired?; end", "def abandon!\n @user = nil\n session.delete\n end", "def abandon!\n @user = nil\n session.delete\n end", "def send_unlock_instructions; end", "def unlock_user_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserApi.unlock_user ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling UserApi.unlock_user\"\n end\n # resource path\n local_var_path = '/api/3/users/{id}/lock'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Links')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserApi#unlock_user\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def abandon!\n authentication.abandon!\n end", "def unblock_user\n SecurityService.unblock_user(params[:id])\n redirect_to '/users/', notice: \"Käyttäjän blokkaus poistettu. Hän voi taas luoda kursseja.\"\n end", "def unlock_database\n unlock_command = <<-EOS.gsub(/^ +/, ' ')\n echo 'use admin\n db.$cmd.sys.unlock.findOne()' | #{ \"#{ mongo_utility } #{ mongo_uri }\" }\n EOS\n\n run(unlock_command)\n end", "def unlock(_uri, lock_info)\n locks = data\n locks.each_with_index do |lock, k|\n next unless lock.token == lock_info.token\n locks.delete_at(k)\n put_data(locks)\n return true\n end\n\n false\n end", "def password_require_to_unlock_from_idle\n return @password_require_to_unlock_from_idle\n end", "def async_unlock(environment)\n job = Job.new(:unlock)\n async(:unlock, job, environment)\n job.ticket\n end", "def destroy\n @unlockable = Unlockable.find(params[:id])\n @unlockable.destroy\n\n respond_to do |format|\n format.html { redirect_to unlockables_url }\n format.json { head :no_content }\n end\n end", "def unlock_user_v2_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.unlock_user_v2 ...'\n end\n # verify the required parameter 'user_id' is set\n if @api_client.config.client_side_validation && user_id.nil?\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.unlock_user_v2\"\n end\n # resource path\n local_var_path = '/v2/users/{userId}/unlock'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :operation => :\"UsersApi.unlock_user_v2\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#unlock_user_v2\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def unlock!(key)\n ::DatabaseEntryLock.destroy_by(lock_key: key)\n end", "def unlock(job_id)\n locked.del(job_id)\n end", "def unlock\n unlock!\n self\n end", "def test_entry_unlock\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n new_user.unlock(\"fake_pass\")\n\n new_entry.lock_password(new_user, \"password1234\")\n\n decrypted_password = new_entry.unlock_password(new_user)\n assert decrypted_password == \"password1234\"\n end", "def exclusive_unlock\n\t\t\treturn unless @locked\n\t\t\tif @nested_locks > 0\n\t\t\t\t@nested_locks -= 1\n\t\t\telse\n\t\t\t\tThread.exclusive do\n\t\t\t\t\t@locked = false\n\t\t\t\t\tbegin\n\t\t\t\t\t\tt = @waiting.pop\n\t\t\t\t\t\tt.wakeup if t\n\t\t\t\t\trescue ThreadError\n\t\t\t\t\t\tretry\n\t\t\t\t\tend\n\t\t\t\t\tyield\n\t\t\t\tend\n\t\t\tend\n\t\t\tself\n\t\tend", "def unlock!\n if update_columns(locked_at: nil, locked_by: nil)\n Page.current_preview = nil\n end\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def suspend_user(user, row, disable_email = false)\n if row[:user_inactive_reason] == Constants::INACTIVE_MANUAL\n user.suspended_at = Time.now\n user.suspended_till = 200.years.from_now\n ban_reason = row[:ban_reason].blank? ? 'Account deactivated by administrator' : row[:ban_reason] # TODO i18n\n elsif row[:ban_start].present?\n user.suspended_at = Time.zone.at(row[:ban_start])\n user.suspended_till = row[:ban_end] > 0 ? Time.zone.at(row[:ban_end]) : 200.years.from_now\n ban_reason = row[:ban_reason]\n else\n return\n end\n\n if disable_email\n user_option = user.user_option\n user_option.email_digests = false\n user_option.email_level = UserOption.email_level_types[:never]\n user_option.email_messages_level = UserOption.email_level_types[:never]\n user_option.save!\n end\n\n if user.save\n StaffActionLogger.new(Discourse.system_user).log_user_suspend(user, ban_reason)\n else\n Rails.logger.error(\"Failed to suspend user #{user.username}. #{user.errors.try(:full_messages).try(:inspect)}\")\n end\n end", "def unblock_user(user_id)\n post(\"/users/#{user_id}/unblock\")\n end", "def abandon!\n @user = nil\n session.clear\n end", "def test_locked_user\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n\n assert_raises(EntryCrypto::LockedError) { new_entry.lock_password(new_user, \"password1234\") }\n end", "def unlock\n return unless @locking\n\n @locking_file.close\n\n return unless File.exist?('/var/tmp/vcenter-importer-lock')\n\n File.delete('/var/tmp/vcenter-importer-lock')\n end", "def locked_out=(value)\n @locked_out = value\n end", "def user_log_out\n forget_user(current_user)\n session.delete(:user_id)\n @current_user = nil\n end" ]
[ "0.76837045", "0.76405615", "0.7426431", "0.7382308", "0.7205037", "0.717193", "0.7063525", "0.70594573", "0.7058884", "0.7049488", "0.7030608", "0.69960225", "0.6958211", "0.68289536", "0.6689347", "0.6499978", "0.64320314", "0.6411134", "0.6408531", "0.6401849", "0.6356227", "0.63406163", "0.6312182", "0.6288253", "0.6258593", "0.6254761", "0.6227617", "0.6200937", "0.6156499", "0.61476463", "0.61289126", "0.61120194", "0.6101715", "0.60946965", "0.608089", "0.6065685", "0.6028683", "0.60174054", "0.6015543", "0.5953658", "0.594287", "0.5933466", "0.5922033", "0.5917154", "0.59089184", "0.59010875", "0.58765465", "0.58676744", "0.5851529", "0.5845614", "0.5811863", "0.58111674", "0.57787174", "0.5763344", "0.57585835", "0.57513463", "0.5748269", "0.573531", "0.5733566", "0.5715408", "0.57113695", "0.57113695", "0.5692624", "0.56893545", "0.5682267", "0.5680858", "0.5673929", "0.5654845", "0.56368226", "0.563186", "0.5619757", "0.5617184", "0.5600285", "0.5598024", "0.5598024", "0.5597589", "0.5583352", "0.55731493", "0.5569102", "0.55632603", "0.5556139", "0.5551438", "0.5534451", "0.55223835", "0.5518717", "0.55176246", "0.55105436", "0.55085707", "0.5506529", "0.5505349", "0.55041397", "0.5503096", "0.5503096", "0.5499324", "0.54800206", "0.5479684", "0.5448639", "0.54373467", "0.5428368", "0.54262364" ]
0.6250486
26
Overwrites valid_for_authentication? from Devise::Models::Authenticatable for verifying whether a user is allowed to sign in or not. If the user is locked, it should never be allowed.
def valid_for_authentication?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_for_authentication?\n return super unless persisted? && lock_strategy_enabled?(:failed_attempts)\n\n # Unlock the user if the lock is expired, no matter\n # if the user can login or not (wrong password, etc)\n unlock_access! if lock_expired?\n\n if super && !access_locked?\n true\n else\n increment_failed_attempts\n if attempts_exceeded?\n lock_access! unless access_locked?\n else\n save(validate: false)\n end\n false\n end\n end", "def active_for_authentication?\n super and self.locked != 1\n end", "def active_for_authentication?\n super && !access_locked?\n end", "def active_for_authentication?\n super && self.enabled? && self.is_allowed_in?\n end", "def active_for_authentication?\n super && un_blocked?\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !self.blocked\n end", "def active_for_authentication?\n super && !banned?\n end", "def active_for_authentication?\n super && !banned\n end", "def active_for_authentication?\n super && !disabled\n end", "def active_for_authentication?\n super && !disabled?\n end", "def active_for_authentication?\n super and !self.disabled?\n end", "def active_for_authentication?\n super && !disabled?\n end", "def active_for_authentication?\n super && !self.is_disabled\n end", "def active_for_authentication?\n super and self.enabled?\n end", "def valid_for_api_authentication?(password=nil)\n # the valid_for_authentication? method is defined in Devise's models/authenticatable.rb and overloaded in models/lockable.rb\n # passed block will only run if user is NOT locked out\n valid_for_authentication? do\n # check if password is correct\n valid_password?(password) \n end\n end", "def active_for_authentication?\n super\n end", "def active_for_authentication?\n super && is_active?\n end", "def active_for_authentication?\n active? && super\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && active?\n end", "def active_for_authentication?\n super && self.is_active?\n end", "def active_for_authentication?\n super && !expired?\n end", "def can_lock?(current_user)\n return false if current_user.anonymous?\n\n not is_locked?\n end", "def active_for_authentication?\n super && active\n end", "def active_for_authentication? \n super && (self.is_disabled == 0)\n end", "def active_for_authentication?\n super && isActive\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && !disabled_at\n end", "def authenticate_normal_user\n unless authenticate\n return false\n end\n logged_in_normal_user? ? true : access_denied\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication? \n super && approved? \n end", "def valid_for_authentication?\n block_given? ? yield : true\n end", "def resource_valid_for_authentication?\n @resource.respond_to?(:valid_for_authentication?) && @resource.valid_for_authentication? { valid_password? }\n end", "def authenticate_user?\n !current_user.nil?\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def can_log_in?\n !disabled\n end", "def active_for_authentication?\n super && !suspended_account\n end", "def active_for_authentication?\n super && account_active?\n end", "def active_for_authentication?\n !deactivated? && super\n end", "def can_login?\n\t\t\t!disabled? && !locked?\n end", "def active_for_authentication?\n super && self.active? # i.e. super && self.active\n end", "def active_for_authentication?\n super && !self.deactivated # i.e. super && self.is_active\n end", "def active_for_authentication?\n\t\tsuper && (self.is_active)\n\tend", "def active_for_authentication?\r\n super && active_status?\r\n end", "def active_for_authentication?\n super && !deleted_at && self.enabled?\n end", "def valid?\n return @valid if @valid != nil\n return true if self.user && self.user.valid_session?\n authenticate!\n end", "def active_for_authentication?\n super && bloqueado == 0\n end", "def active_for_authentication?\n super && assigned?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication?\n super && !deleted? && approved?\n end", "def active_for_authentication? \n super && (approved? || self.admin) \n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticate_user\n if current_user\n true\n else\n raise Exceptions::AuthorizationError.new('invalid user authorization')\n end\n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def authenticate\n deny_access unless signed_in?\n end", "def allow_login_as_specific_user?\n return self.class.allow_login_as_specific_user?\n end", "def active_for_authentication?\n super && self.approved?\n end", "def authenticated?\n valid? && !get_authenticated_user.nil?\n end", "def authenticate\n deny_access unless signed_in? \n end", "def authenticate\n deny_access unless loged_in?\n end", "def active_for_authentication? \n super && is_approved? \n end", "def authenticate\n logged_in? ? true : access_denied\n end", "def active_for_authentication?\n self.active?\n end", "def authenticate\n logged_in? || access_denied\n end", "def authenticate_user\n unauthorized unless current_user\n end", "def authenticate!\n current_user ? true : raise(Pundit::NotAuthorizedError)\n end", "def active_for_authentication?\n super && (!confirmation_required? || confirmed? || confirmation_period_valid?)\n end", "def authenticate_user!\n current_user.is_admin?\n end", "def authenticate\n logged_in? || access_denied\n end", "def active_for_authentication? \n \tsuper && approved?\n \t\n\tend", "def authenticate\n\tdeny_access unless signed_in?\n end", "def authenticate\n\t\tdeny_access unless signed_in?\n\tend", "def active_for_authentication?\n super and self.disponible?\n end", "def check_is_login_required\n authorized_denied unless logged_in?\n end", "def active_for_authentication?\n super && activation_status == true\nend", "def active_for_authentication?\n super && !self.deactivated_staff?\n end", "def signin_required\n if not protect?(action_name)\n return true\n end\n\n if @current_user and authorize?(@current_user)\n return true\n end\n\n # store current location so that we can \n # come back after the user logged in\n store_location\n \n # call overwriteable reaction to unauthorized access\n access_denied\n return false \n end", "def authenticate\n\t logged_in? ? true : access_denied\n\tend", "def authenticate_conditionally\n authenticate unless can? :be_anonymous, User\n end", "def is_valid?\n self.current_user && (self.user == self.current_user || self.current_user.admin?)\n end", "def check_authentication\n authenticate_user\n end", "def active_for_authentication?\n super && !deactivated_at\n end", "def active_for_authentication?\n super && !deactivated_at\n end" ]
[ "0.8005398", "0.76829314", "0.7611463", "0.758672", "0.742248", "0.7377067", "0.7377067", "0.7327706", "0.7258213", "0.7134176", "0.71149737", "0.7076105", "0.70472306", "0.7027316", "0.7019646", "0.6919002", "0.688687", "0.6885382", "0.68718314", "0.687119", "0.687119", "0.687119", "0.6869897", "0.68689877", "0.6864101", "0.6858617", "0.6856054", "0.6830034", "0.6752718", "0.6752718", "0.6752718", "0.6752718", "0.6752718", "0.6752718", "0.6752718", "0.6743776", "0.67421436", "0.6723726", "0.6707131", "0.66993725", "0.6698874", "0.6698681", "0.66924053", "0.6672562", "0.6667907", "0.66668504", "0.6656098", "0.664002", "0.6629085", "0.66066915", "0.6585435", "0.6583983", "0.657951", "0.65742517", "0.65618616", "0.6547737", "0.6545285", "0.6539175", "0.6539175", "0.65075564", "0.6501496", "0.6501496", "0.65008134", "0.64998204", "0.6498068", "0.6498068", "0.648675", "0.648675", "0.648675", "0.648675", "0.648675", "0.6486395", "0.647352", "0.6467291", "0.6459261", "0.6458226", "0.6449885", "0.6448521", "0.64404875", "0.6419947", "0.6416064", "0.63829696", "0.6382531", "0.6381142", "0.63434786", "0.6336414", "0.6334297", "0.63280714", "0.63188386", "0.6306184", "0.6305177", "0.6285206", "0.62809074", "0.62792295", "0.6277418", "0.62686986", "0.6264869", "0.6244751", "0.6244751" ]
0.64201576
80
Checks whether the record is locked or not, yielding to the block if it's locked, otherwise adds an error to email. source://devise//lib/devise/models/lockable.rb162
def if_access_locked; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def if_access_locked\n if access_locked?\n yield\n else\n self.errors.add(Devise.unlock_keys.first, :not_locked)\n false\n end\n end", "def with_lock_retries(*args, **kwargs, &block)\n if transaction_open?\n if enable_lock_retries?\n Gitlab::AppLogger.warn 'Lock retries already enabled, executing the block directly'\n yield\n else\n raise <<~EOF\n #{__callee__} can not be run inside an already open transaction\n\n Use migration-level lock retries instead, see https://docs.gitlab.com/ee/development/migration_style_guide.html#retry-mechanism-when-acquiring-database-locks\n EOF\n end\n else\n super(*args, **kwargs.merge(allow_savepoints: false), &block)\n end\n end", "def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end", "def with_lock\n lock!(true)\n yield\n ensure\n unlock!\n end", "def lock_expired?; end", "def locked_transaction(&block)\n unless connection.open_transactions.zero?\n raise \"locked_transaction cannot be called from within another transaction!\"\n end\n unsafe_locked_transaction do\n yield if block_given?\n end\n end", "def lock(&block)\n # TODO: only use replace strategy when server is executing the lock\n return call_strategy unless (locked_token = locksmith.lock(&block))\n\n locked_token\n end", "def handle_access(receiver)\n if locked?(receiver)\n log.error \"Queue #{receiver} is locked!\"\n else\n yield\n end\n end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def work\n stat :attempting_lock_on, item_id: object_id\n if @mutex.try_lock\n stat :has_lock_on, item_id: object_id\n chore\n stat :releasing_lock_on, item_id: object_id\n @mutex.unlock\n else\n stat :bailed_on, item_id: object_id\n end\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def sync( &block )\n LOCK.synchronize &block\n rescue ThreadError\n yield\n end", "def with_lock\n lock\n begin\n yield if block_given?\n ensure\n unlock\n end\n end", "def lock\n if block_given?\n raise 'Race condition' if locking?\n\n @locking = true\n yield\n return @locking = false\n end\n @locking = true\n end", "def try_lock\n end", "def block_if_on_hold\n raise \"Account is currently on hold. Messaging is disabled.\" if current_account.on_hold?\n end", "def check_lock\n if Aker::Set.find(resource_id).locked?\n return render json: { errors: [{ status: '422', title: 'Unprocessable entity', detail: 'Set is locked' }]}, status: :unprocessable_entity\n end\n end", "def return_lock\n\t\t@@logger.info { \"Returning the lock to the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => true).update(:locked => false) != 0\n\tend", "def is_locked?\n locked\n end", "def lock\n if @unlocked == false\n raise Exception.new(\"a locked door needith not to be locked\")\n else\n return @unlocked = false\n end\n end", "def locked?\n approved? or rejected?\n end", "def locked\n end", "def synchronize\n unless lock\n current_lock = read\n\n err = \"Resource #{current_lock['id']} locked by #{current_lock['client_name']}\"\n err << \" since #{current_lock['time']} (PID #{current_lock['process_id']})\"\n\n raise ResourceLocked.new(err)\n end\n\n yield\n\n unlock\n rescue => ex\n ex = ex.respond_to?(:cause) ? ex.cause : ex\n\n unless ex.is_a?(ResourceLocked)\n unlock if unlock_on_failure\n end\n\n abort(ex)\n end", "def locked?\n end", "def locked?\n self.is_locked\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def locked?\n locked_by.present? && locked_at.present? && locked_at > 10.minutes.ago\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def execute(&block)\n executed = locksmith.execute(&block)\n\n reflect(:execution_failed, item) unless executed\n end", "def locked?\n self.invoiced? && self.invoice.issued?\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def locked; end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def locked?\n raise NotImplementedError\n end", "def acquire_lock_on_failed_hooks\n hook_model_klass.lock_failed_hooks(@lock_identifier)\n end", "def block!\n self.update_attribute(:blocked, true)\n end", "def protected_yield\n if env[TIMER]\n timeout_protected_yield{ yield }\n else\n yield\n end\n rescue Exception => e\n mutex.synchronize do\n self.class.set_backtrace(e)\n if done? # log user callback error\n callback_error(e)\n else # IOError, SystemCallError, etc\n begin\n rejecting(e) # would call user callback\n rescue Exception => f # log user callback error\n callback_error(f){ self.class.set_backtrace(f) }\n end\n end\n end\n end", "def lock\n # Flush everything to start with a clean state\n # and to protect the @locked variable\n flush\n\n with_flock(File::LOCK_EX) do\n replay\n result = yield\n flush\n result\n end\n end", "def user_is_not_blocked\n return errors.add(:user, 'You cannot block yourself')\\\n if user_id == blocked_id\n end", "def sync_try_lock(m = Sync_m::EX)\n li = locker_info(m)\n fire_on_try_lock_request(li)\n have_lock = super\n if have_lock\n push_lock_info(li)\n check_watchdog\n end\n fire_on_try_lock_return(li, have_lock)\n have_lock\n end", "def execute_with_rescue(&block)\n begin\n yield block\n rescue Flickr::Error => ex\n self.error_messages ||= []\n self.error_messages << {:date => Time.now, :msg => ex.message}\n if ex.message.match(/(User not found|Invalid auth token)/)\n self.status = 'inactive'\n end\n self.save\n return\n end\n end", "def lock_changes\n begin\n @lock_count += 1\n yield\n ensure\n @lock_count -= 1\n end\n end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def try_lock\n if locked_out?\n false\n else\n lock\n true\n end\n end", "def lock(name, mode)\n yield\n end", "def validate_lock\n raise LockRequired.new(__method__, self.class) unless @mutex.owned?\n end", "def locked?\n submitted?\n end", "def lock\n if unlocked_status == false\n raise ArgumentError.new(\"You cannot lock this door - it is already locked\")\n else\n door_hash[:unlocked_status] = false\n end\n end", "def locked?\n locked = false\n status_constant == OldOrder::UNPROCESSED ? locked = false : locked = true\n locked = true unless invoice.blank?\n return locked\n end", "def lock(worker)\n return true if locked? && locked_by == worker.name\n #all this to make sure the check and the lock are simultanious:\n cnt = repository.update({properties[:lock_name]=>worker.name},self.class.all(:id=>self.id,:lock_name=>nil))\n if 0 != cnt\n @lock_name = worker.name\n true\n else\n worker.say( \"Worker #{worker.name} Failed to aquire lock on job #{id}\" )\n false\n end\n end", "def without_locking\n old_value = Parts::WithLocking.locking?\n begin\n Parts::WithLocking.locking = false\n ret_value = yield\n ensure\n Parts::WithLocking.locking = old_value\n end\n ret_value\nend", "def mutex(id, &block)\n is_expired = lambda do |locked_at|\n locked_at.to_f < Time.now.to_f\n end\n bid = batch(id)\n _key_ = \"#{bid}:lock\"\n\n until redis.setnx(_key_, Time.now.to_f + 0.5)\n next unless timestamp = redis.get(_key_)\n\n unless is_expired.call(timestamp)\n sleep(0.1)\n next\n end\n\n break unless timestamp = redis.getset(_key_, Time.now.to_f + 0.5)\n break if is_expired.call(timestamp)\n end\n yield(bid)\n ensure\n redis.del(_key_)\n end", "def locked?\n !!locked_by && !!locked_at && (locked_at + Delayed::Worker.max_run_time) >= Delayed::Job.db_time_now\n end", "def lock!\n @locked = true\n end", "def locked?\n locksmith.locked?\n end", "def is_locked\n return @is_locked\n end", "def check_for_failures\n # Lock in_progress queue or return\n num_in_progress = _redis.llen(@in_progress_queue)\n if num_in_progress == 0\n RailsPipeline.logger.debug \"No messages in progress, skipping check for failures\"\n return\n end\n\n RailsPipeline.logger.debug \"Locking '#{@in_progress_queue}' for #{num_in_progress} seconds\"\n\n # Attempt to lock this queue for the next num_in_progress seconds\n lock_key = \"#{@in_progress_queue}__lock\"\n locked = _redis.set(lock_key, _client_id, ex: num_in_progress, nx: true)\n if !locked\n RailsPipeline.logger.debug \"in progress queue is locked\"\n return\n end\n\n # Go through each message, see if there's a 'report' entry. If not,\n # requeue!\n in_progress = _redis.lrange(@in_progress_queue, 0, num_in_progress)\n in_progress.each do |message|\n enc_message = EncryptedMessage.parse(message)\n owner = _redis.get(_report_key(enc_message.uuid))\n if owner.nil?\n RailsPipeline.logger.info \"Putting timed-out message #{enc_message.uuid} back on main queue\"\n _put_back_on_queue(message)\n else\n RailsPipeline.logger.debug \"Message #{uuid} is owned by #{owner}\"\n end\n end\n end", "def lock\n self.is_locked = true\n self\n end", "def locked?\n\t\t\t\t\treturn payment_in_progress? || paid?\n\t\t\t\tend", "def access_locked?; end", "def lock!\n @locked = true\n end", "def locked?\n\t\t\t@locked\n\t\tend", "def block!\n self.blocked = Time.now\n self.save\n end", "def locked_by\n @lock_name\n end", "def each_invalid_attempt(&block)\n invalid_attempts.each(&block)\n end", "def is_locked=(value)\n @is_locked = value\n end", "def with_app_lock( &block )\n # acquire lock_expiration\n ok = with_connection_lock do |locked_self|\n if locked_self.lock_expiration.nil? then\n row.update_all lock_expiration: Time.now + DELTA\n true\n end\n end\n # use and release lock_expiration outside of the connection_lock\n if ok then\n begin\n block.call\n ensure\n row.update_all lock_expiration: nil\n end\n end\n end", "def lock_for_update(name=nil)\n if locked_for_update?(name)\n logger.debug { \"we are locked for update, yield to the block\" }\n yield\n else\n zk_with_lock(:mode => :exclusive, :name => name) { yield }\n end\n end", "def unlocked?\n unlocked, _, @active_worker_timestamp = Sidekiq.redis do |redis| \n redis.multi do\n redis.setnx(@locking_key, @current_worker_timestamp)\n redis.expire(@locking_key, 600)\n redis.get(@locking_key)\n end\n end\n unlocked\n end", "def update\n return if params_missing([ :id, :lock_serial ], params, true)\n\n lock = Lock.get_active_else_not(params)\n return render_error_modelname(404, :MISSING_RECORD, Lock) if !lock\n\n # Only the owner can update the lock record\n return render_error(403, :NOT_BELONGING, Lock) if lock.user_id != @current_user_device.user_id\n return render_error(404, :LOCK_DECOMMISSIONED) if lock.decommissioned?\n\n lock.assign_attributes(params_app_allowed)\n\n new_lock = false\n if !lock.commissioned?\n # New lock, set it all up\n new_lock = true\n lock.commission_date = DateTime.now\n end\n\n return check_save_failure(lock) if !lock.save\n\n # Owner's key not created until commissioning is completed (saved) successfully.\n # TODO Transaction around this and the commissioning?\n if new_lock\n key = create_user_key(lock.id, lock.user, lock.user)\n # Validation errors may fail in interesting ways here.\n end\n\n render_lock_reply(lock)\n end", "def acquire!(locker)\n self.locked_by = locker\n self.locked_at = Time.now\n save!\n end", "def with_instance_locked_for(operation, &block)\n return yield unless operation.version\n\n key = \"#{app}:#{operation.key}\"\n lock = Redis::Lock.new(key, LOCK_OPTIONS.merge(:redis => Promiscuous::Redis.connection))\n\n unless lock.lock\n raise Promiscuous::Error::LockUnavailable.new(lock.key)\n end\n\n begin\n yield\n ensure\n unless lock.unlock\n # TODO Be safe in case we have a duplicate message and lost the lock on it\n raise \"The subscriber lost the lock during its operation. It means that someone else\\n\"+\n \"received a duplicate message, and we got screwed.\\n\"\n end\n end\n end", "def locked?\n !locked_at.nil?\n end", "def locked?\n return @locked\n end", "def lock?\n record.unlocked? && (director?(record.event) || competition_admin? || super_admin?)\n end", "def locked?\n not @lock_name.nil?\n end", "def acquire_lock\n\t\t@@logger.info { \"Acquiring a lock in the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => false).update(:locked => true) != 0\n\tend", "def block!\n self.update_attribute(:status, BLOCKED)\n end", "def with_database_exclusive_table_lock(&block)\n case @low_card_model.connection.class.name\n when /postgresql/i then with_database_exclusive_table_lock_postgresql(&block)\n when /mysql/i then with_database_exclusive_table_lock_mysql(&block)\n when /sqlite/i then with_database_exclusive_table_lock_sqlite(&block)\n else\n raise LowCardTables::Errors::LowCardUnsupportedDatabaseError, %{You asked for low-card IDs for one or more hashes specifying rows that didn't exist,\nbut, when we went to create them, we discovered that we don't know how to exclusively\nlock tables in your database. (This is very important so that we don't accidentally\ncreate duplicate rows.)\n\nYour database adapter's class name is '#{@low_card_model.connection.class.name}'; please submit at least\na bug report, or, even better, a patch. :) Adding support is quite easy, as long as you know the\nequivalent of 'LOCK TABLE'(s) in your database.}\n end\n end", "def isLocked\n room = Room.find_by_id params[:id]\n\n if room.nil?\n respond_with locked: true\n else\n if room.lock_owner_user_id.nil? || room.room_lock_start.nil? || room.lock_owner_user_id == session[:uid]\n respond_with locked: false\n else\n respond_with locked: true\n end\n end\n end", "def lock\n # locking will automatically trigger reload\n # locker older than 1 hour is considered stale\n if !is_locked || (is_locked && locked_at < Time.now - 3600)\n self.is_locked = true\n self.locked_at = Time.now\n save!\n else\n false\n end\n end", "def with_database_exclusive_table_lock_mysql(&block)\n begin\n escaped = @low_card_model.connection.quote_table_name(@low_card_model.table_name)\n run_sql(\"LOCK TABLES #{escaped} WRITE\", { })\n block.call\n ensure\n begin\n run_sql(\"UNLOCK TABLES\", { })\n rescue ::ActiveRecord::StatementInvalid => si\n # we tried our best!\n end\n end\n end", "def disable_paranoid\n if block_given?\n @paranoid = false\n yield\n else\n raise 'Only block form is supported'\n end\n ensure\n @paranoid = true\n end", "def without_locking(&block)\n current = ActiveRecord::Base.lock_optimistically\n ActiveRecord::Base.lock_optimistically = false if current\n begin\n block.call\n ensure\n ActiveRecord::Base.lock_optimistically = true if current\n end\n end", "def with_database_exclusive_table_lock_sqlite(&block)\n block.call\n end", "def locked?\n @mutex.locked?\n end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def lock!\n self.for_update!\n end", "def validate_time_lock\n unless time_lock.nil? or time_lock.valid?\n time_lock.errors.each_full do |err| \n self.errors.add :time_lock, err.gsub(/\\{lockable\\}/, self.to_str.humanize)\n end\n end\n end", "def perform(options = {}, &block)\n @record.transaction do\n @record.class.lock('FOR UPDATE NOWAIT').find(@record.id)\n yield\n end\n rescue\n nil\n end", "def lock!(certifier)\n return false if self.locked? # already locked?\n# NCID staff determined it was best to disable these checks to allow people to recertify things\n# return false if self.certifier.present? # already claimed?\n# return false unless self.certified_at.nil? # already certified?\n\n return self.update_attributes!(:certifier_id => certifier.id, :locked => true)\n end", "def lock_to!(user)\n update_columns(locked_at: Time.current, locked_by: user.id)\n end" ]
[ "0.69271946", "0.6037471", "0.60202634", "0.5938028", "0.59299964", "0.59163475", "0.58137965", "0.5813438", "0.57962275", "0.57874775", "0.5743906", "0.5704304", "0.5703644", "0.56989694", "0.5681952", "0.56804323", "0.5677071", "0.56661135", "0.56631327", "0.56603795", "0.5647193", "0.56204605", "0.5593738", "0.5579803", "0.55764705", "0.55541396", "0.5553567", "0.55527943", "0.553542", "0.5522776", "0.55222994", "0.5521144", "0.5514754", "0.55026764", "0.54976726", "0.54948455", "0.54747105", "0.54747105", "0.54747105", "0.54747105", "0.54735756", "0.5463641", "0.5438355", "0.543789", "0.5421868", "0.54168665", "0.53974235", "0.5385077", "0.53747576", "0.536993", "0.53699005", "0.5362384", "0.5361261", "0.53568935", "0.53514993", "0.5349771", "0.53454", "0.5340596", "0.53311104", "0.5327781", "0.532357", "0.5323485", "0.53227204", "0.5320019", "0.53111273", "0.53103656", "0.5307792", "0.53054756", "0.5299054", "0.52987003", "0.52980727", "0.5289233", "0.528653", "0.5283711", "0.5281664", "0.52811223", "0.5281015", "0.52762085", "0.52734494", "0.5271779", "0.52613485", "0.52609164", "0.52588814", "0.525689", "0.5254335", "0.52489245", "0.5248719", "0.52433115", "0.5227405", "0.5223417", "0.52104235", "0.5209735", "0.5199926", "0.51902777", "0.5181141", "0.5180953", "0.51753455", "0.51709855", "0.5163439", "0.51572365" ]
0.5301559
68
Tells if the lock is expired if :time unlock strategy is active
def lock_expired?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lock_expired?\n if unlock_strategy_enabled?(:time)\n locked_at && locked_at < self.class.unlock_in.ago\n else\n false\n end\n end", "def expired?\n Time.now.to_f > @lock_expire if @lock_expire && owner_ident == @locked_owner_id\n end", "def check_lock_time(lock_time)\n false\n end", "def locked?\n\t\t\t!lockoutTime.nil? && lockoutTime.to_i != 0\n\t\tend", "def good?\n unlocked? && (self.expires_on ? DateTime.current < self.expires_on : true)\n end", "def locked?\n finished? && Time.now.utc > finished_at + 30.minutes\n end", "def locked?\n locked_by.present? && locked_at.present? && locked_at > 10.minutes.ago\n end", "def access_expired? (time = Time.current)\n access_expires_at && time > access_expires_at\n end", "def expired? time\n time ||= Timers.now\n time >= @fire_time\n end", "def expired?\n conf_item_hold_time = SystemConfiguration::Variable.get_value('booking.item_hold_time', '0').to_i\n hold_time_diff_in_hours = ((DateTime.now.to_time - self.creation_date.to_time).to_f * 24).to_i\n expired = (hold_time_diff_in_hours > conf_item_hold_time)\n expired && !force_allow_payment\n end", "def expired?\n return if missing?\n\n validity < (reference_time - time)\n end", "def expired?(time = Timers.now)\n time >= @fire_time\n end", "def expired_time? time\n time + self.class.ttl_in_seconds.to_i < Time.now\n end", "def unlocked?\n unlocked, _, @active_worker_timestamp = Sidekiq.redis do |redis| \n redis.multi do\n redis.setnx(@locking_key, @current_worker_timestamp)\n redis.expire(@locking_key, 600)\n redis.get(@locking_key)\n end\n end\n unlocked\n end", "def expired?\n Time.now > expiration if expiration\n end", "def expired?\n @expiry_time < Time.now\n end", "def expired?\n !self.active?\n end", "def expired?(timeout)\n !@time_started.nil? && @time_completed.nil? && ((Time.now - @time_started) > timeout)\n end", "def lockout?\n @lockout\n end", "def expired?\n false\n end", "def is_expired?\n (!end_time.nil? and end_time < Clock.time)\n end", "def locked?\n self.played_at <= self.class.hours_before_start_time_to_bet.hour.from_now\n end", "def expired?\n end", "def inspect_lock(lock_key_method, *args)\n lock_until = lock_redis.get(self.send(lock_key_method, *args))\n return (lock_until.to_i > Time.now.to_i) if lock_timeout > 0\n !lock_until.nil?\n end", "def expires_at\n Time.at(@lock_expire) if @lock_expire && owner_ident == @locked_owner_id\n end", "def expiration_timestamp\n @lock_expire if @lock_expire && owner_ident == @locked_owner_id\n end", "def expired?\n Time.now > self.to_be_expired_at\n end", "def expired?\n Time.now > @expiration if @expiration\n end", "def rerun_time?(node, path)\n node['locking_resource']['failed_locks'].fetch(\n path, 'time' => nil\n )['time']\n end", "def expired?\n\n end", "def time_expired?\n (Time.now - @duration) > @start_time\n end", "def locked?\n !locked_at.nil?\n end", "def tgt_expired?\n return true if @last_updated.nil? or @ticket_granting_ticket.nil?\n (@last_updated + 5) < Time.now.to_i # TGTs have an 8 hour life\n end", "def access_locked?\n !!locked_at && !lock_expired?\n end", "def time_until_unlock\n return 0 unless access_locked?\n return ((User.unlock_in - (Time.current - locked_at)) / 60).round\n end", "def expired?; end", "def expired? key\n return false if timeout.nil?\n mtime = read_cache_mtime(key)\n return (mtime.nil? || mtime+timeout <= Time.now)\n end", "def expired?\n Time.now > @expires\n end", "def expired?\n timestamp.nil? || (Time.now.to_i - timestamp.to_i).abs > 300\n end", "def expired?\n Time.current >= expires_at\n end", "def expired_kalive?(key, time)\n if [email protected]?(key)\n return false\n end\n \n if Time.now.to_i - @keys[key][:st] > time\n puts \"Expired key due to not received keepalive within #{time} seconds : #{key}\"\n return true\n end\n\n false\n end", "def expired?\n @expired\n end", "def extend_lock_if_expires_in_less_than(duration)\n extend_lock if duration > remaining_lock_time\n end", "def expired?\n Time.now > valid_until\n end", "def locked_closed?\n lock == :closed\n end", "def expired?\n self.expires_at && Time.now > self.expires_at\n end", "def expires_in\n @lock_expire.to_f - Time.now.to_f if @lock_expire && owner_ident == @locked_owner_id\n end", "def expired?\n @expires_at <= Time.now\n end", "def expired?\n exp < Time.now.to_i\n end", "def expired?\n return @expired\n end", "def expired?\n DateTime.now > @expires\n end", "def expired?\n !respond_to?(:expires_at) || expires_at < Time.current\n end", "def refresh_expired?\n can_refresh_expire? && @refresh_expiry < Time.now.to_i\n end", "def recover_from_timeout(pid, name)\n with_dedicated_connection do |con|\n lock = select_one(<<~SQL, pid, name, connection: con)\n SELECT locktype, objid, pid, granted FROM pg_locks \\\n WHERE pid = ? AND locktype = 'advisory' AND objid = hashtext(?)\n SQL\n return false unless lock\n\n if lock['granted']\n logger&.info 'DBLock: Lock was acquired after all'\n true\n else\n res = select_value 'SELECT pg_cancel_backend(?)', pid, connection: con\n logger&.warn 'DBLock: Failed to cancel ungranted lock query' unless res == true\n false\n end\n end\n end", "def expired?\n self.expires_on? and self.expires_on < Time.now\n end", "def expired?\n remaining.zero?\n end", "def expired?\n expires_at && expires_at <= Time.now\n end", "def guard_reopen?\n !self.expired?\n end", "def expired?(now)\n @expires_at <= now\n end", "def expired?\n expires && expires < Time.now\n end", "def expired?(key)\n rec = @hash[key]\n !rec.nil? && rec[:start] < Time.now - rec[:lifetime]\n end", "def expired?\n can_expire? && @expiry < Time.now.to_i\n end", "def expired?\n self.expires_at && Time.now.utc > self.expires_at\n end", "def expired?\r\n return Time.now > self.created_on + @@validity_time\r\n end", "def expired?\n expiration_date <= Time.now\n end", "def expired?\n Time.now > self.deadline\n end", "def not_expired?\n self.expires_at && Time.now <= self.expires_at\n end", "def job_status_expired?\n if self.expired?\n return true\n else\n return false\n end\n end", "def expired?\n self.expiration.past? || self[:expired]\n end", "def unlocked?\n !locked?\n end", "def lock_status?\n return @unlocked == true\n end", "def has_time_to_solve?\n self.expires_at ? Time.now.utc + self.time_to_solve < self.expires_at : true\n end", "def has_time_to_solve?\n self.expires_at ? Time.now.utc + self.time_to_solve < self.expires_at : true\n end", "def expired?\n Time.now - @created_time > @ttl\n end", "def inactive?\n last_active < 1.minute.ago rescue true\n end", "def is_doi_time_locked?\n time = Seek::Config.time_lock_doi_for || 0\n (created_at + time.to_i.days) > Time.now\n end", "def expired?(now)\n @value.expired?(now: now)\n end", "def expired?\n if (self.last_retrieved == nil)\n return true\n elsif (self.time_to_live < 30.minutes)\n return (self.last_retrieved + 30.minutes) < Time.now.gmtime\n else\n return (self.last_retrieved + self.time_to_live) < Time.now.gmtime\n end\n end", "def timeout?(time)\n config = BeEF::Core::Configuration.instance\n login_fail_delay = config.get('beef.extension.admin_ui.login_fail_delay') # get fail delay\n \n # test if the last login attempt was less then login_fail_delay seconds\n time - @session.get_auth_timestamp > login_fail_delay.to_i\n end", "def is_token_expired?\n (Time.now - self.updated_at) > 3300\n end", "def expired?\n expires_at && Time.now > expires_at\n end", "def unlocked?\n not locked?\n end", "def expired?\n not valid?\n end", "def expired?\n return true if authentication.nil?\n\n authentication.expires_at < 2.days.from_now\n end", "def expired?\n age > ttl\n end", "def expired?\n age > ttl\n end", "def expired?(expire_time)\n return false if expire_time.nil? # Assume that expire check is disabled.\n return true unless expire_time.respond_to?(:to_i) # Verify that expire_time can be converted into an integer.\n\n # Checks to see if the expire time will elapse in the next 10 seconds.\n # True if now is greater than expire time. False if now is less than expire time.\n Time.now.to_i >= (expire_time.to_i - 10)\n end", "def expired?\n return false if @expires_in.nil?\n @start_time + Rational(@expires_in - @refresh_timeout, 86400) < DateTime.now\n end", "def unlocked?\n ! File.exist?(lock_file)\n end", "def unlocked?\n @unlocked\n end", "def is_locked?\n locked\n end", "def expired?\n @expires_in && @created_at + @expires_in <= Time.now.to_f\n end", "def test_should_lock_expired_users\n User.lock_expired_users\n assert_equal false, users(:user4).active_for_authentication?\n end", "def expired?\n self.expired = false unless self.deadline > DateTime.now\n end", "def expired?\n can_expire? && (self.expires_in + self.time_created) < Time.now.to_i\n end", "def max_time_ms_expired?\n code == 50 # MaxTimeMSExpired\n end", "def expired?\n expires_at.to_time <= Time.now.utc\n end", "def expired?\n expires_at.to_time <= Time.now.utc\n end", "def lock_timeout; end", "def expired?\n DateTime.now.utc >= self.expires_at\n end" ]
[ "0.8758694", "0.79738563", "0.77380794", "0.73697823", "0.7184804", "0.71589696", "0.6993959", "0.6979564", "0.69750553", "0.6915199", "0.68723565", "0.6843243", "0.68329895", "0.6803937", "0.6785814", "0.67809415", "0.67663646", "0.67520213", "0.6740425", "0.67279536", "0.6727643", "0.6708317", "0.6704722", "0.66852397", "0.66829395", "0.66771203", "0.66636544", "0.66575366", "0.6651145", "0.66286767", "0.66279674", "0.66191816", "0.6587373", "0.6582546", "0.65781313", "0.6575956", "0.65594333", "0.655607", "0.65472716", "0.654007", "0.6539902", "0.6532168", "0.6525509", "0.65212345", "0.64907455", "0.64821136", "0.6463521", "0.64631075", "0.64541095", "0.6450442", "0.6448684", "0.6446087", "0.64446133", "0.64427793", "0.6434458", "0.64270407", "0.6423151", "0.64087266", "0.6393975", "0.63938963", "0.63931435", "0.63872623", "0.6382151", "0.6382017", "0.6378845", "0.6365841", "0.63653594", "0.6364846", "0.6363761", "0.63602173", "0.6359248", "0.6352276", "0.6352276", "0.6345365", "0.6342863", "0.63350284", "0.6330696", "0.6324823", "0.63215363", "0.63201714", "0.6313954", "0.6305192", "0.6299404", "0.62965155", "0.62963223", "0.62963223", "0.62934095", "0.62773335", "0.62692034", "0.62634736", "0.6257405", "0.6257043", "0.6256524", "0.6255583", "0.6251907", "0.6250829", "0.62486887", "0.62486887", "0.6245168", "0.62349504" ]
0.80498016
1
Is the lock enabled for the given lock strategy?
def lock_strategy_enabled?(strategy); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lock_strategy_enabled?(strategy)\n self.lock_strategy == strategy\n end", "def lockable?\n @lockable\n end", "def locking_enabled?\n lock_optimistically && columns_hash[locking_column]\n end", "def unlock_strategy_enabled?(strategy); end", "def lock?\n return true if @_lock_type\n false\n end", "def locking?\n @locking\n end", "def lock_status?\n return @unlocked == true\n end", "def has_lock?\n @has_lock || false\n end", "def locked?\n fetch_lock_info\n\n obj_exists_and_is_not_type? obj: @lock_info, type: []\n end", "def locked?\n locksmith.locked?\n end", "def is_locked?\n return true if have_lock?\n begin\n return true unless acquire_lock\n ensure\n release_lock\n end\n false\n end", "def is_locked?\n locked\n end", "def unlock_strategy_enabled?(strategy)\n self.unlock_strategy == strategy ||\n (self.unlock_strategy == :both && BOTH_STRATEGIES.include?(strategy))\n end", "def locked?\n @mutex.locked?\n end", "def locked?\n end", "def lock_present?(keyspace)\n @storage.read(keyspace.lock_key) == LOCK_VALUE\n end", "def locked_open?\n lock == :open\n end", "def locked?\n self.is_locked\n end", "def enabled?\n File.exist?(lockfile_path)\n end", "def queueing_locked?\n should_lock_on_queueing? && lock_present?\n end", "def locked?\n not @lock_name.nil?\n end", "def lock?\n record.unlocked? && (director?(record.event) || competition_admin? || super_admin?)\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def our_lock?(current_lock)\n return nil unless current_lock\n return false unless current_lock[\"client_name\"] == client_name\n return false unless current_lock[\"process_id\"] == Process.pid\n true\n end", "def locked?\n\t\t\t@locked\n\t\tend", "def supports_locking?\n false #true\n end", "def running?\n # Avoid N+1 Query: `.includes_advisory_locks`\n if has_attribute?(:locktype)\n self['locktype'].present?\n else\n advisory_locked?\n end\n end", "def have_lock?\n !!@handle\n end", "def locked?\n @locked\n end", "def locked?\n return @locked\n end", "def access_locked?\n !!locked_at && !lock_expired?\n end", "def locked?(obj)\n RedisMutexer.config.redis.exists(key(obj))\n end", "def supports_advisory_locks?\n false\n end", "def supports_advisory_locks?\n false\n end", "def is_locked\n return @is_locked\n end", "def locked?\n if defined?(@locked)\n @locked\n else\n false\n end\n end", "def locked?\n !!locked_by && !!locked_at && (locked_at + Delayed::Worker.max_run_time) >= Delayed::Job.db_time_now\n end", "def can_lock?\n SpaceRequestPolicy.can_lock?(current_user, object)\n end", "def available?\n return true unless coliding_locks.any?\n end", "def locked?\n (status & (1 << 0)).zero?\n end", "def locked?\n !locked_at.nil?\n end", "def update_startlock?\r\n # When waiting for event execution or locked\r\n return (@starting or lock?)\r\n end", "def locked?\n File.exist?(lock_file)\n end", "def locked?\n raise NotImplementedError\n end", "def locked?\n File.exist?(lock_file)\n end", "def try_lock\n if locked_out?\n false\n else\n lock\n true\n end\n end", "def already_locked?\n lock_stack.last == lock_stack_item\n end", "def locked?(*args)\n inspect_lock(:redis_lock_key, *args)\n end", "def locked?(key)\n raise NotImplementedError\n end", "def locked?\n @bridge.device_locked?\n end", "def lock_on_sleep?\n get_settings[:lock_on_sleep] != 0\n end", "def can_lock?(current_user)\n return false if current_user.anonymous?\n\n not is_locked?\n end", "def lock_is_exclusive?\n lockscope == 'exclusive'\n end", "def unique_enabled?\n SidekiqUniqueJobs.enabled? && lock_type\n end", "def locked?\n self.released?\n end", "def unlocked?\n not locked?\n end", "def locked?\n !status_flag?(:kSecUnlockStateStatus)\n end", "def locked?\n\t\t\t!lockoutTime.nil? && lockoutTime.to_i != 0\n\t\tend", "def locked?\n\t\t#puts \"Came to check locked.\"\n\t\tif $redis.get(get_race_condition_key_name).blank?\n\t\t\t#puts \"the key is blank\"\n\t\t\tfalse\n\t\telse\n\t\t #puts \"key is not blank\"\n\t\t #puts \"key is: #{$redis.get(get_race_condition_key_name)}\"\n\t\t $redis.get(get_race_condition_key_name) == LOCKED\n\t\tend\n\tend", "def unlocked?\n !locked?\n end", "def locked? key\n ! ! data(key, LOCKED)\n end", "def acquire_lock(lock_name)\n begin\n acquired = false\n sql = lock_query(lock_name)\n connection.query(sql) do |result|\n acquired = result.fetch_row.first == \"1\"\n end\n acquired\n rescue ::Exception\n false\n end\n end", "def locked?\n revision.locked == 1\n end", "def unlocked?\n ! File.exist?(lock_file)\n end", "def locked_closed?\n lock == :closed\n end", "def self_locked?\n results = mysql2.query(%Q[select is_used_lock('#{key}')], as: :array)\n lock_id = results.to_a.first.first\n return nil if lock_id.nil?\n results = mysql2.query(%Q[select connection_id()], as: :array)\n self_id = results.to_a.first.first\n self_id == lock_id\n end", "def unlockable?(resource)\n \tresource.respond_to?(:unlock_access!) &&\n \tresource.respond_to?(:unlock_strategy_enabled?) &&\n \tresource.unlock_strategy_enabled?(:email)\n\tend", "def try_lock\n\t\t\t@nested_locks += 1 and return true if @locked == Thread.current\n\t\t\tresult = false\n\t\t\tThread.critical = true\n\t\t\tunless @locked\n\t\t\t\t@locked = Thread.current\n\t\t\t\tresult = true\n\t\t\tend\n\t\t\tThread.critical = false\n\t\t\tresult\n\t\tend", "def locked?(certifier = nil)\n if certifier\n return self.certifier_id.present? && self.certifier_id != certifier.id\n end\n\n return self.locked.present?\n end", "def inspect_lock(lock_key_method, *args)\n lock_until = lock_redis.get(self.send(lock_key_method, *args))\n return (lock_until.to_i > Time.now.to_i) if lock_timeout > 0\n !lock_until.nil?\n end", "def locked?\n !!@owner\n end", "def enabled?(thing = nil)\n instrument(:enabled?, thing) { |payload|\n gate_values = adapter.get(self)\n\n gate = gates.detect { |gate|\n gate.open?(thing, gate_values[gate.key])\n }\n\n if gate.nil?\n false\n else\n payload[:gate_name] = gate.name\n true\n end\n }\n end", "def unlocked?\n @unlocked\n end", "def locked?\n !!read\n end", "def got_lock?(lock_attempt, zk, config)\n children = zk.get_children(:path => config[:root])[:children].sort\n puts \"children found are #{children}\" if config[:verbose]\n mylocks = children.select {|child| child.start_with?(config[:lockname] + \".\") }\n puts \"Testing my lock (#{lock_attempt[:path]} against the first child (#{config[:root]}/#{mylocks.first})\" if config[:verbose]\n return lock_attempt[:path] == \"#{config[:root]}/#{mylocks.first}\"\nend", "def mon_locked?\n (defined?(@mon_data) ? @mon_data : use_monitor_core).locked?\n end", "def active_for_authentication?\n super and self.locked != 1\n end", "def device_locked?\n @bridge.device_locked?\n end", "def locked?\n\t\t\t\t\treturn payment_in_progress? || paid?\n\t\t\t\tend", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def loner_locked?(*args)\n locked?(*args) || (loner && enqueued?(*args))\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def lock_expired?\n if unlock_strategy_enabled?(:time)\n locked_at && locked_at < self.class.unlock_in.ago\n else\n false\n end\n end", "def locked?\n approved? or rejected?\n end", "def mon_locked?\n @mon_data.mon_locked?\n end", "def activation_lock_allow_when_supervised\n return @activation_lock_allow_when_supervised\n end", "def try_lock\n puts \"I couldn't get a lock.\" unless \n open_lock('contested', 'w', File::LOCK_EX | File::LOCK_NB) do\n puts \"I've got a lock!\" \n true\n end\nend", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def locked?\n finished? && Time.now.utc > finished_at + 30.minutes\n end", "def enabled\n @mutex.synchronize { !!@enabled }\n end", "def enabled\n @mutex.synchronize { !!@enabled }\n end", "def enabled\n @mutex.synchronize { !!@enabled }\n end", "def check_lock_time(lock_time)\n false\n end", "def multiple_lockable?\n return @multiple_lockable unless @multiple_lockable.nil?\n major, minor, patch = mysql_version\n @multiple_lockable = (major > 5) || (major == 5 && minor > 7) || (major == 5 && minor == 7 && patch >= 5)\n end" ]
[ "0.8916013", "0.7666809", "0.7604634", "0.75293857", "0.7418769", "0.73962826", "0.73563707", "0.73181987", "0.72826046", "0.7260995", "0.7221668", "0.7181781", "0.71745044", "0.7124427", "0.70464003", "0.7028659", "0.7026742", "0.70178473", "0.6984156", "0.69554603", "0.6932302", "0.6930275", "0.6922979", "0.6922979", "0.6922979", "0.6922979", "0.6916241", "0.69158125", "0.6910602", "0.69038844", "0.6896101", "0.68702275", "0.6863894", "0.6859356", "0.681923", "0.6807215", "0.6801403", "0.6801403", "0.67963743", "0.6750414", "0.67425996", "0.6714846", "0.665743", "0.66574115", "0.66481537", "0.66172504", "0.66021734", "0.659978", "0.6594159", "0.65896773", "0.6522977", "0.65066123", "0.64931107", "0.6465677", "0.6454444", "0.64536524", "0.64198464", "0.641976", "0.63841933", "0.63721573", "0.63644046", "0.6363412", "0.6357911", "0.63498014", "0.6339917", "0.6339756", "0.63327116", "0.6332561", "0.6321198", "0.6298567", "0.62954587", "0.62837166", "0.6266491", "0.62461823", "0.6242918", "0.6230258", "0.6221339", "0.6214078", "0.6210536", "0.6169191", "0.6163367", "0.61619425", "0.615996", "0.615501", "0.61525923", "0.61456764", "0.61456764", "0.61402726", "0.6123363", "0.6117074", "0.6113473", "0.6108951", "0.6093304", "0.6093304", "0.6085929", "0.6085372", "0.6085372", "0.6085372", "0.6072321", "0.6061437" ]
0.86706394
1
Attempt to find a user by its unlock keys. If a record is found, send new unlock instructions to it. If not user is found, returns a new user with an email not found error. Options must contain the user's unlock keys source://devise//lib/devise/models/lockable.rb179
def send_unlock_instructions(attributes = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_by_key(join_key, &block)\n if @users[join_key]\n block.call @users[join_key]\n else\n block.call nil\n end\n\n nil\n end", "def find_by(options)\n warn \"Using `Repository#find_by` with an email may return inexact matches\" if email_key?(options)\n where(options, true).first\n end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def matching_user\n User.active.where(email: email).first\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def find(options={}, &block)\n options = validate_options(options)\n\n start do |imap|\n options[:read_only] ? imap.examine(options[:mailbox]) : imap.select(options[:mailbox])\n uids = imap.uid_search(options[:keys], options[:search_charset])\n uids.reverse! if options[:what].to_sym == :last\n uids = uids.first(options[:count]) if options[:count].is_a?(Integer)\n uids.reverse! if (options[:what].to_sym == :last && options[:order].to_sym == :asc) ||\n (options[:what].to_sym != :last && options[:order].to_sym == :desc)\n\n if block_given?\n uids.each do |uid|\n uid = options[:uid].to_i unless options[:uid].nil?\n fetchdata = imap.uid_fetch(uid, ['RFC822', 'FLAGS'])[0]\n new_message = Mail.new(fetchdata.attr['RFC822'])\n new_message.mark_for_delete = true if options[:delete_after_find]\n\n if block.arity == 4\n yield new_message, imap, uid, fetchdata.attr['FLAGS']\n elsif block.arity == 3\n yield new_message, imap, uid\n else\n yield new_message\n end\n\n imap.uid_store(uid, \"+FLAGS\", [Net::IMAP::DELETED]) if options[:delete_after_find] && new_message.is_marked_for_delete?\n break unless options[:uid].nil?\n end\n imap.expunge if options[:delete_after_find]\n else\n emails = []\n uids.each do |uid|\n uid = options[:uid].to_i unless options[:uid].nil?\n fetchdata = imap.uid_fetch(uid, ['RFC822'])[0]\n emails << Mail.new(fetchdata.attr['RFC822'])\n imap.uid_store(uid, \"+FLAGS\", [Net::IMAP::DELETED]) if options[:delete_after_find]\n break unless options[:uid].nil?\n end\n imap.expunge if options[:delete_after_find]\n emails.size == 1 && options[:count] == 1 ? emails.first : emails\n end\n end\n end", "def confirm_credentials(email, pwd, users)\r\n return users.all.find {|user| user.email == email && user.pwd == pwd}\r\nend", "def find_for_database_authentication(conditions={})\n find_by_email_or_alias(conditions[:email])\n end", "def find_user\n self.user_lookup_failed = false\n unless self.user_ids.blank?\n my_users = User.scoped.extending(QueryHelper::WhereIn).where_in('id', self.user_ids)\n unless my_users.blank?\n self.users = my_users\n else\n self.user_lookup_failed = true\n end\n end\n # be sure the call back returns true or else the call will fail with no error message\n # from the validation loop\n return true\n end", "def get_invitation(user)\n @model.find_by(email: user.email)\n end", "def fetch_user\n\n @user = User.where(id: @user_validation_hash_obj.user_id).first\n\n return validation_error(\n 'um_rp_9',\n 'invalid_api_params',\n ['invalid_r_t'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank? || [email protected]_eligible_for_reset_passowrd?\n\n success\n\n end", "def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end", "def inviter\n invite = Invitation.find_by_recipient_email(login)\n User.find(invite.sender_id) unless invite.nil?\n end", "def find_user\n\n @user = User.using_client_shard(client: @client).get_from_memcache(@user_id)\n\n return error_with_data(\n 'sm_gud_fu_1',\n 'Invalid user id',\n 'Invalid user id',\n GlobalConstant::ErrorAction.default,\n {},\n {}\n ) if @user.blank? || @user.client_id != @client_id\n\n success\n end", "def find_updated_by_user_info_for_room\n editor = self.updated_by\n return editor != nil ? User.find_by_id(editor) : nil\n end", "def find_user_by_email email\r\n response = make_request 'GetShopperByEmail', { :email => email }\r\n return unless valid?\r\n response = response.to_hash[:GetShopperByEmailResponse].try(:[], :GetShopperByEmailResult)\r\n { :first_name => response[:FirstName], :last_name => response[:LastName], :rewards_id => response[:ShopperId] } if response\r\n end", "def account_locked\n @user = User.find(params[:id])\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def for_user(user)\n find_by(user_email: user.emails)\n end", "def find_user_from_invitee_email\n return if invitee_email.nil?\n\n self.user = ::User.find_by(email: invitee_email)\n errors.add(:invitee_email, 'is not a registered user') if user.nil?\n end", "def me\n User.find_by_email(\"[email protected]\") || User.find_by_email('[email protected]')\nend", "def get_requester(matching_options_hash, matching_tags_hash)\n log(:info, \"Processing get_requester...\", true)\n unless matching_options_hash[:evm_owner_id].nil?\n user = $evm.vmdb('user').find_by_id(matching_options_hash[:evm_owner_id])\n end\n unless matching_options_hash[:userid].nil?\n user = $evm.vmdb('user').find_by_userid(matching_options_hash[:userid]) if user.nil?\n end\n unless $evm.root['user_id'].nil?\n user = $evm.vmdb('user').find_by_id($evm.root['user_id']) if user.nil?\n end\n if user.nil?\n user = $evm.vmdb('user').find_by_userid('admin')\n end\n\n log(:info, \"Found User: #{user.userid}\")\n matching_options_hash[:user_name] = /^[^@]*/.match(user.userid)\n matching_options_hash[:owner_first_name] = user.first_name ? user.first_name : 'Cloud'\n matching_options_hash[:owner_last_name] = user.last_name ? user.last_name : 'Admin'\n matching_options_hash[:owner_email] = user.email ? user.email : $evm.object['to_email_address']\n log(:info, \"Processing get_requester...Complete\", true)\n end", "def user_lookup(email, id = false)\n if id\n send_req({act: :user_lookup, unique_id: email})\n else\n send_req({act: :user_lookup, cloudflare_email: email})\n end\n end", "def sign_in identifier\n User.find_by(login: identifier) || User.find_by(email: identifier)\n end", "def find_in_ad(options = {:key => :username})\n username = send(options[:key])\n ad_user = self.class.ad_query_by_username(username)\n return nil if ad_user.nil?\n self.map_user_from_ad(ad_user)\n true\n end", "def user\n begin\n if user_uid?\n @_user ||= User.find(user_uid)\n end\n if respond_to?(:email?) && email?\n @_user ||= User.where(email: email).first\n end\n rescue => e\n Rails.logger.warn \"#{self.class} #{self.id} has a user_uid that corresponds to no known data room user. Perhaps someone has been deleted? Ignoring. Error: #{e}\"\n nil\n end\n @_user\n end", "def find_depositor(user_key)\n user = ::User.find_by_user_key(user_key) if user_key\n user ||= ::User.find(user_key) if user_key\n user ||= ::User.find_or_create_system_user(DEFAULT_CREATOR_KEY)\n self.depositor = user\n end", "def send_unlock_instructions\n return unless EMAILS_ENABLED && !deleted?\n\n super\n end", "def unlocks_from_user_data(user_data)\n raise NotImplementedError\n end", "def find_match\n user_match = User.find_by(id: self.id)\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(guest_user_id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:user_id])\n rescue ActiveRecord::RecordNotFound\n redirect_to new_password_reset_path, :flash => {:error => \"Password reset link has expired.\"}\n end", "def select_user_information(mail)\n return get_db_as_hash().execute(\"SELECT * FROM user WHERE mail = ?\", mail).first\n end", "def find_for_authentication(conditions)\n if ( login = conditions[:email] ).present?\n if login =~ /@/\n find_by_email(login)\n else\n find_by_slug(login)\n end\n else\n super\n end\n end", "def find_user(params)\n Rails.application.eager_load!\n user = nil\n ActiveRecord::Base.descendants.select {|model| model < Umanage::User}.each do |umodel|\n user ||= umodel.find_by(email: params[:session][:email].downcase)\n end\n return user\n end", "def find_or_create_record\n\n #check if the email has already signed up.\n manager_record = Manager.where(email: @email).first\n\n if manager_record.present?\n return validation_error(\n 'am_w_e_2',\n 'invalid_api_params',\n ['email_already_signed_up'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n record = ManagerWhitelisting.where(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n ).first\n\n if record.present?\n return validation_error(\n 'am_w_e_3',\n 'invalid_api_params',\n ['email_already_whitelisted'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n create_response = ManagerWhitelisting.create!(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n )\n\n template_vars = { company_web_domain: CGI.escape(GlobalConstant::CompanyWeb.domain) }\n\n r = ::Email::HookCreator::SendTransactionalMail.new(\n receiver_entity_id: create_response.id,\n receiver_entity_kind: GlobalConstant::EmailServiceApiCallHook.whitelisting_requester_kind,\n template_name: GlobalConstant::PepoCampaigns.platform_whitelisting_done_template,\n template_vars: template_vars).perform\n return r unless r.success?\n\n success\n\n end", "def send_unlock_instructions; end", "def remote_grant(sender, body)\n key_id = AES3::iv_from_str(_pop_token(body))\n aes_key = _pop_token(body)\n peer = _pop_token(body)\n rsa_key = _pop_token(body)\n status = _pop_token(body).to_s\n status = 'online' if status.length < 3\n key_hash = MD5::digest(rsa_key)[0,8]\n\n # Remote user's data/presence\n fingerprint = _fingerprint(key_hash)\n _adjust_presence(status, key_hash, EMPTY_ROOM, body, false)\n _adjust_presence('join', key_hash, EMPTY_ROOM, body, false)\n\n # Are we getting an AES key from another instance of our account?\n if key_hash == @connection.comm.our_keyhash\n unless @connection.comm.keyring.ring[key_id]\n local_grant(sender)\n @connection.comm.keyring.add_key(key_id, aes_key)\n end\n return nil\n end\n @connection.comm.keyring.add_key(key_id, aes_key)\n\n # Are we getting this key from a trusted user?\n if _user_keyhash(sender)\n if _user_keyhash(sender) != key_hash\n\n # Calculate the keyhash we have for this user\n known = _fingerprint(_user_keyhash(sender))\n\n # Give the suspicious remote user a suspicious-sounding name\n tmp_name = \"fake_#{sender}\"\n tmp_name += (\"_%02x\" % rand(256)) if @connection.comm.rsa_keys[tmp_name]\n _notice(\"User #{sender} (claiming to be #{peer}) has sent you a \" +\n \"public key you don't recognize. Fingerprint is \" +\n \"(#{fingerprint}), expected (#{known}). Renaming this user \" +\n \"to #{tmp_name}\", :notice)\n sender = tmp_name\n end\n peer = sender\n unless @var[:granted_by].include? peer\n _notice(\"You were granted access by trusted user #{peer} \" +\n \"(#{fingerprint})\", :crypto)\n @var[:granted_by] << peer\n end\n\n # Grant th is trusted user our key unless we've already given it to him\n # or we have placed him on our revoked list\n unless @var[:granted].include?(peer) or @var[:revoked].include?(peer)\n local_grant(peer)\n end\n\n # We don't know exactly who sent us this key, do we?\n else\n # Wait a minute, does this \"new\" user have a name we know? That's weird!\n # Give the suspicious remote user a suspicious-sounding name!\n if @connection.comm.rsa_keys[peer]\n known = _fingerprint(_user_keyhash(peer))\n tmp_name = \"fake_#{peer}\"\n tmp_name += (\"_%02x\" % rand(256)) if @connection.comm.rsa_keys[tmp_name]\n _notice(\"'New' user claiming to be #{peer} has sent you a \" +\n \"public key you don't recognize. Fingerprint is \" +\n \"(#{fingerprint}), expected (#{known}). Renaming this user \" +\n \"to #{tmp_name}\", :notice)\n peer = tmp_name\n end\n\n # Add their key (we'll take keys from anyone) and reciprocate if needed.\n @connection.comm.rsa_keys[peer] = rsa_key\n @connection.comm.names[key_hash] = peer\n _notice \"You were granted access by new user #{peer} (#{fingerprint})\"\n unless @var[:granted].include?(peer) or @var[:revoked].include?(peer)\n local_grant(peer) if @var[:auto_grant]\n end\n end\nend", "def finder\n User.find_by(id: @id, name: @name, email: @email)\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:id])\n end", "def email_credential\n user.credentials.where(name: email).first\n end", "def email_available\n email_attempt = params[:email_attempt].downcase\n user = User.find_by_email(email_attempt)\n if user\n render :json => { :available => false}\n else\n render :json => { :available => true}\n end\n end", "def user\n user = User.find_by_email(email)\n return user if user && user.authenticate(password)\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def ensure_user_byemail(email, name)\n users = db[:users]\n usr = users.first(:email => email)\n\n if usr.nil?\n\n u = retrieve_user_byemail(email, name)\n\n if u.nil? or u['login'].nil?\n warn \"Could not retrieve user #{email} through search API query\"\n login = (0...8).map { 65.+(rand(25)).chr }.join\n users.insert(:email => email,\n :name => name,\n :login => login,\n :fake => true,\n :deleted => false,\n :created_at => Time.now)\n info \"Added user fake #{login} -> #{email}\"\n users.first(:login => login)\n else\n in_db = users.first(:login => u['login'])\n geo = geolocate(location: u['location'])\n if in_db.nil?\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n info \"Added user #{u['login']} (#{email}) through search API query\"\n else\n in_db.update(:name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n debug \"User #{u['login']} with email #{email} exists\"\n end\n users.first(:login => u['login'])\n end\n else\n debug \"User with email #{email} exists\"\n usr\n end\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n unless @user\n flash[:notice] = \"We're sorry, but we could not locate your account.\" +\n \"If you are having issues try copying and pasting the URL \" +\n \"from your email into your browser or restarting the \" +\n \"reset password process.\"\n redirect_to root_url\n end\n end", "def test_different_user_entry_unlock\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"12345678901234567890123456789012\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n new_user.unlock(\"fake_pass\")\n\n new_entry.lock_password(new_user, \"password1234\")\n\n different_user = EntryCrypto::User.new \"master_user\", 1235, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n different_user.lock(\"fake_pass\")\n different_user.unlock(\"fake_pass\")\n\n decrypted_password = new_entry.unlock_password(different_user)\n\n assert decrypted_password.nil?\n end", "def user\n\t\taccount = Account.find_by_email(email)\n\t\t# If everything is true, the user will be returned\n\t\treturn account if account && account.valid_password?(password) #account.authenticate(password) #user&.authenticate?(password) #user && user.authenticate(password) \n\t\t# If not, the method will return nil\n\t\terrors.add :user_authentication, 'invalid credentials' \n\t\tnil \n\tend", "def with_user user_email, &block\n user = User.where(:email => user_email).first\n yield(user)\n end", "def do_find(params)\n @invitee ||= User.find_by_id(params[:invitee_id]) unless params[:invitee_id].blank?\n\n #@invitee = nil if @invitee && Relationship.relationships(current_actor, @invitee, Relationshiptype.all_valid).blank?\n\n @matched_users = Array.new\n @invite.circle_id = params[:circle_id] unless params[:circle_id].blank?\n @available_types ||= []\n\n return unless check_invites_quota(@user)\n\n if params[:restrict] == Invite::TYPES[:founder_circle][:id].to_s\n # special case for inviting founders, its only allowed when restrict parameter is passed\n menu = Invite.menu_founder\n @invite.circle_id = Invite::TYPES[:founder_circle][:id]\n else\n menu = Invite.menu_for(@user, true)\n end\n\n # Get all matching users (if one passed in, just grab that one)\n matches = if !params[:invitee_id].blank?\n @emails = []; @terms = []\n m = @invitee ? [@invitee] : []\n if m.size == 1\n params[:users] = m.first.login\n m.first.is_a_follower_of(@user, Relationshiptype.by_invite_only).each do |rel|\n menu.reject! { |item| rel.relationshiptype_id.to_i <= Invite::TYPES[item][:id] }\n end\n end\n# logger.debug \"! Menu: #{menu.inspect}\"\n m\n elsif !params[:users].blank?\n @terms = params[:users].split(',').map { |x| x.strip }\n @emails = @terms.select { |t| t.match(User::EMAIL_REGEX) }\n values_to_insert = []\n if @terms.size == 1 # Only one search term, do LIKE search\n like = \"%#{h(@terms.first)}%\"\n values_to_insert = [like, like, like]\n query = \"(login LIKE ? OR display_name LIKE ? OR email LIKE ?)\"\n # FIXME: code have no side effect\n if @invite.circle_id == Invite::TYPES[:founder_circle][:id]\n query + \" AND (type = 'BasicUser' OR type = 'AdvancedUser')\"\n end\n else # Multiple terms, each must match exactly\n query = @terms.inject([]) do |array, t|\n values_to_insert << [t, t, t]\n array << '(login = ? OR display_name = ? OR email = ?)'\n end.join(' OR ')\n end\n query = \"(%s) AND type NOT IN ('%s', '%s')\" % [query, CollectionProject.name, Facebook::User.name]\n User.active.all(:conditions => [query] + values_to_insert.flatten, :limit => MAX_USERS_SEARCH_PAGE_SIZE*5)\n end\n\n if matches\n # If you're inviting to founders/members circle, you can't invite any projects\n if @invite.circle_id == Invite::TYPES[:founder_circle][:id]\n @are_projects = matches.select { |x| x.project? }\n matches -= @are_projects\n end\n\n # If only one user, and that user is already in or invited to circles, invite to next-closest used circle, if one exists\n # If not, set it to current circle (closest) so we don't look like complete idiots\n if matches.count == 1 && (params[:invite].nil? || params[:invite][:circle_id].blank?)\n in_circle = @user.find_circle_with(matches.first)\n invited_circle = matches.first.invited_to?(@user)\n in_circle = in_circle.circle_id if in_circle\n invited_circle = invited_circle.circle_id if invited_circle\n\n if current_circle = [invited_circle, in_circle].compact.max\n if closer_circle = @user.circles(:just_ids => true).sort.detect { |x| x < current_circle }\n @invite.circle_id = closer_circle\n else\n @invite.circle_id = current_circle\n end\n end\n end\n\n # Can't invite ppl with pending invitations to this circle or closer\n pending_invites = @user.invites_i_sent.pending\n\n #note that some active inviters can have thousands here - so don't turn this into array\n invited_users = pending_invites.only_circles(Relationshiptype.circle_and_closer(@invite.circle_id))\n\n # Can't invite self or ppl in this circle or closer\n exclude_ids = if @invite.circle_id == Invite::TYPES[:site_invite][:id] then\n [current_actor.id]\n else\n [current_actor.id] + current_actor.all_related.in_circle_or_closer(@invite.circle_id).\n all(:conditions => {:id => matches.map(&:id)}, :select => 'users.id').map(&:id)\n end\n\n in_cirles = current_actor.followers.all(:conditions => {:id => matches.map(&:id)})\n\n if @invite.circle_id == Invite::TYPES[:founder_circle][:id]\n @need_following = []\n else\n @need_following = matches - in_cirles\n end\n \n # OK, now figure out all the special cases and categorize all matches\n @too_close = matches.select { |x| exclude_ids.include?(x.id) }\n @matched_users = matches - @too_close - @need_following + @emails\n @already_invited = @matched_users.select { |x| x.is_a?(User) ? invited_users.find_by_user_id(x.id) : invited_users.find_by_user_email(x)}\n @matched_users -= @already_invited\n if @matched_users.size > MAX_USERS_SEARCH_PAGE_SIZE\n @matched_users = @matched_users[0..MAX_USERS_SEARCH_PAGE_SIZE-1]\n flash[:warning] = 'Displaying first %d found users' / MAX_USERS_SEARCH_PAGE_SIZE\n end\n @not_found = (@terms - @emails).reject { |t| matches.any? { |m| [m.login, m.display_name, m.email].any? { |string| string.downcase.include?(t) } } }\n\n @invite.circle_id = Invite::TYPES[menu.last][:id] if menu.size > 0 && @invite.circle_id.nil? # default selection\n @invite.user_email = params[:users] if params[:users] && params[:users].match(/@{1}/)\n end\n\n # Build the list of circles @user can invite @invitee into (e.g. NOT circles @invitee is already in or invited to, or further)\n available_types = menu.collect { |key| [@user.circle_name(Invite::TYPES[key][:id]), Invite::TYPES[key][:id]] }\n available_types.each do |menu_item|\n menu_type_name = menu_item[0] + \" \"\n @available_types << [menu_type_name, menu_item[1]]\n end\n end", "def edit\n # Find user in DB by password reset token\n \t@user = User.find_by_password_reset_token!(params[:id])\n end", "def user\n user = User.find_by_email(email)\n return user if user&.authenticate(password)\n\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def fetch_and_validate_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).is_active.first\n return error_with_identifier('invalid_api_params',\n 'um_u_c_ve_2',\n ['user_already_present']\n ) if @user.present?\n\n success\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def find(options)\n type, name = options.to_a.flatten\n\n locks.find { |mutex|\n mutex.type == type &&\n mutex.name == name\n }\n end", "def user_key=(key)\n @user_key = key\n self.user ||= Spotlight::Engine.user_class.find_by_user_key(key)\n self.user ||= Spotlight::Engine.user_class.invite!(email: user_key, skip_invitation: true)\n user.user_key = key\n end", "def user\n user = User.find_by_email(email)\n # return the user if a user with that email is found and the password is valid\n return user if user && user.authenticate(password)\n #.authenticate is an ActiveModel::SecurePassword method\n #.authenticate is included via ActiveRecord inheritance and using has_secure_password in the User model\n #.authenticate returns self if password is correct, otherwise returns false\n\n # Otherwise, add this message to error messages & return nothing\n errors.add(:user_authentication, 'This email and password combination is invalid.')\n nil\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def find_user(id: nil)\n return users.detect { |user| user.id == id }\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def find_or_create_user\n\n # create the user \n email = self.accesscode.to_s+\"@shuttlechallenge.ca\"\n user = User.where(email: email).first\n\n if user.nil? # no duplicate users please\n password = self.accesscode\n name = \"#{self.firstname} #{self.lastname}\"\n user = User.new(name: name, email: email, password: password)\n\n \n #create the access object for this user\n user.access = Access.new(code: password)\n\n\n\n #device\n user.device= Device.new(device: self.logger_id)\n user.save!\n\n end\n user\n end", "def get_user_by_email(order)\n response = HTTParty.get(\"#{Rails.application.secrets.mapp_integration[:api_endpoint]}\"+\"/user/getByEmail\", headers: headers, query: user_get_by_email_query(order.email))\n user_id_from_response = response.parsed_response[\"id\"]\n\n begin\n if user_id_from_response.nil?\n guest_user_response = Workarea::MappIntegration::MappIntegrationGateway.new.user_creation_for_guest_user(order)\n user_id = guest_user_response.parsed_response[\"id\"]\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id)\n else\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id_from_response)\n end\n rescue Timeout::Error => e\n Rails.logger.info \"Rescued #{e.message}\"\n end\n end", "def unlock_instructions(record, token, opts={})\n MnoEnterprise::MailClient.deliver('unlock-instructions',\n default_sender,\n recipient(record),\n user_vars(record).merge(unlock_link: user_unlock_url(unlock_token: token))\n )\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n flash[:notice] = :id\n unless @user\n #flash[:notice] = \"We are sorry, but we could not locate your account. \" +\n #{}\"If you are having issues try coping and pasting the URL\" +\n #{}\"from your email into your browser or restarting the \" +\n #{}\"reset password process.\"\n redirect_to root_url\n end\n end", "def find_existing_account(hash)\n # Need a lookup key, or we have nothing\n return nil unless (hash.keys & [:jhed_lid, :hopkins_id, :horizon_borrower_id]).length > 0\n\n queries = []\n [:hopkins_id, :jhed_lid, :horizon_borrower_id].each do |key|\n queries << \"#{key} = :#{key}\" if hash[key]\n end\n\n # There shouldn't be multiples, but just in case we do an ORDER BY,\n # so we'll always get the same one if there are multiples (the earliest created one)\n return User.where( queries.join(\" OR \"), hash).order(:created_at, :id).first\n end", "def get_user(username, users)\n puts \"Searching for user '#{username}'\"\n users.each do |user|\n return user if user[:username] == username\n end\n puts \"User #{username} not found!\"\n return nil\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id]) if session[:guest_user_id]\n\n # rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n # session[:guest_user_id] = nil\n # guest_user if with_retry\n end", "def find_paired_user\n Rails.logger.debug \"Tag.find_paired_user: self.gml_uniquekey=#{self.gml_uniquekey}\"\n return if self.gml_uniquekey.blank?\n user = User.find_by_iphone_uniquekey(self.gml_uniquekey)\n return if user.nil?\n Rails.logger.debug \"Pairing with user=#{user.login.inspect}\"\n self.user = user\n end", "def find_key(name)\n debug \"Finding key #{name}\"\n user.find_key(name) or raise RHC::KeyNotFoundException.new(\"Key #{name} does not exist\")\n end", "def password_recovery\n session[:user_id] = nil\n id = params[:uhash].slice(0, params[:uhash].length-40)\n @user = User.find_by_id(id)\n if not @user or (@user.id.to_s + Digest::SHA1.hexdigest(\"YA\" + @user.email + \"YA\") != params[:uhash])\n return render :text => \"Link is not valid or expired\"\n end\n r = Recovery.find_by_user_id(@user[:id])\n if not r or r[:recover_hash] != params[:hash] or (Time.now - r.updated_at) > 1.day\n return render :text => \"Link is not valid or expired\"\n end\n r.destroy\n session[:user_id] = @user.id\n session[:recovery] = true\n redirect_to schedule_url\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound\n cookies.delete :guest_user_email\n guest_user\n end", "def recover_password\n person = Person.find_by_email(params[:email])\n\n if person\n UserMailer.recovery(:key => CryptoHelper.encrypt(\"#{person.id}:#{person.salt}\"),\n :email => person.email,\n :username => person.username,\n :domain => APP_CONFIG.server_domain).deliver\n render_json :messages => \"Recovery mail sent to specified address.\", :status => :ok and return\n else\n render_json :messages => \"Record not found.\", :status => :not_found and return\n end\n\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def show_private_object_to(user)\n return self if (self.private == 0) || (self.created_by.id == user.id)\n if self.private == 1 \n user_auth = User.find_by_sql([\"select id,email from users where email IN (select addresses.email from addresses where addresses.id IN (select address_id from addresses_#{self.class}s where #{self.class}_id = ?)) AND email = ? limit 1\", self.id, user.email ])\n group_auth = User.find_by_sql([\"select id, email from users where email IN (select addresses.email from addresses where addresses.id IN (select address_id from addresses_groups where group_id = (select group_id from groups_#{self.class}s where #{self.class}_id = ? ))) AND email = ? LIMIT 1;\", self.id, user.email])\n raise ActiveRecord::RecordNotFound if user_auth.empty? && group_auth.empty?\n end\n return self\n end", "def get_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return nil\n end\n\n return find_account(accounts, options[:email])\nend", "def fetch_user\n @user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).first\n\n return error_with_data(\n 'um_srpl_2',\n 'User not present',\n '',\n GlobalConstant::ErrorAction.default,\n {},\n {email: 'This user is not registered or is blocked'}\n ) unless @user.present? && @user.password.present? && (@user.status == GlobalConstant::User.active_status)\n\n success\n end", "def get_user(uid)\n @inv = User.find_by_id(uid)\n end", "def peer_auditor\n if self.auditor_id > 0 \n User.find(self.auditor_id)\n else\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end\n rescue\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end", "def guest_user(with_retry = true)\n begin\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=User.find_by_guest_authentication_token(session[:guest_authentication_token]) ||User.build_guest(session)\n rescue ActiveRecord::RecordNotFound\n session[:guest_authentication_token] = nil\n guest_user if with_retry\n end\n end", "def show_by_email\n user = User.get_user_by_email(params[:email]) # Obtain the user corresponding to the id\n\n if user != nil # If exist the user in DB\n response = { content: user, message: \"User has been obtained successfully\", status: 200 } # Return the corresponding user\n\n render json: response, status: 200\n else # If not exist data\n response = { content: {}, message: \"User not found\", status: 404 }\n\n render json: response, status: 404 # Return 'not found'\n end\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=\n User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound #\n cookies.delete :guest_user_email\n guest_user\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n # if session[:guest_user_id] invalid\n rescue ActiveRecord::RecordNotFound\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def registered_user_with_login_credentials\n login_credentials = decoded_credentials\n unless login_credentials.blank?\n email = login_credentials[0]\n password = login_credentials[1]\n registered_user = RegisteredUser.where(email: email).first\n if registered_user && registered_user.valid_password?(password)\n return registered_user\n else\n return nil\n end\n end\n end", "def find_key(name)\n logger.debug \"Finding key #{name}\" if @mydebug\n user.keys.each { |key| return key if key.name == name }\n\n raise RHC::KeyNotFoundException.new(\"Key #{name} does not exist\")\n end", "def findUserByEmail(email)\n method = 'findUser'\n type = User\n args = {:email=>email}\n return_object type,method,args\n end", "def edit\n @user = User.find_by_password_reset_token(params[:token]) \n end", "def authenticate(name_or_email, password)\n m = active.find_by_email(name_or_email)\n m = active.find_by_name(name_or_email) unless m \n m && m.authenticated?(password) ? m : nil\n end", "def find_target\n target = User.where(:email => email).first\n self.target_id = target.id if target\n end", "def user_by_id(user_id)\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Picking user ID #{user_id.inspect} from pool\"\n users.select { |user| user[:id] == user_id.to_i }.first\n end", "def check_for_existing_user\n user = User.find_for_authentication(email: params[:user][:email])\n if user.present?\n flash[:alert] = t(\".flash_error\")\n redirect_to new_user_session_path(user: { email: params[:user][:email] })\n end\n end", "def find_using_email_token!(token, age = self.email_token_valid_for)\n find_using_email_token(token, age) || raise(ActiveRecord::RecordNotFound)\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def user\n # find a User matching the decoded token if the decode operation was successfull\n user = User.find(decoded_auth_token[:user_id]) if decoded_auth_token\n\n if user\n # return the user if active\n return user if user.active\n\n # Else raise a JWTException Inactive Account\n raise(API::JWTExceptionHandler::InactiveAccount, APIMessages.account_not_active)\n end\n rescue ActiveRecord::RecordNotFound => e\n # Raise an Invalid Token if there is no matching User from db\n raise(API::JWTExceptionHandler::InvalidToken, (\"#{APIMessages.invalid_token} #{e.message}\"))\n end", "def check_user\n return nil unless userlogin_signed_in?\n\n User.find_by(email: current_userlogin.email)\n end" ]
[ "0.58399653", "0.5818215", "0.577734", "0.549839", "0.542992", "0.53863347", "0.5386312", "0.5329966", "0.53112453", "0.5274412", "0.5268573", "0.52671915", "0.52517444", "0.52418923", "0.5238795", "0.52378136", "0.52346647", "0.5218653", "0.52177817", "0.5214724", "0.52133685", "0.516876", "0.51675534", "0.5157341", "0.51546335", "0.5145483", "0.51425695", "0.51352584", "0.5129328", "0.5128775", "0.51253766", "0.512311", "0.51185125", "0.51184314", "0.5104823", "0.51034147", "0.5098914", "0.5080693", "0.5079153", "0.5065093", "0.50632423", "0.50630677", "0.5063017", "0.5062942", "0.5060639", "0.5051987", "0.5050148", "0.5046734", "0.5046201", "0.50341964", "0.50271016", "0.5024318", "0.5022906", "0.5022673", "0.5000549", "0.4984663", "0.49806222", "0.49699223", "0.49699223", "0.49699223", "0.49699223", "0.49699223", "0.49687207", "0.4968564", "0.4968155", "0.49677032", "0.49666935", "0.4963708", "0.49627644", "0.4957454", "0.4955007", "0.49546173", "0.49507442", "0.4946035", "0.4940168", "0.49394524", "0.49386725", "0.4937032", "0.49339262", "0.49338174", "0.49214903", "0.4919047", "0.49062294", "0.490575", "0.49053234", "0.49023482", "0.48992562", "0.4899041", "0.48931372", "0.4890923", "0.48878992", "0.48852557", "0.48757946", "0.48749402", "0.48693895", "0.48608342", "0.4859324", "0.4856865", "0.4856865", "0.48507905", "0.4848492" ]
0.0
-1
Find a user by its unlock token and try to unlock it. If no user is found, returns a new user with an error. If the user is not locked, creates an error for the user Options must have the unlock_token source://devise//lib/devise/models/lockable.rb189
def unlock_access_by_token(unlock_token); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlock_access_by_token(unlock_token)\n original_token = unlock_token\n unlock_token = Devise.token_generator.digest(self, :unlock_token, unlock_token)\n\n lockable = find_or_initialize_with_error_by(:unlock_token, unlock_token)\n lockable.unlock_access! if lockable.persisted?\n lockable.unlock_token = original_token\n lockable\n end", "def unlock(token)\n unless(@lock_class)\n NotImplemented\n else\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end\n end", "def unlock(token)\n return NotImplemented unless @lock_class\n\n token = token.slice(1, token.length - 2)\n if(token.nil? || token.empty?)\n BadRequest\n else\n lock = @lock_class.find_by_token(token)\n if(lock.nil? || lock.user != @user)\n Forbidden\n elsif(lock.path !~ /^#{Regexp.escape(@path)}.*$/)\n Conflict\n else\n lock.destroy\n NoContent\n end\n end\n end", "def login_lock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => Time.current + config.login_lock_time_period,\n config.unlock_token_attr_name => self.class.generate_random_token\n }\n sorcery_orm_adapter.update_attributes(attributes)\n\n if config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?\n return\n end\n\n send_unlock_token_email!\n end", "def account_locked\n @user = User.find(params[:id])\n end", "def login_unlock!\n config = sorcery_config\n attributes = {\n config.lock_expires_at_attr_name => nil,\n config.failed_logins_count_attr_name => 0,\n config.unlock_token_attr_name => nil\n }\n sorcery_orm_adapter.update_attributes(attributes)\n end", "def locked\n # Get the current user\n user = current_user\n # If the lock has passed its expiry date, and the lock is not permanent\n if user.lock.expires_at <= Time.now && !user.lock.permanent?\n # Destroy the lock record\n user.lock.destroy!\n end\n # If the account is still locked\n if user.lock != nil\n # Notify the user that their account has been locked\n flash[:error] = \"Your account has been locked. Please contact Player Support for more information\"\n # Log the user out\n logout\n # Take the user to the homepage\n redirect_to root_path\n end\n end", "def user\n # find a User matching the decoded token if the decode operation was successfull\n user = User.find(decoded_auth_token[:user_id]) if decoded_auth_token\n\n if user\n # return the user if active\n return user if user.active\n\n # Else raise a JWTException Inactive Account\n raise(API::JWTExceptionHandler::InactiveAccount, APIMessages.account_not_active)\n end\n rescue ActiveRecord::RecordNotFound => e\n # Raise an Invalid Token if there is no matching User from db\n raise(API::JWTExceptionHandler::InvalidToken, (\"#{APIMessages.invalid_token} #{e.message}\"))\n end", "def unlock(params = {})\n params ||= {}\n params[:id] = @attributes[:id]\n raise MissingParameterError.new(\"Current object doesn't have a id\") unless @attributes[:id]\n raise InvalidParameterError.new(\"Bad parameter: id must be an Integer\") if params[:id] and !params[:id].is_a?(Integer)\n raise MissingParameterError.new(\"Parameter missing: id\") unless params[:id]\n\n Api.send_request(\"/users/#{@attributes[:id]}/unlock\", :post, params, @options)\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = 'Your account is locked.'\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlocks_from_user_data(user_data)\n raise NotImplementedError\n end", "def reject_locked!\n if current_user && current_user.locked?\n sign_out current_user\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock_user_v2_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.unlock_user_v2 ...'\n end\n # verify the required parameter 'user_id' is set\n if @api_client.config.client_side_validation && user_id.nil?\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.unlock_user_v2\"\n end\n # resource path\n local_var_path = '/v2/users/{userId}/unlock'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :operation => :\"UsersApi.unlock_user_v2\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#unlock_user_v2\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def reject_locked!\n if current_user && current_user.is_locked?\n sign_out current_user\n user_session = nil\n current_user = nil\n flash[:alert] = \"Your account is locked.\"\n flash[:notice] = nil\n redirect_to root_url\n end\n end", "def unlock\n if @unlocked == true\n raise ExceptionError.new(\"An unlocked door needith not be unlocked\")\n else\n return @unlocked = true\n end\n end", "def test_locked_user\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n\n assert_raises(EntryCrypto::LockedError) { new_entry.lock_password(new_user, \"password1234\") }\n end", "def check_unlock\n if params[:slug] != 'max_activities'\n return json_error \"At this time, a user can only unlock for 'max_activities'.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n payload = { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n\n payload[:highest_level_reached] = true if unlocker.highest_level?\n\n render json: payload \n end", "def unlock_user_v2(user_id, opts = {})\n unlock_user_v2_with_http_info(user_id, opts)\n nil\n end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:user_id])\n rescue ActiveRecord::RecordNotFound\n redirect_to new_password_reset_path, :flash => {:error => \"Password reset link has expired.\"}\n end", "def can_unlock?(current_user)\n return false if current_user.anonymous?\n\n is_locked? and not is_locked_by_other?(current_user)\n end", "def guest_user(with_retry = true)\n begin\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=User.find_by_guest_authentication_token(session[:guest_authentication_token]) ||User.build_guest(session)\n rescue ActiveRecord::RecordNotFound\n session[:guest_authentication_token] = nil\n guest_user if with_retry\n end\n end", "def reset_password\n @token = params[:token]\n @user = User.load_from_reset_password_token(@token)\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def unlock_user(id, opts = {})\n data, _status_code, _headers = unlock_user_with_http_info(id, opts)\n data\n end", "def prevent_locked_user_login\n config = sorcery_config\n should_unlock =\n !login_unlocked? &&\n config.login_lock_time_period != 0 &&\n send(config.lock_expires_at_attr_name) <= Time.current\n\n login_unlock! if should_unlock\n\n return false, :locked unless login_unlocked?\n\n true\n end", "def send_unlock_instructions(attributes = {})\n lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found)\n lockable.resend_unlock_instructions if lockable.persisted?\n lockable\n end", "def update\n # self.resource = resource_class.reset_password_by_token(resource_params)\n # yield resource if block_given?\n\n # if resource.errors.empty?\n # resource.unlock_access! if unlockable?(resource)\n # set_flash_message!(:notice, :updated_not_active)\n # respond_with resource, location: new_session_path(resource_name)\n # else\n # respond_with resource\n # end\n end", "def test_different_user_entry_unlock\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"12345678901234567890123456789012\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n new_user.unlock(\"fake_pass\")\n\n new_entry.lock_password(new_user, \"password1234\")\n\n different_user = EntryCrypto::User.new \"master_user\", 1235, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n different_user.lock(\"fake_pass\")\n different_user.unlock(\"fake_pass\")\n\n decrypted_password = new_entry.unlock_password(different_user)\n\n assert decrypted_password.nil?\n end", "def unlock_access!\n self.locked_at = nil\n self.failed_attempts = 0 if respond_to?(:failed_attempts=)\n self.unlock_token = nil if respond_to?(:unlock_token=)\n save(validate: false)\n end", "def mfa_re_authenticate_by_password(access_token, password_event_based_auth_model_with_lockout, sms_template2_f_a = '')\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\n end\n if password_event_based_auth_model_with_lockout.blank?\n raise LoginRadius::Error.new, getValidationMessage('password_event_based_auth_model_with_lockout')\n end\n\n query_parameters = {}\n query_parameters['access_token'] = access_token\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n\n resource_path = 'identity/v2/auth/account/reauth/password'\n put_request(resource_path, query_parameters, password_event_based_auth_model_with_lockout)\n end", "def update\n # First find user by he token passed from the email, if no user throw a 404\n @user = User.find_by_password_reset_token!(params[:id])\n\n # If token is expired send back to reset page, otherwise attempt to update user, if error then renreder edit password page\n if @user.password_reset_sent_at < 2.hours.ago\n flash[:error] = \"New password token has expired\"\n redirect_to new_password_reset_path\n else\n @user.update_attributes(user_params)\n if @user.save\n flash[:success] = \"Password has been reset\"\n session[:user_id] = @user.id\n redirect_to user_path(@user)\n else\n render :edit\n end\n end\n end", "def fetch_user\n\n @user = User.where(id: @user_validation_hash_obj.user_id).first\n\n return validation_error(\n 'um_rp_9',\n 'invalid_api_params',\n ['invalid_r_t'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank? || [email protected]_eligible_for_reset_passowrd?\n\n success\n\n end", "def unlock(token)\n if lock_tokens.include? token\n remove_lock token\n @lock_info = nil\n\n :no_content\n else\n :forbidden\n end\n end", "def send_unlock_instructions\n raw, enc = Devise.token_generator.generate(self.class, :unlock_token)\n self.unlock_token = enc\n save(validate: false)\n send_devise_notification(:unlock_instructions, raw, {})\n raw\n end", "def unlock\n if unlocked_status == true\n raise ArgumentError.new(\"The door is already unlocked!\")\n else\n door_hash[:unlocked_status] = true\n end\n end", "def authenticate_or_use_token\n if params[:token].blank?\n return current_account.users.authenticate(params[:login], params[:password])\n else\n return current_account.users.first(:conditions => { :admin_login_token => params[:token] })\n end\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(guest_user_id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def user \n @user ||= User.find(decoded_token[:user_id]) if decoded_token\n rescue ActiveRecord::RecordNotFound => e \n raise (ExceptionHandler::InvalidToken, e.message)\n end", "def perform_unlock\n allowed_unlocks = %w(unlocked_five_activities unlocked_ten_activities unlocked_fifty_activities)\n\n unless allowed_unlocks.include?(params[:slug])\n return json_error \"An invalid slug was specified. Only #{allowed_unlocks.join(', ')} are allowed.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n unlock_event = unlocker.unlock!(params[:slug])\n \n if unlock_event\n render json: { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n else\n return json_error unlocker.errors.join(' ')\n end\n end", "def get_user_from_token(token)\n # Heartbeat the session in order to get the user id\n result = Zerodha::User::Refresh.new(\n token: token\n ).call.response\n user_id = result.raw['userID']\n\n if user_id\n return result\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'User could not be found',\n messages: 'User could not be found'\n )\n end\n end", "def unlocked\n where(\n '$or': [\n {\n '$or': [\n { locking_name_field => { '$exists': false } },\n { locked_at_field => { '$exists': false } }\n ]\n },\n {\n '$or': [\n { locking_name_field => { '$eq': nil } },\n { locked_at_field => { '$eq': nil } }\n ]\n },\n { locked_at_field => { '$lt': Time.now.utc - (lock_timeout * 1000) } }\n ]\n )\n end", "def edit\n @user = User.find_by_password_reset_token(params[:token]) \n end", "def force_unlock(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::ForceUnlock,\n parameters, invocation_options)\n end", "def invalid_credentials\n if user = User.active.find_by_login(params[:username].to_s)\n #increment brute-force counter\n set_brute_force_counter(user, get_brute_force_counter(user) + 1)\n #lock the user immediately if detecting a brute force attack\n if brute_forcing?(user)\n set_brute_force_lock_time(user, Time.now + LOCKED_FOR_MINUTES.minutes)\n user.update_attribute(:lock_comment, \"Locked at #{Time.now} after #{MAX_FAILED_ATTEMPTS} erroneous password\")\n user.lock!\n end\n end\n # original action\n super\n \n flash.now[:error] = l(:notice_account_invalid_credentials_or_locked) unless Rails.env == 'test'\n end", "def systemusers_unlock(id, opts = {})\n systemusers_unlock_with_http_info(id, opts)\n return nil\n end", "def unlock\n self.is_locked = false\n self\n end", "def edit\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def edit\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def get_user_from_token(token)\n # Heartbeat the session in order to get the user id\n result = DriveWealth::User::Refresh.new(\n token: token\n ).call.response\n user_id = result.raw['userID']\n\n if user_id\n return result\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'User could not be found',\n messages: 'User could not be found'\n )\n end\n end", "def test_should_lock_expired_users\n User.lock_expired_users\n assert_equal false, users(:user4).active_for_authentication?\n end", "def unlock!\n self.locked_by = nil\n self.locked_at = nil\n save!\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def update\n self.resource = resource_class.reset_password_by_token(resource_params)\n\n if resource.errors.empty?\n resource.unlock_access! if unlockable?(resource)\n flash_message = resource.active_for_authentication? ? :updated_not_active : :updated\n set_flash_message(:notice, flash_message) if is_navigational_format?\n\n respond_with resource, :location => after_resetting_password_path_for(resource)\n else\n respond_with resource\n end\n\n end", "def reset_password\n user = User.find_by(:reset_password_token => params[:token])\n\n if user\n self.establish_session user\n redirect_to profile_url\n else\n # render a 404\n end\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def result_unlock\n\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def unlock_user_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserApi.unlock_user ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling UserApi.unlock_user\"\n end\n # resource path\n local_var_path = '/api/3/users/{id}/lock'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Links')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserApi#unlock_user\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def authenticate_user (temp = false)\r\n token = request.headers['token']\r\n user_token = Token.find_by(access_token: token)\r\n @current_user = nil\r\n if params[:hashtoken].present?\r\n if params[:id].present?\r\n hash_token = TokenEventInvite.where(access_token: params[:hashtoken], event_id: params[:id].to_i).first\r\n if hash_token.present?\r\n user_id = hash_token.user_id\r\n @current_user = User.find_by(id: user_id)\r\n else\r\n @current_user = authenticate_old_event( params[:hashtoken], params[:id].to_i)\r\n end\r\n else\r\n hash_token = TokenUserConfirmation.where(access_token: params[:hashtoken]).first ||\r\n TokenPasswordReset.where(access_token: params[:hashtoken]).first\r\n if hash_token != nil\r\n user_id = hash_token.user_id\r\n @current_user = User.find_by(id: user_id)\r\n else\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'Missing token. Authorization has been denied for this request.'\r\n ), adapter: :json, status: :unauthorized unless temp\r\n return nil\r\n end\r\n end\r\n elsif user_token.present?\r\n user_id = user_token.user_id\r\n @current_user = User.find_by(id: user_id)\r\n if @current_user.present? && request.path.include?(\"/ambassador/\")\r\n @current_user = @current_user.admin.present? ? @current_user.admin : @current_user.av_user\r\n end\r\n else\r\n if token.present?\r\n @current_user = authenticate_old( token)\r\n if @current_user.present?\r\n if @current_user.present? && request.path.include?(\"/ambassador/\")\r\n @current_user = @current_user.admin.present? ? @current_user.admin : @current_user.av_user\r\n end\r\n return nil\r\n else\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'User not found. Authorization has been denied for this request.'\r\n ), adapter: :json, status: :unauthorized unless temp\r\n return nil\r\n end\r\n end\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'Missing token. Authorization has been denied for this request.'\r\n ), adapter: :json, status: :unauthorized unless temp\r\n return nil\r\n end\r\n if @current_user.blank?\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'Bad Request: User not found'\r\n ), adapter: :json, status: :unauthorized unless temp\r\n nil\r\n end\r\n end", "def toggle_locking(current_user)\n if can_toggle_locking?(current_user)\n is_locked? ? unlock : lock(current_user.id) # TODO: raise exception or report error here?\n end\n end", "def unlock\n if job\n job.report_running if report_job_status\n job.set_status(\"Unlocking #{to_s}\")\n end\n\n attempt_unlock\n\n report(true)\n end", "def access_token_user_finder(&blk)\n define_method(:_find_user_by_access_token, &blk)\n end", "def authenticate\n if expired?\n destroy\n return :invalid\n end\n if bounce = user.auth_bounce_reason(self)\n return bounce\n end\n spend\n user\n end", "def create\n @user = User.find_by_email(params[:email])\n \n if @user and not @user.valid_password?(params[:password])\n @user.failed_attempts += 1\n if @user.failed_attempts >= Devise.maximum_attempts\n @user.lock_access!\n end\n @user.save\n @user = nil\n end\n \n if @user and @user.access_locked?\n @user = nil\n end\n \n if @user\n sign_in(:user, @user)\n current_user.reset_authentication_token!\n current_user.save!\n respond_to do |format|\n format.html {\n redirect_to show_token_authentications_path\n }\n format.json { \n redirect_to show_token_authentications_path({:format => :json})\n }\n end\n else\n respond_to do |format|\n format.html {\n redirect_to new_token_authentication_path, :alert => \"incorrect email or password\"\n }\n format.json { \n render :json => {:error => \"incorrect email or password\"}, :callback => params[:callback] \n }\n end\n end\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n unless @user\n @bad_perishable_token = true\n render :action => :new and return\n end\n end", "def if_access_locked\n if access_locked?\n yield\n else\n self.errors.add(Devise.unlock_keys.first, :not_locked)\n false\n end\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:id])\n end", "def get_user_by_token(token)\n decoded = JWT.decode(token, 'somesecrethere')\n now = Time.now().to_i\n\n if (decoded[0][:expires] < now)\n return nil\n end\n\n user = User.find_by uuid: decoded[0][:user_id]\n if (!user)\n return nil\n end\n\n return user\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n # if session[:guest_user_id] invalid\n rescue ActiveRecord::RecordNotFound\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def personal_unlockAccount(account, passphrase, duration)\r\n response = do_request(\"personal_unlockAccount\",[account, passphrase, duration])\r\n response[\"result\"]\r\n end", "def guest_user(allow_create = false)\n if allow_create\n @cached_guest_user ||= User.find(session[:guest_user_id] || create_guest_user.id)\n else\n @cached_guest_user ||= User.find(session[:guest_user_id])\n end\n\n rescue ActiveRecord::RecordNotFound\n # only allow retry if allow_create == true\n session[:guest_user_id] = nil\n guest_user if allow_create\n end", "def guest_user(with_retry = true)\n\t # Cache the value the first time it's gotten.\n\t @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n\t rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n\t \tsession[:guest_user_id] = nil\n\t \tguest_user if with_retry\n\t end", "def update\n self.resource = resource_class.reset_password_by_token(resource_params)\n\n if resource.errors.empty?\n sign_in(resource_name, resource)\n else\n @message = t('Wrong current password')\n end\n end", "def systemusers_unlock_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SystemusersApi.systemusers_unlock ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling SystemusersApi.systemusers_unlock\"\n end\n # resource path\n local_var_path = \"/systemusers/{id}/unlock\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'x-org-id'] = opts[:'x_org_id'] if !opts[:'x_org_id'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['x-api-key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SystemusersApi#systemusers_unlock\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def validate_user\n if self.banned and !self.authentication_token.include?('_banned')\n banned_auth_token = self.authentication_token[0..self.authentication_token.length-7] << '_banned'\n self.update_attribute(:authentication_token, banned_auth_token)\n # also ban his devices\n self.devices.each { |device|\n device.update_attribute(:banned,true)\n }\n elsif !self.banned and self.authentication_token.include?('_banned')\n # unban user\n unbanned_auth_token = self.authentication_token[0..self.authentication_token.length-7] << rand(36**7).to_s(36)\n self.update_attribute(:authentication_token, unbanned_auth_token)\n # also unban his devices\n self.devices.each { |device|\n device.update_attribute(:banned,false)\n }\n end\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def password_block_fingerprint_unlock\n return @password_block_fingerprint_unlock\n end", "def authenticate(password)\n !self.locked? && super\n end", "def recover\n @user = User.find_by password_reset_digest: params[:token]\n if !@user\n flash[:alert] = 'Invalid link'\n redirect_to '/password-recovery/remind-password'\n return\n end\n @token = params[:token]\n end", "def test_entry_unlock\n new_entry = EntryCrypto::PasswordEntry.new \"www.google.ca\", \"test_user\"\n new_user = EntryCrypto::User.new \"master_user\", 1234, \"some secret here\"\n\n # This will do util users have encrypted secrets by default\n new_user.lock(\"fake_pass\")\n new_user.unlock(\"fake_pass\")\n\n new_entry.lock_password(new_user, \"password1234\")\n\n decrypted_password = new_entry.unlock_password(new_user)\n assert decrypted_password == \"password1234\"\n end", "def edit\n @momentum_cms_user = MomentumCms::User.load_from_reset_password_token(params[:id])\n @token = params[:id]\n\n if @momentum_cms_user.blank?\n not_authenticated\n return\n end\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n unless @user\n flash[:notice] = \"We're sorry, but we could not locate your account.\" +\n \"If you are having issues try copying and pasting the URL \" +\n \"from your email into your browser or restarting the \" +\n \"reset password process.\"\n redirect_to root_url\n end\n end", "def edit\n super\n reset_password_token = Devise.token_generator.digest(\n User,\n :reset_password_token,\n resource.reset_password_token\n )\n\n return if reset_password_token.nil?\n\n user = User.where(\n reset_password_token: reset_password_token\n ).first_or_initialize\n\n return if user.reset_password_period_valid?\n\n flash[:alert] = expired_or_invalid_message_for_reset_password_token(user)\n redirect_to(new_user_password_url(user_email: user['email']))\n end", "def unlock\n self.is_locked = false\n self.locked_at = nil\n save!\n end", "def edit\n @token = params[:id]\n @user = Person.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def find_user\n\n @user = User.using_client_shard(client: @client).get_from_memcache(@user_id)\n\n return error_with_data(\n 'sm_gud_fu_1',\n 'Invalid user id',\n 'Invalid user id',\n GlobalConstant::ErrorAction.default,\n {},\n {}\n ) if @user.blank? || @user.client_id != @client_id\n\n success\n end", "def with_user(new_user, new_pass, &block)\n old_user = user\n old_pass = (exists?(password) ? password : '')\n set_user(new_user, new_pass)\n begin\n yield\n rescue Exception => e\n set_user(old_user, old_pass)\n raise e\n end\n set_user(old_user, old_pass)\nend", "def reset_password_with_token\n user = User.first(:perishable_token => params[:token])\n if user.nil? || user.password_reset_sent.to_time < 2.days.ago\n flash[:notice] = \"Your link is no longer valid, please request a new one.\"\n redirect_to \"/forgot_password\"\n else\n @token = params[:token]\n @user = user\n render \"login/password_reset\"\n end\n end", "def authenticate_user_from_token\n unless authenticate_with_http_token { |token, options| User.find_by(auth_token: token) }\n render json: { error: 'Bad Token'}, status: 401\n end\n end", "def password_require_to_unlock_from_idle\n return @password_require_to_unlock_from_idle\n end" ]
[ "0.6594415", "0.64345115", "0.63581157", "0.59941596", "0.5951485", "0.58600414", "0.57720274", "0.5697048", "0.5647684", "0.5565508", "0.5565358", "0.55636567", "0.5550171", "0.55472237", "0.55401915", "0.5538916", "0.55188394", "0.54818016", "0.54125124", "0.53935367", "0.5376289", "0.5335284", "0.5315125", "0.5302482", "0.5292547", "0.52877504", "0.52756447", "0.526509", "0.5257723", "0.5250307", "0.5249114", "0.5244129", "0.52358234", "0.52341783", "0.52336985", "0.52332616", "0.5230403", "0.522714", "0.5198015", "0.5193885", "0.5187627", "0.51833713", "0.51818204", "0.5166744", "0.5165579", "0.51491", "0.513793", "0.5136643", "0.5122402", "0.51203907", "0.5111058", "0.5111058", "0.5111058", "0.5111058", "0.5111058", "0.51101875", "0.50973016", "0.5093671", "0.5092286", "0.5088195", "0.5073059", "0.5071238", "0.5070971", "0.50604314", "0.5050212", "0.50421995", "0.50421995", "0.50418955", "0.50366145", "0.503131", "0.5031115", "0.50253993", "0.5020039", "0.50150615", "0.5010529", "0.49981064", "0.4993442", "0.4991077", "0.49741882", "0.49734628", "0.49603868", "0.49577305", "0.4955495", "0.4955402", "0.495432", "0.49526855", "0.49526855", "0.49491346", "0.4948492", "0.49447685", "0.49404827", "0.49392715", "0.49323252", "0.49255633", "0.49244085", "0.4922881", "0.49207267", "0.49206418", "0.4917692", "0.491327" ]
0.61375755
3
Is the unlock enabled for the given unlock strategy?
def unlock_strategy_enabled?(strategy); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlock_strategy_enabled?(strategy)\n self.unlock_strategy == strategy ||\n (self.unlock_strategy == :both && BOTH_STRATEGIES.include?(strategy))\n end", "def unlockable?(resource)\n \tresource.respond_to?(:unlock_access!) &&\n \tresource.respond_to?(:unlock_strategy_enabled?) &&\n \tresource.unlock_strategy_enabled?(:email)\n\tend", "def lock_strategy_enabled?(strategy)\n self.lock_strategy == strategy\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def unlockable?(resource)\n resource.respond_to?(:unlock_access!) &&\n resource.respond_to?(:unlock_strategy_enabled?) &&\n resource.unlock_strategy_enabled?(:email)\n end", "def lock_strategy_enabled?(strategy); end", "def unlockable?(user)\n user.respond_to?(:unlock_access!) &&\n user.respond_to?(:unlock_strategy_enabled?) &&\n user.unlock_strategy_enabled?(:email)\n end", "def unlocked?\n @unlocked\n end", "def unlocked?\n !locked?\n end", "def can_unlock?(current_user)\n return false if current_user.anonymous?\n\n is_locked? and not is_locked_by_other?(current_user)\n end", "def lock_status?\n return @unlocked == true\n end", "def locked?\n !status_flag?(:kSecUnlockStateStatus)\n end", "def can_unlock?\n SpaceRequestPolicy.can_unlock?(current_user, object)\n end", "def lockable?\n @lockable\n end", "def unlocked?\n not locked?\n end", "def lock?\n record.unlocked? && (director?(record.event) || competition_admin? || super_admin?)\n end", "def is_locked?\n locked\n end", "def unlocked?\n ! File.exist?(lock_file)\n end", "def lockout?\n @lockout\n end", "def locked?\n locksmith.locked?\n end", "def locked?\n fetch_lock_info\n\n obj_exists_and_is_not_type? obj: @lock_info, type: []\n end", "def locked?\n self.is_locked\n end", "def locking_enabled?\n lock_optimistically && columns_hash[locking_column]\n end", "def locked?\n approved? or rejected?\n end", "def lock_expired?\n if unlock_strategy_enabled?(:time)\n locked_at && locked_at < self.class.unlock_in.ago\n else\n false\n end\n end", "def locked?\n end", "def enabled?\n File.exist?(lockfile_path)\n end", "def locked?\n @locked\n end", "def locked_open?\n lock == :open\n end", "def locked?\n self.released?\n end", "def can_unlock?(user, space)\n user.review_space_admin? && space.shared? && space.locked?\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n @locked\n end", "def locked?\n\t\t\t@locked\n\t\tend", "def available?\n return true unless coliding_locks.any?\n end", "def is_locked?\n return true if have_lock?\n begin\n return true unless acquire_lock\n ensure\n release_lock\n end\n false\n end", "def locked?\n @locked\n end", "def able_to_save?\n unlocked? or state_was == 'pending'\n end", "def locked?\n @bridge.device_locked?\n end", "def locked?\n not @lock_name.nil?\n end", "def access_locked?\n !!locked_at && !lock_expired?\n end", "def locked?\n return @locked\n end", "def locked?\n (status & (1 << 0)).zero?\n end", "def lock?\n return true if @_lock_type\n false\n end", "def can_lock?(current_user)\n return false if current_user.anonymous?\n\n not is_locked?\n end", "def locked?\n @mutex.locked?\n end", "def locked?\n if defined?(@locked)\n @locked\n else\n false\n end\n end", "def locked_closed?\n lock == :closed\n end", "def active_for_authentication?\n super and self.locked != 1\n end", "def can_login?\n\t\t\t!disabled? && !locked?\n end", "def locked?\n\t\t\t\t\treturn payment_in_progress? || paid?\n\t\t\t\tend", "def has_lock?\n @has_lock || false\n end", "def locked?\n\t\t\t!lockoutTime.nil? && lockoutTime.to_i != 0\n\t\tend", "def lock_is_exclusive?\n lockscope == 'exclusive'\n end", "def locked?\n revision.locked == 1\n end", "def requirements_unlocked_or_can_be?\n true\n end", "def locking?\n @locking\n end", "def is_locked\n return @is_locked\n end", "def locked?\n !locked_at.nil?\n end", "def device_locked?\n @bridge.device_locked?\n end", "def mon_locked?\n @mon_data.mon_locked?\n end", "def enabled?(thing = nil)\n instrument(:enabled?, thing) { |payload|\n gate_values = adapter.get(self)\n\n gate = gates.detect { |gate|\n gate.open?(thing, gate_values[gate.key])\n }\n\n if gate.nil?\n false\n else\n payload[:gate_name] = gate.name\n true\n end\n }\n end", "def supports_advisory_locks?\n false\n end", "def supports_advisory_locks?\n false\n end", "def locked?(certifier = nil)\n if certifier\n return self.certifier_id.present? && self.certifier_id != certifier.id\n end\n\n return self.locked.present?\n end", "def locked?(obj)\n RedisMutexer.config.redis.exists(key(obj))\n end", "def locked?\n raise NotImplementedError\n end", "def enabled?\n enabled.nil? || enabled\n end", "def locked_out?\n # don't need a mutex because we know #owned? can't change during the call \n locked? && !owned?\n end", "def queueing_locked?\n should_lock_on_queueing? && lock_present?\n end", "def check_unlock\n if params[:slug] != 'max_activities'\n return json_error \"At this time, a user can only unlock for 'max_activities'.\"\n end\n\n unlocker = MaxActivityUnlockerService.new(@authenticated_user)\n\n payload = { \n unlock: (unlocker.next_unlock_event) ? unlocker.next_unlock_event.json : false,\n activities_count: unlocker.activities_count,\n activities_allowed: unlocker.activities_allowed\n }\n\n payload[:highest_level_reached] = true if unlocker.highest_level?\n\n render json: payload \n end", "def locked?\n !!@owner\n end", "def bit_locker_enabled\n return @bit_locker_enabled\n end", "def enabled?\n !disabled?\n end", "def enabled?\n !disabled?\n end", "def enabled?\n inclusively { @enabled }\n end", "def locked?\n File.exist?(lock_file)\n end", "def locked?(key)\n raise NotImplementedError\n end", "def enabled?\n !suspended\n end", "def already_locked?\n lock_stack.last == lock_stack_item\n end", "def locked?\n File.exist?(lock_file)\n end", "def isLocked\n room = Room.find_by_id params[:id]\n\n if room.nil?\n respond_with locked: true\n else\n if room.lock_owner_user_id.nil? || room.room_lock_start.nil? || room.lock_owner_user_id == session[:uid]\n respond_with locked: false\n else\n respond_with locked: true\n end\n end\n end", "def have_lock?\n !!@handle\n end", "def unlocked?\n unlocked, _, @active_worker_timestamp = Sidekiq.redis do |redis| \n redis.multi do\n redis.setnx(@locking_key, @current_worker_timestamp)\n redis.expire(@locking_key, 600)\n redis.get(@locking_key)\n end\n end\n unlocked\n end", "def enabled?(hook)\n @callbacks.key? hook\n end", "def lock_present?(keyspace)\n @storage.read(keyspace.lock_key) == LOCK_VALUE\n end", "def active_for_authentication?\n super && !access_locked?\n end", "def can_lock?\n SpaceRequestPolicy.can_lock?(current_user, object)\n end", "def enabled?\n user.present?\n end", "def is_locked_by_other?(current_user)\n is_locked? and user_locked != current_user.id\n end", "def enabled?\n if @cursor_y == 0\n return true if $game_party.gold > 0\n else\n return true if $game_party.storage_gold > 0\n end\n return false\n end", "def lock_on_sleep?\n get_settings[:lock_on_sleep] != 0\n end", "def insync?(*)\n provider.auth_password_in_sync?\n end", "def enabled?\n return enabled\n end", "def insync?(*)\n provider.priv_password_in_sync?\n end" ]
[ "0.81631064", "0.77457625", "0.7701355", "0.7679772", "0.7670603", "0.7670603", "0.75990593", "0.75990593", "0.75303745", "0.7416163", "0.7095469", "0.6860336", "0.68364763", "0.6784461", "0.6765351", "0.6692122", "0.66738135", "0.6672663", "0.6618205", "0.6505324", "0.6482895", "0.64796114", "0.63941604", "0.63623905", "0.6329179", "0.62966293", "0.62913793", "0.624706", "0.6241544", "0.6241157", "0.62375504", "0.61912686", "0.61866206", "0.6178992", "0.617873", "0.617873", "0.617873", "0.617873", "0.616917", "0.6147656", "0.6139845", "0.612614", "0.61201674", "0.61154246", "0.60918754", "0.6085714", "0.60812026", "0.60741645", "0.6055525", "0.6051536", "0.6045454", "0.6037887", "0.60243475", "0.59944403", "0.5980878", "0.597804", "0.59484494", "0.59222794", "0.5913524", "0.5908455", "0.5907021", "0.5905952", "0.5889516", "0.58853674", "0.588291", "0.58456385", "0.582548", "0.58211416", "0.58211416", "0.5818098", "0.5815509", "0.5815263", "0.5811112", "0.57824427", "0.57672083", "0.57663906", "0.57480896", "0.57456195", "0.5737159", "0.5737159", "0.573312", "0.5728904", "0.5716213", "0.5710121", "0.57047164", "0.56991947", "0.56946796", "0.5692092", "0.5685233", "0.5684439", "0.56834656", "0.56796235", "0.5677219", "0.56655973", "0.5661526", "0.5656496", "0.56556207", "0.5652702", "0.56439376", "0.5643557" ]
0.8422195
0
Update password saving the record and clearing token. Returns true if the passwords are valid and the record was saved, false otherwise. source://devise//lib/devise/models/recoverable.rb37
def reset_password(new_password, new_password_confirmation); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\r\n if valid_password?\r\n super\r\n else\r\n false\r\n end\r\n end", "def update_password\n enc_password = Authentication::Encryptor.digest(password)\n account = Authentication::Account.reset_token_account(reset_password_token)\n account.encrypted_password = enc_password\n account.reset_password_token, account.reset_password_expires_at = nil, nil\n account.save!\n {'success' => true}\n end", "def need_change_password!\n return unless password_expiration_enabled?\n\n need_change_password\n save(validate: false)\n end", "def password_update\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n user = LatoCore::Superuser.find(params[:id])\n if !user || user.session_code != params[:token]\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n user.update(password: params[:password], password_confirmation: params[:password])\n if !user.save\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n\n flash[:success] = CORE_LANG['recover_password']['recover_success']\n redirect_to lato_core.login_path\n end", "def update\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n return unless @user\n if @user.save\n flash[:notice] = t 'password_resets.updated'\n redirect_to @user\n else\n render :action => :edit\n end\n end", "def should_validate_password?\n \tupdating_password || new_record?\n end", "def should_validate_password?\n updating_password || new_record?\n end", "def update\n # Make the password confirmation validation work.\n @user.password_confirmation = params[:user][:password_confirmation]\n\n # Don't require entry of the old password.\n @user.resetting_password = true\n\n # Clear the temporary token and update the password.\n if @user.change_password!(params[:user][:password])\n redirect_to(root_path, notice: t('password_resets.update.password_updated'))\n else\n render action: \"edit\"\n end\n end", "def should_validate_password?\n updating_password || new_record?\n end", "def update_password\n # o e-mail do utilizador está colocado num campo hidden para poder identificar o utilizador que se está a editar\n @user = User.find_by_email(params[:user][:email])\n\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n @user.failed_password_attempt_count = 0;\n\n # guarda user na base de dados\n if @user.save\n # alerta para user criado com sucesso\n flash[:notice] = \"A sua password foi alterada com sucesso.\"\n\n # autentica o user criado\n sign_in @user\n\n redirect_to root_path \n\n else \n render 'edit_password'\n end\n\n end", "def update_password\n # check current password is valid\n if params[:account].present? and [email protected]_password?(params[:account][:current_password])\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Current password incorrectly.\" }\n return\n end\n\n if params[:account].present?\n params[:account].delete(:password) if params[:account][:password].blank?\n params[:account].delete(:password_confirmation) if params[:account][:password].blank? and params[:account][:password_confirmation].blank?\n\n if @account.update_with_password(account_params)\n bypass_sign_in(@account)\n redirect_to gns_core.my_account_backend_accounts_path, flash: { success: \"The new password has been successfully changed.\" }\n else\n if params[:account][:password].nil? or params[:account][:password].length < 6\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"New password must contain at least 6 characters.\" }\n else\n redirect_to gns_core.my_account_backend_accounts_path, flash: { error: \"Repeat password does not match.\" }\n end\n end\n end\n end", "def need_change_password!\n if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float\n need_change_password\n self.save(:validate => false)\n end\n end", "def save\n return false unless valid?\n\n call_ok?(:maintain_user, forgot_password_request)\n end", "def update_password\n @user.password = @new_e_password\n if GlobalConstant::User.auto_blocked_status == @user.status\n # if we had blocked a user for more than a threshhold failed login attemps we set status to blocked\n # now we should reset it to active\n @user.status = GlobalConstant::User.active_status\n @user.failed_login_attempt_count = 0\n end\n @user.save!\n end", "def update\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n @user.attempts = 0\n @user.save\n flash[:notice] = \"Password succesefully updated\"\n redirect_to account_url\n else\n render :action =>:edit\n end\n end", "def admin_pwd_update\n @user = User.find_by_id(params[:user_id])\n @user.validate_pwd = true\n if @user.update(email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])\n # if an admin is updating her own password, we need to get around Devise's automatic sign out\n if @user.id == current_user.id\n sign_in(@user, :bypass => true)\n end\n flash.keep[:notice] = 'The password for \"' + params[:user][:email] + '\" was successfully updated.'\n redirect_to '/users'\n else\n render :admin_pwd\n end\n end", "def password\n if @user.update_with_password(password_params)\n render_update_success @user\n else\n render_failure @user\n end\n end", "def update_password(password_params)\n assign_attributes(password_params)\n return false unless valid?(:update_password)\n\n call_ok?(:maintain_user, update_password_request)\n end", "def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end", "def update\n resource.extend(Devise::Models::DatabaseAuthenticatablePatch)\n resource.update_with_password(resource_params)\n\n yield resource if block_given?\n\n if resource.errors.empty?\n warden.session(scope)['password_expired'] = false\n set_flash_message :notice, :updated\n bypass_sign_in resource, scope: scope\n respond_with({}, location: after_password_expired_update_path_for(resource))\n else\n clean_up_passwords(resource)\n respond_with(resource, action: :show)\n end\n end", "def update_password(old_password, new_password, new_password_confirmation)\n if self.authenticated?(old_password)\n if new_password.blank?\n false\n elsif new_password == new_password_confirmation\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n self.save\n else\n false\n end\n else\n false\n end\n end", "def update_password\n if current_user.update_with_password(update_password_params)\n expose current_user\n else\n error! :invalid_resource, current_user.errors\n end\n end", "def password_changed?\n !@new_password.blank?\n end", "def password_changed?\n !@new_password.blank?\n end", "def check_password_changed\n self.temp_password = nil if ( changed.include?('encrypted_password') && !(changed.include?('temp_password')))\n end", "def update_password\n @user = current_user\n\n if @user.valid_password?(params[:user][:current_password])\n if params[:user][:password] == params[:user][:current_password]\n flash[:notice] = 'Current Password and New Password should not be same.'\n redirect_to(:back)\n elsif @user.update!(user_params)\n flash[:success] = 'Password updated successfully, please login with the new password.'\n redirect_to new_user_session_path\n end\n else\n flash[:notice] = 'Please enter valid current password.'\n redirect_to(:back)\n end\n end", "def password_needed?\n resource.authentications.empty? \\\n ? resource.update_with_password(params[resource_name])\\\n : resource.update_attributes(params[resource_name])\n end", "def call\n validate_equality\n user = context.user\n return if user.update(password: context.user_password_params[:password])\n\n context.fail!(message: user.errors.full_messages)\n end", "def resave\n write_safe\n pa %[The password file has been resaved], :green\n return true\n end", "def password_changed?\n !@new_password.blank?\n end", "def update_password\n @employee = current_employee\n if @employee.update_with_password(params_employee)\n redirect_to root_path\n else\n render :action => \"edit_password\"\n end\n end", "def update_attributes(attributes = {}, options = {})\n %i(password password_confirmation).select do |attr|\n attributes[attr].present?\n end.each do |attr|\n send(\"#{attr}=\", attributes[attr])\n attributes.delete(attr)\n end\n attributes[:encrypted_password] = encrypted_password\n\n return false unless valid?\n\n super(attributes, options)\n end", "def saveSettings\n @user = User.find(params[:id])\n\n #Authenticate old entered password before changing to the new one\n if [email protected](params[:oldPassword]) \n flash[:danger] = \"Old password is incorrect\"\n redirect_to settings_user_path\n else\n if @user.update(user_settings_params)\n flash[:success] = \"Password successfully changed\"\n redirect_to settings_user_path\n else\n render 'settings'\n end\n end\n end", "def update\n @user.update!(\n password: params[:password],\n password_confirmation: params[:password_confirmation],\n reset_password_token: nil,\n reset_password_token_exp: nil\n )\n\n head 204 # rails 5.2 styntax that renders a 204 status and no body\n rescue ActiveRecord::RecordInvalid => e\n handle_errors(e)\n end", "def needs_password_change_email?\n encrypted_password_changed? && persisted?\n end", "def update\n super do |resource|\n # TODO (rspeicher): In Devise master (> 3.4.1), we can set\n # `Devise.sign_in_after_reset_password = false` and avoid this mess.\n if resource.errors.empty? && resource.try(:otp_required_for_login?)\n resource.unlock_access! if unlockable?(resource)\n\n # Since we are not signing this user in, we use the :updated_not_active\n # message which only contains \"Your password was changed successfully.\"\n set_flash_message(:notice, :updated_not_active) if is_flashing_format?\n\n # Redirect to sign in so they can enter 2FA code\n respond_with(resource, location: new_session_path(resource)) and return\n end\n end\n end", "def reset_password() \n self.password_confirmation = self.password = self.login\n \n self.save\n end", "def reset_password(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n\n validates_presence_of :password\n validates_confirmation_of :password\n validates_length_of :password, within: Devise.password_length, allow_blank: true\n\n if errors.empty?\n clear_reset_password_token\n self.status = User.statuses[:active]\n save(validate: false)\n end\n end", "def update_password(passwd = @password)\n validate_before_update\n\n return false if self.errors.any?\n\n cursor = parse \"BEGIN msf.manage_accounts.reset_password_with_answer(:i_username, :i_answer, :i_new_password, :o_status); end;\"\n cursor.bind_param ':i_username', self.username\n cursor.bind_param ':i_answer', @answer, String, 256\n cursor.bind_param ':i_new_password', passwd, String, 32\n exec cursor do\n case cursor[':o_status']\n when 'DONE' : true\n when 'NOT FOUND' : false\n when 'ERROR'\n self.errors.add_to_base 'An error prevented us from resetting your password'\n false\n when 'SAME PASSWORD'\n self.errors.add :password, \"can't be the same as your existing password\"\n false\n end\n end\n end", "def new_password\n if token = LoginToken.find_by_token(params[:token])\n @user = token.user\n if request.post?\n @tmp_user = User.new(params[:user])\n @tmp_user.validate_attributes(:only => [:password, :password_confirmation])\n if @tmp_user.errors.empty?\n User.transaction do\n @user.change_password(params[:user][:password])\n token.destroy\n @user.reset_login_attempts\n end \n flash[:notice] = 'Password changed!'\n return redirect_to(account_url(:action => :login))\n end\n end # request.post?\n else\n flash[:notice] = 'Sorry, this password regeneration request is no longer valid. Please create a new request.'\n return redirect_to(account_url(:action => :forgot_password))\n end\n end", "def update_password\n @user_profile = true\n if request.patch?\n if @user.update_with_password(user_params) # Only :password and :password_confirmation are sent to this action\n # Sign in the user by passing validation in case their password changed\n bypass_sign_in(@user)\n flash[:notice] = \"Password successfully changed.\"\n redirect_to root_path\n else\n if @user.errors.any?\n error_messages = [\"Password could not be updated:\"]\n error_messages << @user.errors.messages.values\n flash[:error] = error_messages.join('<br/>')\n end\n render \"update_password\"\n end\n end\n end", "def update_attributes_and_password(attrs)\n self.assign_attributes(attrs)\n self.valid?\n if self.password.present? && confirm_passwords\n self.password_hash = Digest::SHA256.hexdigest(self.password + Rails.application.secrets.salt)\n end\n if self.errors.empty?\n self.save\n end\n end", "def update\n @user = User.find_by_forgot_password_token(params[:forgot_password_token])\n raise_404 unless good_password_change_request?\n\n @user.password_required!\n if @user.update_attributes(password_params)\n signin_user!(@user)\n flash[:success] = \"Changed password successfully!\"\n redirect_to dashboard_url\n else\n flash.now[:alert] = \"Couldn't change password. See below.\"\n render :reset_password\n end\n end", "def valid_password?(password)\n if legacy_password?\n # Use Devise's secure_compare to avoid timing attacks\n return false unless Devise.secure_compare(encrypted_password,\n User.legacy_password(password))\n\n self.attributes = { password: password,\n password_confirmation: password,\n legacy_password: false }\n\n save!\n end\n\n super password\n end", "def update\n if correct_password_check account_update_params[:current_password]\n \n pw_params = params[:user].permit(:current_password, :password, :password_confirmation, :first_name, :last_name)\n # Handle updating password if they added anything.\n if (current_user.valid_password?(pw_params[:password]) || current_user.valid_password?(pw_params[:password_confirmation]))\n # Passwords are the same, do nothing.\n elsif (pw_params[:password] == pw_params[:password_confirmation] && pw_params[:password].length > 6)\n # Password are different.\n current_user.password = pw_params[:password]\n current_user.password_confirmation = pw_params[:password_confirmation]\n current_user.save!\n flash.alert = \"Success: Password has been changed!\"\n end\n\n \n user_params = params[:user].except(:current_password, :password, :password_confirmation).permit(:first_name, :last_name, :email)\n unless current_user.update!( user_params )\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n\n flash.alert = \"Success: Account has been updated!\"\n redirect_to edit_user_registration_path\n end\n end", "def password_update?(new_pass)\n return false if current_resource.info['rep:password'].end_with?(\n hash_generator(new_pass)\n )\n true\n end", "def reset_password!(user)\n self.class.ignore_blank_passwords = false\n self.password = user[:password]\n self.password_confirmation = user[:password_confirmation]\n save\n end", "def reset_password!(new_password, new_password_confirmation)\n self.password = new_password\n self.password_confirmation = new_password_confirmation\n self.haslocalpw = true # Added this line\n\n if valid?\n clear_reset_password_token\n after_password_reset\n end\n\n save\n end", "def update\n begin\n _params = update_password_params\n if _params[:password].length < Devise.password_length.min\n render json: {errors: [\"Too short password.\"]}, status: :bad_request\n return\n elsif _params[:password].length > Devise.password_length.max\n render json: {errors: [\"Too long password.\"]}, status: :bad_request\n return\n end\n user = User.reset_password_by_token(_params)\n render json: user, status: :ok\n rescue => e\n logger.error(\"Password update failed. #{e.message}\")\n render json: {errors: [\"Password update failed.\"]}, status: :internal_server_error\n return\n end\n end", "def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end", "def update(key, password = nil)\n if !@data[key]\n pa %[There is no password stored for #{key}, so you cannot update it!], :red\n return false\n else\n @data[key][:password] = password || ask_for_password(%[please enter a new password for #{key}], :yellow)\n if @data[key][:password].empty?\n raise ArgumentError, %[Cannot set an empty password!]\n else\n @data[key][:timestamp] = Time.now.to_i\n write_safe\n pa %[The password for #{key} has been updated], :green\n return true\n end\n end\n end", "def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end", "def change_password!(password_attributes)\n unless skip_current_password\n self.current_password = password_attributes[:current_password]\n authenticated = validate_current_password\n else\n authenticated = true\n end\n self.skip_current_password = true\n assign_attributes(password_attributes)\n validated = authenticated && valid?\n self.skip_current_password = nil\n if validated\n update_attribute(:password, password_attributes[:password])\n else\n false\n end\n end", "def need_change_password\n return unless password_expiration_enabled?\n\n self.password_changed_at = nil\n end", "def update_password\n @user = User.find_by_id(current_user.id)\n\n if User.authenticate(@user.username,pwd_params[:current_password])\n if(User.check_password_validity(pwd_params1[:password]))\n if @user.update(pwd_params1)\n flash[:notice] = \"Password was successfully changed.\"\n flash[:color]= \"valid\"\n redirect_to profile_index_path\n else\n render profile_change_password_path\n end\n else\n flash.now[:notice] = \"Password must be minimum of 6 characters.\"\n flash.now[:color]= \"invalid\"\n render profile_change_password_path\n end\n else\n flash.now[:notice] = \"Wrong Current Password.\"\n flash.now[:color]= \"invalid\"\n render profile_change_password_path\n end\n end", "def update\n @user = current_user\n if @user.update_with_password(params[:user])\n if is_navigational_format?\n flash[:notice] = t(\"passwords.update.success\")\n end\n sign_in @user, :bypass => true\n redirect_to edit_user_registration_path\n else\n flash[:error] = t(\"passwords.update.failed\")\n redirect_to :action => :edit\n end\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(@token)\n\n if @user.blank?\n not_authenticated\n return\n end\n\n #makes the password confirmation validation work\n @user.password_confirmation = params[:user][:password_confrimation]\n #clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n redirect_to(users_path, :notice => 'Password successfully updated')\n else\n render \"edit\"\n end\n end", "def valid_password?(password)\n begin\n super(password)\n rescue BCrypt::Errors::InvalidHash\n sha1_password = Digest::SHA1.hexdigest(\"--#{password_salt}--#{password}--\")\n return false unless sha1_password == encrypted_password\n logger.info \"User #{email} is using the old password hashing method, updating attribute.\"\n self.password = password # = BCrypt::Password.create(sha1_password)\n true\n end\n end", "def update\n @user = User.find(current_user.id)\n\n successfully_updated = if needs_password?(@user, params)\n @user.update_with_password(params.require(:user).permit(:city, :email, :image, :mobile, :name, :current_password, :password, :password_confirmation))\n # Rails 3: @user.update_with_password(params[:user])\n else\n # remove the virtual current_password attribute update_without_password\n # doesn't know how to ignore it\n params[:user].delete(:current_password)\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n @user.update_without_password(params.require(:user).permit(:city, :email, :image, :mobile, :name))\n # Rails 3: @user.update_without_password(params[:user])\n end\n\n if successfully_updated\n set_flash_message :notice, :updated\n # Sign in the user bypassing validation in case his password changed\n sign_in @user, :bypass => true\n redirect_to after_update_path_for(@user)\n else\n render \"edit\"\n end\n end", "def update_password\n current_password = params[:current_password]\n correct_password = @account.password\n if current_password == correct_password\n @account.password = params[:account_password]\n flash.now[:message] = \"你的密码已成功修改\" if @account.save\n else\n flash.now[:error_msg] = \"你输入的当前密码不正确, 不能修改密码\"\n end\n \n render :action => \"edit\"\n end", "def save_passwords?\n self.savepwds == 'YES'\n end", "def update\n @profile = Profile.find(params[:id])\n @user = User.find(params[:profile][:user_id])\n\n password_changed = !params[:user][:current_password].nil? && !params[:user][:current_password].empty?\n\n password = params[:user][:password]\n confirmation_password = params[:user][:password_confirmation]\n\n successfully_updated = if password_changed\n\n if (password.nil? || password.blank?) && (confirmation_password.nil? || confirmation_password.blank?)\n\n if password.nil? || password.blank?\n @user.errors.add(:password, I18n.t('activerecord.errors.models.user.attributes.password.blank'))\n end\n\n if confirmation_password.nil? || confirmation_password.blank?\n @user.errors.add(:confirmation_password, I18n.t('activerecord.errors.models.user.attributes.password_confirmation.blank'))\n end\n\n else\n @user.update_with_password(params[:user])\n end\n else\n params[:user].delete(:current_password)\n @user.update_without_password(params[:user])\n end\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile]) && successfully_updated && @user.errors.empty? #&& @user.update_attributes(params[:user])\n format.html { redirect_to '/' }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def password_changed?\n !password.blank?\n end", "def refresh_password\n @user = User.find(session[:user])\n @success = false\n if (!params[:user].blank? && params[:user][:terms_of_service]!=\"0\") or @user.terms_of_service\n @flag = User.check_old_password(params[:old_password], @user.password)\n if @flag\n if (params[:old_password] != params[:new_password])\n if (params[:new_password] == params[:confirm_password])\n if params[:new_password].length >= 6 && params[:new_password].length <= 15\n @user.change_password(params[:new_password])\n @check = \"Password has been updated successfully. \"\n @success = true\n MopMailer.deliver_change_password(@user,params[:new_password],session[:practice_prefix])\n else\n @check = \"The password length should be between 6 and 15 characters long. \"\n end\n else\n @check = \"Passwords dont match. Please reenter the passwords again. \"\n end\n else\n @check = \"New password should not match with existing password. \"\n end\n else\n @check = \"Old password not correct. Password not changed. \"\n end\n else\n @check = \"Please accept the terms of use. \"\n end\n if @success\n msg = \"<font color='green'>#{@check}</font>\"\n else\n msg = \"<font color='red'>#{@check}</font>\"\n end\n flash[:message] = msg\n redirect_to :action => :list\n end", "def update_password\n @user = current_user\n\n # update_password assigns params to user object\n if @user.update_password(password_params)\n redirect_after_successful_password_update\n else\n render('change_password', status: :unprocessable_entity)\n end\n end", "def save_password\n sanitize_credentials\n \n # If user login matches record and passwords match, save password to user account and log them in\n if (@user = User.find_by_login(params[:user_session][:login])) && @user.using_coreg_password?\n if !params[:user_session][:password].blank? && \n (params[:user_session][:password] == params[:password_confirmation])\n @user.password = @user.password_confirmation = params[:user_session][:password]\n @user.save\n session_scoped_by_site do\n @user_session = UserSession.new(@user.reload)\n end\n if @user_session.save\n flash[:notice] = \"Welcome, #{@user.name}\"\n redirect_to account_setup_url\n\n return false\n end\n end \n end\n session_scoped_by_site do\n @user_session = UserSession.new\n end\n \n flash[:error] = \"Invalid login or passwords do not match. Please check your input and try again.\"\n render :action => :choose_password\n end", "def update_with_password(params={})\n current_password = params.delete(:current_password)\n check_password = true\n if params[:password].blank?\n params.delete(:password)\n if params[:password_confirmation].blank?\n params.delete(:password_confirmation)\n check_password = false\n end \n end\n result = if valid_password?(current_password) || !check_password\n update_attributes(params)\n else\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n self.attributes = params\n false\n end\n clean_up_passwords\n result\n end", "def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end", "def will_save_change_to_encrypted_password?\n changed.include? 'encrypted_password'\n end", "def update_password\n @user = User.find(params[:id])\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Your password was updated successfully!\"\n sign_in @user, :bypass => true\n redirect_to root_path\n else\n flash[:error] = \"Error updating password!\"\n redirect_to edit_password_path(@user.authentication_token)\n end\n end", "def update_password\n @user = User.find_by_id_and_reset_password_token(params[:user_id], params[:reset_password_token])\n\n if @user && @user.update_attributes(params[:user])\n @user.reset_token\n session[:user_id] = @user.id\n redirect_to admin_root_url\n else\n render :reset_password\n end\n end", "def attempt_set_password(params)\n p = {}\n p[:password] = params[:password]\n p[:password_confirmation] = params[:password_confirmation]\n p[:password_unset] = 0 \n update_attributes(p)\n end", "def update_password\n @user = User.find(current_user.id)\n unless [email protected]_password? params[:user]\n if @user.update_with_password(params[:user])\n sign_in @user, :bypass => true\n else\n @user.errors[:current_password].shift\n @user.errors.add(:current_password, \"The given password is invalid\")\n render \"change_password\", :user => @user\n end\n else\n render \"change_password\", :user => @user\n end\n end", "def resetting\n pwreset_key_success = false\n until pwreset_key_success\n self.password_reset_key = self.class.make_key\n self.save\n pwreset_key_success = self.errors.on(:password_reset_key).nil? ? true : false\n end\n end", "def update\n valid_hash = Authentication::PasswordValidator.new(\n 'reset_password_token' => reset_params['reset_password_token'],\n 'password' => reset_params['password'],\n 'password_confirmation' => reset_params['password_confirmation']).validate_link\n render_bad_request(valid_hash) && return unless valid_hash['success']\n end", "def update_password(user = {})\n self.attributes = user\n if self.password.blank? or self.password_confirmation.blank?\n self.errors.add(\"password\", \"and confirmation password are required\")\n return false\n elsif self.password.size < 5\n self.errors.add(\"password\", \"must be at least 5 characters\")\n return false\n elsif self.password != self.password_confirmation\n self.errors.add(\"password\", \"does not match the password confirmation\")\n return false\n else\n self.password_hash = Digest::SHA1.hexdigest(self.password)\n self.save(false)\n end\n end", "def valid_password?(password)\n if self.legacy_password_hash.present?\n if ::Digest::MD5.hexdigest(password).upcase == self.legacy_password_hash.upcase\n self.password = password\n self.legacy_password_hash = nil\n self.save!\n true\n else\n false\n end\n else\n super\n end\n end", "def valid_password?(password)\n if self.respond_to?('legacy_password_hash') && self.legacy_password_hash.present?\n if BCrypt::Password.new(self.legacy_password_hash) == password\n self.password = password\n self.legacy_password_hash = nil\n self.save!\n true\n else\n false\n end\n else\n super\n end\n end", "def valid_password?(password_input)\n if using_old_validation?\n Devise.secure_compare(cakephp_password_digest(password_input), self.old_password).tap do |validated|\n if validated\n self.password = password_input\n self.old_password = nil\n self.save(:validate => false)\n end\n end\n else\n super(password_input)\n end\n end", "def password_changed?\n orig_pw_hash = self.instance_variable_get(:@old_password_hash)\n self.new_record? || (!orig_pw_hash.nil? && orig_pw_hash != self.password_hash)\n end", "def update\n @user = User.find(current_user)\n validation = (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n params[:user].delete(\"password\") unless (@user.valid_password?(params[:user][:old_password]) && params[:user][:password]) || (@user.encrypted_password.empty? && params[:user][:password])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n sign_in @user, :bypass => true\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_password_settings\n if params[:user][:password].blank?\n flash[:error] = \"Password can't be blank.\"\n redirect_to password_settings_path\n elsif params[:user][:password]!=params[:user][:password_confirmation]\n flash[:error] = \"Password and Confirm Password don't match.\"\n redirect_to password_settings_path\n else\n @user = Vger::Resources::User.update_password(params[:user])\n if @user.error_messages && @user.error_messages.empty?\n flash[:notice] = \"Password settings saved successfully.\"\n sign_in(:auth_token => @user.authentication_token)\n redirect_user\n else\n flash[:error] = @user.error_messages.join(\"<br/>\").html_safe\n redirect_to password_settings_path\n end\n end\n end", "def set_password=(new_password)\n self.password = Password.create(new_password)\n self.save\n end", "def attempt_set_password(params)\n update_attributes(password: params[:password], password_confirmation: params[:password_confirmation])\n end", "def update_password\n @user = User.find_by_uuid(params[:id])\n if @user.update(user_params_with_password)\n if @user.send_password.present? && @user.send_password.to_i == 1\n @user.send_welcome_email\n end\n flash[:success] = t('messages.default_success')\n redirect_to users_path\n else\n flash[:error] = t('messages.default_error')\n render :edit_password\n end\n end", "def edit_password(user, new_password)\n if @config.restrictions[:password_count_restriction]\n unless new_password >= @config.restrictions[:password_count_restriction].to_i\n return false\n end\n end\n user.password = user.hash_plaintext(new_password)\n user.save_data\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n\n # the next line makes the password confirmation validation work\n @user.password_confirmation = params[:user][:password_confirmation]\n # the next line clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n auto_login(@user,true)\n redirect_to root_path\n else\n redirect_to(edit_password_reset_path, alert: \"Hmm. Our system doesn't seem to accept your password. Try again! Make sure the two passwords matches each other\")\n end\n end", "def update\n self.resource = resource_class.reset_password_by_token(resource_params)\n\n if resource.errors.empty?\n sign_in(resource_name, resource)\n else\n @message = t('Wrong current password')\n end\n end", "def update_with_password(params, *options)\n current_password = params.delete(:current_password)\n\n if params[:password].blank?\n params.delete(:password)\n params.delete(:password_confirmation) if params[:password_confirmation].blank?\n end\n\n result = if params[:password].blank? || valid_password?(current_password) \n update_attributes(params, *options)\n else\n self.assign_attributes(params, *options)\n self.valid?\n self.errors.add(:current_password, current_password.blank? ? :blank : :invalid)\n false\n end\n\n clean_up_passwords\n result\n end", "def password_changed?\n !self.password.blank? or self.encrypted_password.blank?\n end", "def update\n redirect_to new_lost_password_path and return unless @user\n\n # pass is blank\n if params[:user][:password].blank?\n flash[:error]= [\"Please enter a new password.\"]\n render :action => \"edit\"\n\n # success\n elsif @user.update_attributes(params[:user])\n flash[:notice] = \"Password changed successfully. Please sign in. \"\n redirect_to new_session_url\n\n # save errors\n else\n render :action => \"edit\"\n end\n end", "def update_password password, password_confirmation, old_password\n if crypted_password.blank?\n self.password, self.password_confirmation = password, password_confirmation\n elsif authenticated_by_password? old_password\n self.password, self.password_confirmation = password, password_confirmation\n true\n else\n errors.add :base, t(:invalid_old_password)\n false\n end\n end", "def do_change_password_for(user)\n# begin\n User.transaction(user) do\n user.change_password(params[:user][:password], params[:user][:password_confirmation])\n if user.save\n if LoginEngine.config(:use_email_notification)\n UserNotify.deliver_change_password(user, params[:user][:password])\n flash[:notice] = \"Updated password emailed to #{@user.email}\"\n else\n flash[:notice] = \"Password updated.\"\n end\n return true\n else\n flash[:warning] = 'There was a problem saving the password. Please retry.'\n return false\n end\n end\n# rescue\n# flash[:warning] = 'Password could not be changed at this time. Please retry.'\n# end\n end", "def update_password\n @password_change_form = UserChangePasswordForm.new(change_password_params)\n if !@password_change_form.valid?\n render :change_password\n else\n updatePassword = UsersService.updatePassword(change_password_params,current_user)\n if updatePassword\n redirect_to users_path, notice: \"Successfully Update the Password!!!.\"\n else\n redirect_to change_password_user_path, notice: \"New Password and New Confirm Password must be same !!!.\"\n end\n end\n end", "def update\n if user_params[:password].blank?\n user_params.delete(:password)\n user_params.delete(:password_confirmation)\n end\n\n if needs_password?(current_user, user_params)\n save = current_user.update(user_params)\n else\n save = current_user.update_without_password(user_params)\n end\n\n respond_to do |format|\n if save\n format.html { redirect_to current_user.url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n\n # the next line makes the password confirmation validation work\n if params[:user][:password_confirmation] == params[:user][:password]\n # the next line clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n redirect_to(root_path, :notice => 'Password was successfully updated.')\n end\n else\n flash[:danger] = \"Password must match password confirmation.\"\n render :action => \"edit\"\n end\n end", "def see_password!\n self.password_seen_at = Time.now\n self.save!\n end", "def password_updation\n user_id = params[:user_id]\n password = params[:password]\n if password.present?\n @password = User.find(params[:user_id]).update(password: params[:password])\n render json: @password, status: :ok\n else\n render json: { error: 'password can not be nil' }, status: :unauthorized\n end \n end", "def update_password\n @user = current_user\n return unless request.post?\n if User.authenticate(current_user.email, params[:old_password])\n if (params[:password] == params[:password_confirmation])\n current_user.password_confirmation = params[:password_confirmation]\n current_user.password = params[:password]\n if !params[:password].blank? && current_user.save\n flash[:notice] = \"Password changed\" \n redirect_to edit_user_path(current_user)\n else\n flash[:notice] = \"Password not changed\"\n end\n else\n flash[:notice] = \"Password mismatch\"\n @old_password = params[:old_password]\n end\n else\n flash[:notice] = \"Wrong password\" \n end \n end", "def update\n if params[:user][:password].present? || params[:user][:current_password].present?\n super\n else\n @user = User.find(current_user.id)\n if @user.update_without_password(params[:user])\n redirect_to after_update_path_for(@user), :notice => I18n.t(\"devise.registrations.updated\")\n else\n render \"edit\"\n end\n end\n end", "def update_password_changed\n if defined?(will_save_change_to_attribute?)\n return unless (new_record? || will_save_change_to_encrypted_password?) && !will_save_change_to_password_changed_at?\n else\n return unless (new_record? || encrypted_password_changed?) && !password_changed_at_changed?\n end\n\n self.password_changed_at = Time.zone.now\n end" ]
[ "0.72833633", "0.7086768", "0.69720167", "0.6930003", "0.6904759", "0.68557847", "0.68455786", "0.6823045", "0.6819681", "0.67965204", "0.6768048", "0.6762538", "0.67536336", "0.66928506", "0.66741264", "0.6615724", "0.6614644", "0.6607758", "0.6592733", "0.65873754", "0.6586774", "0.6553228", "0.65497243", "0.65497243", "0.6530022", "0.6513751", "0.650757", "0.6498006", "0.64731425", "0.64559853", "0.6446494", "0.64436257", "0.6437769", "0.6435497", "0.64325064", "0.6429713", "0.64162445", "0.64145416", "0.6414107", "0.64107215", "0.6405559", "0.640532", "0.6387016", "0.6376359", "0.6375126", "0.63660765", "0.636508", "0.63641804", "0.6358187", "0.63568705", "0.6356456", "0.63516176", "0.6346704", "0.63452923", "0.634529", "0.6342901", "0.63359594", "0.6335285", "0.6333026", "0.6330668", "0.6326374", "0.63256675", "0.6323018", "0.6322864", "0.6318876", "0.6318599", "0.6314411", "0.6310645", "0.63056254", "0.6297169", "0.6293836", "0.62931997", "0.6291317", "0.6289894", "0.62821406", "0.62780696", "0.6277254", "0.62765193", "0.62691915", "0.6268841", "0.62644047", "0.6263694", "0.6261398", "0.6261041", "0.6260984", "0.6260466", "0.62550217", "0.62524533", "0.62518924", "0.6243772", "0.6239383", "0.6235678", "0.6235001", "0.62346214", "0.6229108", "0.622677", "0.6225196", "0.6225009", "0.6221515", "0.6216278", "0.6214169" ]
0.0
-1
Checks if the reset password token sent is within the limit time. We do this by calculating if the difference between today and the sending date does not exceed the confirm in time configured. Returns true if the resource is not responding to reset_password_sent_at at all. reset_password_within is a model configuration, must always be an integer value. Example: reset_password_within = 1.day and reset_password_sent_at = today reset_password_period_valid? returns true reset_password_within = 5.days and reset_password_sent_at = 4.days.ago reset_password_period_valid? returns true reset_password_within = 5.days and reset_password_sent_at = 5.days.ago reset_password_period_valid? returns false reset_password_within = 0.days reset_password_period_valid? will always return false
def reset_password_period_valid?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_password_period_valid?\n reset_password_within = 3.days\n reset_password_sent_at && reset_password_sent_at.utc >= reset_password_within.ago\n end", "def reset_password_period_valid?\n reset_password_sent_at && Time.at(reset_password_sent_at).to_datetime.utc >= self.class.reset_password_within.ago\n end", "def reset_password_period_valid?\n reset_password_sent_at && reset_password_sent_at.utc >= self.class.reset_password_within.ago.utc\n end", "def confirmation_sms_period_valid?\n confirmation_sms_sent_at && confirmation_sms_sent_at.utc >= self.class.sms_confirm_within.ago\n end", "def confirmation_period_expired?\n self.class.activate_within && self.confirmation_sent_at && (Time.now > self.confirmation_sent_at + self.class.activate_within)\n end", "def confirmation_period_valid?\n self.class.allow_inactivated_access_for.nil? || (confirmation_sent_at && confirmation_sent_at.utc >= self.class.allow_inactivated_access_for.ago)\n end", "def password_reset_expired?\n reset_sent_at < 15.minutes.ago\n end", "def password_token_valid?\n (self.reset_password_sent_at + 4.hours) > Time.now.utc\n end", "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "def confirmation_token_valid?\n (self.confirmation_sent_at + 30.days) > Time.now.utc\n end", "def password_reset_expired?\n reset_sent_at < Settings.timeout_reset_password.hours.ago\n end", "def password_reset_token_expired?\n sent_reset_at < 1.hour.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 15.days.ago\n end", "def password_reset_expired?\n # < \"earlier than\"\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at && (reset_sent_at < 2.hours.ago)\n end", "def password_reset_expired?\n reset_sent_at < 2.weeks.ago\n end", "def is_within?(other_time, leeway = 5)\n is_before?(other_time, leeway) && is_after?(other_time, leeway)\n end", "def password_reset_expired?\r\n reset_sent_at < 2.hours.ago\r\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at.nil? || reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n\t\treset_sent_at < 2.hours.ago\n\tend", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end", "def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end" ]
[ "0.719017", "0.7031897", "0.6912231", "0.64664286", "0.6278525", "0.6125116", "0.5977662", "0.5959428", "0.59548455", "0.59548455", "0.5910932", "0.59026754", "0.58632", "0.5862489", "0.58497024", "0.5846709", "0.5784888", "0.5773969", "0.576762", "0.57606095", "0.5759257", "0.57511574", "0.57511574", "0.57511574", "0.57511574", "0.57511574", "0.57511574", "0.57511574", "0.57511574", "0.5751079", "0.5728584", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.57164544", "0.5714179", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995", "0.5681995" ]
0.0
-1
Resets reset password token and send reset password instructions by email. Returns the token sent in the email. source://devise//lib/devise/models/recoverable.rb50
def send_reset_password_instructions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_reset\n user = User.first\n user.password_reset_token = new_token\n email = EmailAddress.find_by(id: user.primary_email_address_id).email\n UserMailer.password_reset(user, email)\n end", "def send_password_resets\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save!\n NotificationsMailer.password_reset_mail(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save(:validate => false)\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n PasswordMailer.password_reset(self).deliver\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver_now\n end", "def password_reset\n account = Account.first\n account.reset_token = Account.new_token\n AccountMailer.password_reset(account)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save\n UserMailer.password_reset(self).deliver\n end", "def password_reset\n user = Customer.last\n user.reset_token = Customer.new_token\n CustomerMailer.password_reset(user)\n end", "def send_password_reset\n generate_token\n self.password_reset_token_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now \n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n update_attributes!(password_reset_sent_at: Time.zone.now)\n UserMailer.password_reset(self).deliver\n end", "def send_reset_password_instructions\n token = set_reset_password_token\n send_reset_password_instructions_notification(token)\n\n token\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n \tgenerate_reset_token(:password_reset_token)\n \tself.password_reset_sent_at = Time.zone.now\n \tsave!(validate: false)\n \tUserMailer.password_reset(self).deliver\n end", "def password_reset\n \tuser = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver \n end", "def password_reset\n tester = Tester.first\n tester.reset_token = Tester.new_token\n TesterMailer.password_reset(tester)\n end", "def password_reset\n owner = Owner.first\n owner.reset_token = Owner.new_token\n Owner::UserMailer.password_reset(owner)\n end", "def send_password_reset\n self.password_reset_sent_at = Time.now\n update_attribute(:password_reset_token, genrate_tokn(:password_reset_token) )\n UserMailer.password_reset(self).deliver\n end", "def send_reset_password_instructions()\n generate_reset_password_token! if should_generate_reset_token?\n send_devise_notification(:reset_password_instructions)\n end", "def send_password_reset\n self.reset_token = Token.random\n update_columns(reset_digest: Token.digest(reset_token), reset_sent_at: Time.zone.now)\n UserMailer.password_reset(self).deliver_now\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate:false)\n UserMailer.delay.password_reset(self)\n end", "def send_password_reset\n\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def send_reset_password_instructions(email)\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc\n save(validate: false)\n\n send_devise_notification(:reset_password_instructions, raw, {to: email})\n raw\n rescue ArgumentError\n errors.add :base, I18n.t('password.reset_errors.invalid_email')\n return nil\n end", "def send_password_reset\r\n # Generate password reset token\r\n self.password_reset_token = SecureRandom.urlsafe_base64\r\n # Set timestamp of when password reset was sent\r\n self.password_reset_sent_at = Time.zone.now\r\n # Do not run data validation upon saving the user\r\n save!(validate: false)\r\n # Notify the user that password reset instructions have been sent to their email\r\n UserMailer.password_reset(self).deliver\r\n end", "def reset_password\n self.password_reset_token = SecureRandom::uuid\n save!\n UserMailer.send_password_reset_token(self).deliver\n end", "def send_password_reset\n create_password_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n\t generate_token(:password_reset_token)\n\t self.update_attribute(:password_reset_sent_at, Time.zone.now)\n\t #self.password_reset_sent_at = Time.zone.now\n\t #save!\n\t UserMailer.password_reset(self).deliver\n\tend", "def password_reset\n employee = Employee.first\n employee.reset_token = Employee.new_token\n EmployeeMailer.password_reset(employee)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token #присваивается значение токена сброса пароля\n UserMailer.password_reset(user)\n end", "def send_password_reset\n\t\tgenerate_token(:password_reset_token)\n\t\tself.password_reset_sent = Time.zone.now\n\t\tself.save!\n\n\t\tUserMailer.password_reset(self).deliver\n\tend", "def reset_password\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.now\n save!\n UserMailer.delay.password_reset(self)\n end", "def reset_password! \n\t\t\treset_perishable_token! \n\t\t\tNotifier.reset_password(self).deliver \n\t\tend", "def reset_password\n [send_email(MailPart.new_subject(I18n.t('devise.mailer.reset_password_instructions.subject')),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:reset_password],\n reset_pass_call),\n @candidate_mailer_text.token]\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def reset_password\n @user = User.last\n @user.password_reset_token = \"12345\"\n @user.password_reset_sent_at = Time.zone.now\n mail = UserMailer.reset_password(@user)\n end", "def password_reset\n user = Volunteer.first\n user.reset_token = Volunteer.new_token\n VolunteerMailer.password_reset(user)\n end", "def reset_password(email)\n @user = User.find_by_email(email)\n random_password = Array.new(10).map { (65 + rand(58)).chr }.join\n @user.password = random_password\n @user.save!\n# Mailer.create_and_deliver_password_change(@user, random_password)\n# commented out mailer for now as I have no Idea what it is or does. \n\n# Idea - set a reset token on the user model and email it to the user \n# eg http://localhost:9292/reset_password?reset_token=cnu94w3n8c94njevn49an8\n# like we do in rails land\n\nend", "def password_reset\n participant = Participant.first\n participant.reset_token = Participant.new_token\n ParticipantMailer.password_reset(participant)\n end", "def password_reset\n member = Member.first\n member.reset_token = Member.new_token\n MemberMailer.password_reset(member)\n end", "def password_reset(random_token, email)\n @instance_token = random_token\n mail(:to => email, :subject => \"Password Reset\", :bcc =>\"[email protected]\") \n end", "def password_reset\n user = SbUser.first\n user.reset_token = SbUser.new_token\n SbuserMailer.password_reset(user)\n\n end", "def send_reset_password_email(email)\n post password_resets_path, params: {\n password_reset: { email: email }\n }\n end", "def send_reset_password_instructions(admin = Admin.first)\n send_grid_mail = SendGridMail.new(admin, [self])\n _response, token = send_grid_mail.reset_password\n token\n end", "def password_reset\n\t\tshepherd = Shepherd.first\n\t\tshepherd.reset_token = Shepherd.new_token\n ShepherdMailer.password_reset(shepherd)\n end", "def send_password_reset_email\n\t\tUserMailer.password_reset(id, self.reset_token).deliver_later\n \tend", "def send_password_reset_token(user)\n user.set_password_reset_token\n user.password_reset_sent_at = Time.zone.now\n user.save!\n PasswordMailer.password_reset(user).deliver\n end", "def password_reset\nemployee = Employee.first\nemployee.reset_token = Employee.new_token\nEmployeeMailer.password_reset(employee)\nend", "def password_reset\n doctor = Doctor.first\n doctor.reset_token = Doctor.new_token\n DoctorMailer.password_reset(doctor)\n end", "def send_reset_password_instructions(site)\n token = set_reset_password_token\n DeviseMailer.reset_password_instructions(self, token, site).deliver\n token\n end", "def password_reset\n MailerMailer.password_reset\n end", "def password_reset\n user = RailsTutorial::Sample::User.first\n user.reset_token = RailsTutorial::Sample::User.new_token\n RailsTutorial::Sample::UserMailer.password_reset(user)\n end", "def password_reset\n applicant = Applicant.first\n applicant.reset_token = Applicant.new_token\n ApplicantMailer.applicant_password_reset(applicant)\n end", "def password_reset\n user = Investor.first\n user.activation_token = Investor.new_token\n NemabollonMailer.password_reset(user)\n end", "def send_reset_password_instructions\n generate_reset_password_token! if should_generate_reset_token?\n kickoff.deliver_password_reset(self)\n end", "def reset_password\n @user.send_reset_pass_email\n head :no_content\n end", "def send_reset_password_instructions\n end", "def clear_reset_password_token; end", "def send_reset_email\n UserMailer.password_reset(self).deliver_now\n end", "def send_reset_email\n UserMailer.password_reset(self).deliver_now\n end", "def password_reset\n UserMailMailer.password_reset\n end", "def password_reset\n # ShopMailer.password_reset\n shop = Shop.first\n shop.reset_token = Shop.new_token\n ShopMailer.password_reset(shop)\n end", "def password_reset\n AccountMailer.password_reset\n end", "def password_reset\n player = Player.first\n player.reset_token = Player.new_token\n PlayerMailer.password_reset(player)\n end", "def password_reset\n gamer = Gamer.first\n gamer.reset_token = Gamer.new_token\n GamerMailer.password_reset(gamer)\n end", "def send_password_reset\n begin\n self[:password_reset_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:password_reset_token => self[:password_reset_token])\n \n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\nend", "def reset_email\n # User reset email sent.\n end", "def password_reset\n user = User.first || Lecturer.first\n user.reset_token = User.new_token || Lecturer.new_token\n UserMailer.password_reset(user)\n end", "def send_reset_email\n\t\tUserMailer.reset_password(self).deliver_now\n\tend", "def deliver_password_reset_instructions!\n reset_perishable_token!\n Mailer.deliver_password_reset_instructions(self)\n end", "def password_reset\n user = User.first\n user.create_reset_digest\n UserMailer.password_reset(user.id, user.reset_token)\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset\n UserMailer.password_reset\n end", "def password_reset\n ClientMailer.password_reset\n end", "def password_reset(user, token)\n @user = user\n @token = token\n mail(\n to: @user.email,\n from: '[email protected]',\n subject: 'パスワードの再設定'\n )\n end", "def send_password_reset_email\n AdminMailer.password_reset(self).deliver_now\n end", "def reset_password_instructions(user, token, commit)\n @resource = user\n @token = token\n mail(:to => @resource.email, :subject => \"Reset password instructions\", :tag => 'password-reset', :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n mail.delivery_method.settings.merge! @@smtp_settings\n mail\n end", "def reset_password_notify\n user = User.find_by_email(params[:email])\n\n if user\n user.reset_token\n ::NotifierMailer.reset_password_instructions(user).deliver\n flash.now.notice = t('flash.sessions.reset_password_notify.email_sent')\n else\n flash.now.alert = t('flash.sessions.reset_password_notify.user_not_found')\n end\n\n render :reset_password\n end", "def send_password_reset_email\n #UserMailer.password_reset(self).deliver_now\n end", "def send_password_reset_email\n GolferMailer.password_reset(self).deliver_now\n end", "def with_reset_password_token(token); end", "def deliver_password_reset_instructions!\n reset_perishable_token!\n Notifier.password_reset_instructions(self).deliver_now\n end", "def password_reset\n MemberMailer.password_reset\n end", "def password_reset\n\t token = params.first[0]\n\t @user = User.find_by_confirm_token(token)\n\n\t if @user.nil?\n\t flash[:error] = 'You have not requested a password reset.'\n\t return redirect_to :root\t \n\t end\n\n\t if @user.password_expires_after < DateTime.now\n\t clear_password_reset(@user)\n\t @user.save\n\t flash[:error] = 'Password reset has expired. Please request a new password reset.'\n\t redirect_to :forgot_password\n\t end\n\tend" ]
[ "0.82515097", "0.8205227", "0.81245667", "0.8110446", "0.809628", "0.809628", "0.809628", "0.809628", "0.809628", "0.809628", "0.809628", "0.80899125", "0.8083104", "0.80765814", "0.8070898", "0.8070898", "0.8070898", "0.8070898", "0.80595624", "0.80595624", "0.80591774", "0.80508995", "0.80397385", "0.8038211", "0.8018409", "0.8014179", "0.80095243", "0.8006687", "0.7988906", "0.79861325", "0.7959492", "0.7955797", "0.79476273", "0.7946394", "0.7936728", "0.7934177", "0.7931495", "0.792223", "0.79158664", "0.79122573", "0.7906268", "0.7906113", "0.7904909", "0.78991044", "0.7891435", "0.78452027", "0.7844286", "0.78272736", "0.7798793", "0.77935636", "0.7773032", "0.775193", "0.77333724", "0.7733059", "0.7720492", "0.7719622", "0.7707695", "0.7661515", "0.76548034", "0.7624907", "0.76162374", "0.7615118", "0.761003", "0.7601957", "0.7600495", "0.7577429", "0.75759554", "0.75680375", "0.7565231", "0.75554615", "0.7552796", "0.7537949", "0.7527646", "0.75242203", "0.75242203", "0.75179875", "0.749721", "0.74942154", "0.74716526", "0.7463392", "0.7461038", "0.7452485", "0.74489695", "0.7448347", "0.74362844", "0.7414963", "0.74069893", "0.74069893", "0.74069893", "0.7385991", "0.73790824", "0.7372452", "0.73590195", "0.73496187", "0.7347949", "0.731779", "0.7311564", "0.7296457", "0.72933716", "0.7271427" ]
0.7435121
85
Removes reset_password token source://devise//lib/devise/models/recoverable.rb84
def clear_reset_password_token; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_password\n password_reset_token = params[:password_reset_token]\n user = User.find_by_password_reset_token(password_reset_token)\n is_expired = Time.now > user.password_reset_token_expires_at if user\n delete_password_reset_token(user) if is_expired\n if ! user || is_expired\n flash[:error] = I18n.t(:reset_password_token_expired_error)\n redirect_to forgot_password_users_path\n else\n set_current_user(user)\n delete_password_reset_token(user)\n flash[:notice] = I18n.t(:reset_password_enter_new_password_notice)\n redirect_to edit_user_path(user)\n end\n end", "def reset_token!\n token = Devise.friendly_token[0,20]\n self.password = self.password_confirmation = token\n self.email = \"#{name}@scribe\"\n save! validate: false\n token\n end", "def password_reset\n\t token = params.first[0]\n\t @user = User.find_by_confirm_token(token)\n\n\t if @user.nil?\n\t flash[:error] = 'You have not requested a password reset.'\n\t return redirect_to :root\t \n\t end\n\n\t if @user.password_expires_after < DateTime.now\n\t clear_password_reset(@user)\n\t @user.save\n\t flash[:error] = 'Password reset has expired. Please request a new password reset.'\n\t redirect_to :forgot_password\n\t end\n\tend", "def with_reset_password_token(token); end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\r\n token = params.first[0]\r\n @person = Person.find_by_password_reset_token(token)\r\n\r\n if @person.nil?\r\n flash[:error] = 'You have not requested a password reset.'\r\n redirect_to :root\r\n return\r\n end\r\n\r\n if @PERSON.password_expires_after < DateTime.now\r\n clear_password_reset(@person)\r\n @person.save\r\n flash[:error] = 'Password reset has expired. Please request a new password reset.'\r\n redirect_to :forgot_password\r\n end\r\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = User.first \n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n \tuser = User.first\n user.reset_token = User.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = Customer.last\n user.reset_token = Customer.new_token\n CustomerMailer.password_reset(user)\n end", "def password_reset\n user = User.first\n user.reset_token = User.new_token #присваивается значение токена сброса пароля\n UserMailer.password_reset(user)\n end", "def reset_password\n @token = params[:token]\n @user = User.load_from_reset_password_token(@token)\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def require_password_reset!\n token = password_reset_token || build_password_reset_token\n token.reset!\n token\n end", "def password_reset\n\t\tshepherd = Shepherd.first\n\t\tshepherd.reset_token = Shepherd.new_token\n ShepherdMailer.password_reset(shepherd)\n end", "def password_reset(token)\n get(\"/v1/password_resets/#{token}\")\n end", "def reset_reset_token!\n self.set_reset_token\n self.save\n self.reset_token\n end", "def password_reset\n account = Account.first\n account.reset_token = Account.new_token\n AccountMailer.password_reset(account)\n end", "def reset_password_token!\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc\n save(validate: false)\n raw\n end", "def password_reset\n owner = Owner.first\n owner.reset_token = Owner.new_token\n Owner::UserMailer.password_reset(owner)\n end", "def reset_password_token\n generate_token(:reset_password_token)\n end", "def confirm_password_reset!\n if password_resettable?\n password_reset_token.confirm!\n self\n else\n raise Pillowfort::TokenStateError\n end\n end", "def password_reset\n user = User.first\n user.password_reset_token = new_token\n email = EmailAddress.find_by(id: user.primary_email_address_id).email\n UserMailer.password_reset(user, email)\n end", "def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end", "def reset_password_by_token(attributes = {})\n original_token = attributes[:reset_password_token]\n reset_password_token = Devise.token_generator.digest(self, :reset_password_token, original_token)\n\n recoverable = find_or_initialize_with_error_by(:reset_password_token, reset_password_token)\n\n if recoverable.persisted?\n if recoverable.reset_password_period_valid?\n recoverable.reset_password(attributes[:password], attributes[:password_confirmation])\n else\n recoverable.errors.add(:reset_password_token, :expired)\n end\n end\n\n recoverable.reset_password_token = original_token if recoverable.reset_password_token.present?\n recoverable\n end", "def reset_password\n update_attribute(:password_reset_code, nil)\n @reset_password = true\n end", "def password_reset\n user = SbUser.first\n user.reset_token = SbUser.new_token\n SbuserMailer.password_reset(user)\n\n end", "def clear_reset_code\n self.password_reset_code = nil\n self.save\n end", "def reset_password! \n\t\t\treset_perishable_token! \n\t\t\tNotifier.reset_password(self).deliver \n\t\tend", "def password_reset\n tester = Tester.first\n tester.reset_token = Tester.new_token\n TesterMailer.password_reset(tester)\n end", "def password_reset\n user = Volunteer.first\n user.reset_token = Volunteer.new_token\n VolunteerMailer.password_reset(user)\n end", "def reset_password\n if (params[:token] === @current_user.reset_token) && (@current_user.updated_at > DateTime.now - 1)\n @current_user.update(password: params[:password], password_confirmation: params[:confirm_password], reset_token: \"\")\n render \"reset\" if @current_user.errors.any?\n else\n @error = \"Token is expired\"; render \"reset\"\n end\n rescue StandardError => e\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "def password_reset\n member = Member.first\n member.reset_token = Member.new_token\n MemberMailer.password_reset(member)\n end", "def password_reset\n participant = Participant.first\n participant.reset_token = Participant.new_token\n ParticipantMailer.password_reset(participant)\n end", "def reset_password_by_token(attributes={})\n recoverable = find_or_initialize_with_error_by(:reset_password_token, attributes[:reset_password_token])\n if recoverable.persisted?\n if recoverable.reset_password_period_valid?\n recoverable.reset_password!(attributes[:password], attributes[:password_confirmation])\n else\n recoverable.errors.add(:reset_password_token, :expired)\n end\n end\n recoverable\n end", "def reset_password\n\t\tself.password_reset_token = User.new_token\n\t\tupdate_columns(password_reset_digest: User.digest(self.password_reset_token), password_reset_sent_at: Time.zone.now)\n\tend", "def reset_password\n if (params[:token] === @user.reset_token) && (@user.updated_at > DateTime.now - 1)\n @user.update(password: params[:password], password_confirmation: params[:confirm_password], reset_token: \"\")\n render \"reset\" if @user.errors.any?\n else\n @error = \"Token is expired\"; render \"reset\"\n end\n rescue StandardError => e\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "def reset\r\n @user = User.new\r\n\r\n if params[:token].blank?\r\n redirect_to 'password/resetpass'\r\n flash[:danger] = 'Token password reset not present'\r\n end\r\n\r\n token = params[:token].to_s\r\n\r\n if User.exists?(reset_password_token: token)\r\n @user = User.find_by(reset_password_token: token)\r\n if @user.password_token_valid? == false\r\n redirect_to '/password/resetpass'\r\n flash[:danger] = \"Token password reset expired\"\r\n end\r\n else\r\n redirect_to '/password/resetpass'\r\n flash[:danger] = \"Invalid token password reset\"\r\n end\r\n end", "def password_reset\n employee = Employee.first\n employee.reset_token = Employee.new_token\n EmployeeMailer.password_reset(employee)\n end", "def password_reset\n doctor = Doctor.first\n doctor.reset_token = Doctor.new_token\n DoctorMailer.password_reset(doctor)\n end", "def reset_password!\n reset_password\n save_without_session_maintenance(validate: false)\n end", "def reset_password\n self.password_reset_token = SecureRandom::uuid\n save!\n UserMailer.send_password_reset_token(self).deliver\n end", "def password_reset\n user = RailsTutorial::Sample::User.first\n user.reset_token = RailsTutorial::Sample::User.new_token\n RailsTutorial::Sample::UserMailer.password_reset(user)\n end", "def password_reset\n player = Player.first\n player.reset_token = Player.new_token\n PlayerMailer.password_reset(player)\n end", "def reset\n reset_token\n end", "def reset_password\n token = params[:token]\n\n # If the token is valid update the users password\n if @user.verify_token(\"reset_password\", token) &&\n @user.update(params.require(:user).permit(:password, :password_confirmation))\n flash[:success] = I18n.t(\"reset_password.success\")\n redirect_to signin_path\n else\n flash[:alert] = I18n.t(\"reset_password.failed\")\n redirect_to root_path\n end\n end", "def reset_email_token!\n reset_email_token\n save_without_session_maintenance(validate: false)\n end", "def reset_auth_token!\n reset_auth_token\n save(:validate => false)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def reset_authentication_token!\n reset_authentication_token\n save(:validate => false)\n end", "def reset_password\n @user = User.find_by_forgot_password_token(params[:forgot_password_token])\n raise_404 unless good_password_change_request?\n\n @user.reset_password!\n end", "def password_reset\n user = User.first || Lecturer.first\n user.reset_token = User.new_token || Lecturer.new_token\n UserMailer.password_reset(user)\n end", "def password_reset\n user = Investor.first\n user.activation_token = Investor.new_token\n NemabollonMailer.password_reset(user)\n end", "def password_reset\n gamer = Gamer.first\n gamer.reset_token = Gamer.new_token\n GamerMailer.password_reset(gamer)\n end", "def send_password_reset\n\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!(validate: false)\n UserMailer.password_reset(self).deliver\n end", "def forget_password\n Notifier.forget_password\n end", "def reset_password(params)\n user = User.find_by_reset_password_token(params[:token])\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.reset_password!(params[:password], params[:password_confirmation])\n user\n end", "def reset_authentication_token!\n reset_authentication_token\n save(validate: false)\n end", "def generate_password_reset_token\n self.password_reset_token = SecureRandom.urlsafe_base64\n end", "def reset_password\n @user = User.last\n @user.password_reset_token = \"12345\"\n @user.password_reset_sent_at = Time.zone.now\n mail = UserMailer.reset_password(@user)\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save(:validate => false)\n UserMailer.password_reset(self).deliver\n end", "def reset_token\n self.reset_password_token = BCrypt::Engine.generate_salt\n self.save(:validate => false)\n end", "def token\n #@user = User.where(:id => params[:user_id]).first\n #@user.reset_authentication_token!\n redirect_to edit_user_registration_path(@user)\n end", "def reset_password_with_token\n user = User.first(:perishable_token => params[:token])\n if user.nil? || user.password_reset_sent.to_time < 2.days.ago\n flash[:notice] = \"Your link is no longer valid, please request a new one.\"\n redirect_to \"/forgot_password\"\n else\n @token = params[:token]\n @user = user\n render \"login/password_reset\"\n end\n end", "def revoke_token\n raise 'To be implemented in child classes'\n end", "def reset_token\r\n authentication_token true\r\n end", "def reset_password!\n reset_password\n save_without_session_maintenance(false)\n end", "def password_reset\n # ShopMailer.password_reset\n shop = Shop.first\n shop.reset_token = Shop.new_token\n ShopMailer.password_reset(shop)\n end", "def forget\n self.remember_token = nil\n update_attribute(:remember_token_digest, nil)\n end", "def forget\n update_attribute(:remember_token, nil)\n end", "def generate_token\n self.password_reset_token = SecureRandom.urlsafe_base64\n end", "def generate_reset_password_token!\n generate_reset_password_token && save(:validate => false)\n end", "def generate_reset_password_token!\n generate_reset_password_token && save(:validate => false)\n end", "def password_reset\n applicant = Applicant.first\n applicant.reset_token = Applicant.new_token\n ApplicantMailer.applicant_password_reset(applicant)\n end", "def recover\n @user = User.find_by password_reset_digest: params[:token]\n if !@user\n flash[:alert] = 'Invalid link'\n redirect_to '/password-recovery/remind-password'\n return\n end\n @token = params[:token]\n end", "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token\n end", "def reset_password\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.now\n save!\n UserMailer.delay.password_reset(self)\n end", "def reset_authentication_token!\n reset_authentication_token\n self.save\n end", "def check_token_expiration\n return unless @person.password_reset_expired?\n\n flash[:danger] = I18n.t('password_reset.expired_token')\n redirect_to new_password_reset_url\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now \n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_resets\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save!\n NotificationsMailer.password_reset_mail(self).deliver\n end", "def generate_password_token!\n self.reset_password_token = generate_token\n self.reset_password_sent_at = Time.now.utc\n self.save(validate: false)\n end", "def after_password_reset; end", "def reset_password\n friendly_token = Authlogic::Random.friendly_token\n self.password = friendly_token\n self.password_confirmation = friendly_token if self.class.require_password_confirmation\n end", "def generate_reset_password_token\n raw, enc = Devise.token_generator.generate(self.class, :reset_password_token)\n\n self.reset_password_token = enc\n self.reset_password_sent_at = Time.now.utc.next_week\n self.save(validate: false)\n raw\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver \n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n PasswordMailer.password_reset(self).deliver\n end", "def reset_password!(*args)\n self.legacy_password_hash = nil\n super\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n self.save\n UserMailer.password_reset(self).deliver\n end", "def reset_password\n user = User.find_by(reset_password_token: params[:token])\n\n return invalid_reset unless user&.password_token_valid?\n\n if user.reset_password!(params[:password])\n render json: { success: true }, status: 204\n else\n render json: { error: user.errors.full_messages }, status: 422\n end\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver_now\n end", "def reset_authentication_token!\n self.authentication_token = generate_authentication_token\n self.save!\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end", "def send_password_reset\n generate_token(:password_reset_token)\n self.password_reset_sent_at = Time.zone.now\n save!\n UserMailer.password_reset(self).deliver\n end" ]
[ "0.7366555", "0.7248793", "0.7226954", "0.71804905", "0.71676743", "0.71676743", "0.71676743", "0.71676743", "0.71676743", "0.71676743", "0.71676743", "0.71586174", "0.71564573", "0.71336734", "0.71336734", "0.7100255", "0.7064237", "0.70515585", "0.70282996", "0.7009416", "0.70087224", "0.7000267", "0.69958115", "0.6994185", "0.6989469", "0.69844395", "0.69799715", "0.6974594", "0.69632566", "0.694561", "0.69394046", "0.6931321", "0.6907723", "0.6901212", "0.6884241", "0.68708795", "0.68640363", "0.6846748", "0.6844196", "0.683526", "0.6813214", "0.6812158", "0.6798676", "0.67662954", "0.67585176", "0.6748574", "0.6744688", "0.6741309", "0.6737977", "0.6714287", "0.6706653", "0.669549", "0.66928405", "0.669219", "0.66830325", "0.66768855", "0.6670157", "0.66643816", "0.6653473", "0.66437113", "0.66343653", "0.661825", "0.6611517", "0.6601891", "0.65972525", "0.6589829", "0.658175", "0.6568349", "0.6567138", "0.65646666", "0.6562331", "0.6556554", "0.6531418", "0.6528806", "0.6521422", "0.6520543", "0.65165263", "0.65126336", "0.65126336", "0.6506351", "0.6503434", "0.65013546", "0.6494007", "0.64906454", "0.6476658", "0.64758825", "0.64724207", "0.64715976", "0.6466314", "0.646466", "0.6462109", "0.64608824", "0.64605224", "0.64603937", "0.64501536", "0.64455575", "0.64378476", "0.6431462", "0.64277494", "0.64277494" ]
0.8279823
0
Attempt to find a user by its email. If a record is found, send new password instructions to it. If user is not found, returns a new user with an email not found error. Attributes must contain the user's email source://devise//lib/devise/models/recoverable.rb123
def send_reset_password_instructions(attributes = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def find_email\n val = @email\n return if val.nil? \n val = LdapQuery::Scanner.search(val).as_user_attributes[:email] \n if val.nil?\n errors.add :base, 'Email address not found'\n return false\n end\n @email = val\n xdelegate = User.find_by_email(val.to_s)\n if xdelegate.nil?\n errors.add :base, 'Email does not have an account on this website'\n return false\n else\n self.delegate_user_id = xdelegate.id\n end\n\n end", "def find_user_from_invitee_email\n return if invitee_email.nil?\n\n self.user = ::User.find_by(email: invitee_email)\n errors.add(:invitee_email, 'is not a registered user') if user.nil?\n end", "def find_by_email(email)\n sender = Client.get(\"#{path}/find_by_email\", query: { email: email })\n initialize_from_hash(sender['user'])\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def find_by_email(email:)\n users.where(email: email).first\n end", "def findUserByEmail(email)\n method = 'findUser'\n type = User\n args = {:email=>email}\n return_object type,method,args\n end", "def ensure_user_byemail(email, name)\n users = db[:users]\n usr = users.first(:email => email)\n\n if usr.nil?\n\n u = retrieve_user_byemail(email, name)\n\n if u.nil? or u['login'].nil?\n warn \"Could not retrieve user #{email} through search API query\"\n login = (0...8).map { 65.+(rand(25)).chr }.join\n users.insert(:email => email,\n :name => name,\n :login => login,\n :fake => true,\n :deleted => false,\n :created_at => Time.now)\n info \"Added user fake #{login} -> #{email}\"\n users.first(:login => login)\n else\n in_db = users.first(:login => u['login'])\n geo = geolocate(location: u['location'])\n if in_db.nil?\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n info \"Added user #{u['login']} (#{email}) through search API query\"\n else\n in_db.update(:name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n debug \"User #{u['login']} with email #{email} exists\"\n end\n users.first(:login => u['login'])\n end\n else\n debug \"User with email #{email} exists\"\n usr\n end\n end", "def find(email = nil)\n\n # Search cache\n if self.use_cache\n uid = self.cache[email]\n return uid if uid\n end\n\n # Search LDAP for the email address as given\n filter = Net::LDAP::Filter.eq('mail', email)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n\n # The exact email address wasn't found, try the form \"username@domain\" if the username component looks like\n # a username (assumes that usernames do not contain punctuation)\n user, domain = email.split('@')\n unless user.nil? || user.empty? || user.include?('.')\n filter = Net::LDAP::Filter.eq('uid', user)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n end\n\n # No matches found\n nil\n\n end", "def get_user_by_email(email)\n User.find_by(:email => email)\nend", "def user\n user = User.find_by_email(email)\n # return the user if a user with that email is found and the password is valid\n return user if user && user.authenticate(password)\n #.authenticate is an ActiveModel::SecurePassword method\n #.authenticate is included via ActiveRecord inheritance and using has_secure_password in the User model\n #.authenticate returns self if password is correct, otherwise returns false\n\n # Otherwise, add this message to error messages & return nothing\n errors.add(:user_authentication, 'This email and password combination is invalid.')\n nil\n end", "def check_for_existing_user\n user = User.find_for_authentication(email: params[:user][:email])\n if user.present?\n flash[:alert] = t(\".flash_error\")\n redirect_to new_user_session_path(user: { email: params[:user][:email] })\n end\n end", "def find_user_by_email(email: user&.email)\n users = client.list_users(\"active\", {\n filter: email,\n order: \"ascending\",\n page: 1\n })\n\n users.first\n end", "def email\n user.emails.where( email: self.email_id ).first\n end", "def user\n user = User.find_by_email(email)\n return user if user && user.authenticate(password)\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def matching_user\n User.active.where(email: email).first\n end", "def for_user(user)\n find_by(user_email: user.emails)\n end", "def forgot_password(email)\n user = PublicEarth::Db::User.new :email => email\n \n if email.blank?\n user.errors.add(:email, \"You must specify a valid email address.\")\n end\n \n if user.errors.empty?\n begin\n user.attributes = one.forgot_password(email, generate_token)\n rescue\n user.errors.add(:email, \"Unable to locate an account for #{email}.\")\n end\n end\n user\n end", "def find_user_by_email email\r\n response = make_request 'GetShopperByEmail', { :email => email }\r\n return unless valid?\r\n response = response.to_hash[:GetShopperByEmailResponse].try(:[], :GetShopperByEmailResult)\r\n { :first_name => response[:FirstName], :last_name => response[:LastName], :rewards_id => response[:ShopperId] } if response\r\n end", "def user\n @user ||= User.find_by(email: email)\n end", "def user_lookup(email, id = false)\n if id\n send_req({act: :user_lookup, unique_id: email})\n else\n send_req({act: :user_lookup, cloudflare_email: email})\n end\n end", "def email_exist\n user = User.find_for_database_authentication(email: params[:user][:email])\n if user\n render json: {status: 500, message: \"Email is already taken.\"}\n else\n render json: {status: 200, message: \"Email is available.\"}\n end\n end", "def user_by_email(email)\n get(\"get_user_by_email&email=#{email}\")\n end", "def fetch_user\n @user = User.where(email: @email).first\n\n return validation_error(\n 'um_srpl_1',\n 'invalid_api_params',\n ['unrecognized_email'],\n GlobalConstant::ErrorAction.default\n ) unless @user.present? && (@user.status == GlobalConstant::User.active_status)\n\n success\n\n end", "def user\n user = User.find_by_email(email)\n return user if user&.authenticate(password)\n\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def show_by_email\n user = User.get_user_by_email(params[:email]) # Obtain the user corresponding to the id\n\n if user != nil # If exist the user in DB\n response = { content: user, message: \"User has been obtained successfully\", status: 200 } # Return the corresponding user\n\n render json: response, status: 200\n else # If not exist data\n response = { content: {}, message: \"User not found\", status: 404 }\n\n render json: response, status: 404 # Return 'not found'\n end\n end", "def find_user([email protected])\n @user = User.first conditions: {:email => given_mail}\nend", "def new_email(new_email)\n self.errors.clear\n \n if PublicEarth::Db::User.one.find_by_email_ne(new_email)\n self.errors.add(:email, \"The specified email address is not available.\")\n end\n \n if self.errors.empty?\n settings.temp_email = new_email\n settings.save\n\n self.attributes = PublicEarth::Db::User.one.new_email(self.id, PublicEarth::Db::Base::generate_token)\n end\n\n self\n end", "def find_user(params)\n Rails.application.eager_load!\n user = nil\n ActiveRecord::Base.descendants.select {|model| model < Umanage::User}.each do |umodel|\n user ||= umodel.find_by(email: params[:session][:email].downcase)\n end\n return user\n end", "def create\n @user = User.find_by_email(params[:email])\n \n if @user.initiate_password_reset_request!\n UserMailer.password_change_request(@user).deliver if @user.needs_password_reset_mail?\n render :action => \"mail_sent\"\n else\n flash.now[:notice] = \"That email doesn't exist in our system.\"\n render :action => \"new\"\n end\n \n end", "def get_user(id, email)\n users = @client.query(\"SELECT email, status, encrypted_password, salt, expires_on, verified_at FROM users WHERE id = #{id}\")\n return \"couldn't find user with ID #{id}\" if users.size == 0\n return \"found more than one (#{users.size}) users with ID #{id}\" if users.size > 1\n user = users.first\n address, password, salt, status, expiry = [:email, :encrypted_password, :salt, :status, :expires_on].map { |k| user[k] }\n return \"expected email '#{email}' but got '#{address}'\" unless email == address\n return \"expected status OK but got '#{status}'\" unless status == \"OK\"\n return \"expected password but got nothing\" unless password\n return \"expected 32 character password but got #{password.length}\" unless password.length == 32\n return \"expected salt but got nothing\" unless salt\n return \"expected 32 character salt but got #{salt.length}\" unless salt.length == 32\n status = user[:verified_at].present? ? 'ok' : 'pending'\n { password: password, salt: salt, status: status, expiry: expiry }\n rescue Mysql2::Error => e\n return \"mysql error: #{e.message}\"\n rescue => e\n return \"error: #{e.message}\"\n end", "def call\n user = User.find(email: @email)\n\n return user if user&.authenticate(@password)\n\n raise(Exceptions::InvalidEmailOrPassword)\n end", "def register email, pass\n email = email.downcase.strip\n if email != \"[email protected]\" and User.get(email).nil?\n user = User.create({:email=>email,:password=>pass})\n authenticate email, pass\n return user\n elsif authenticate email, pass\n return current_user\n end\n nil\n end", "def get_user_email\n user = User.find(self.user_id)\n user.email\n end", "def lookup_and_create_account( id )\n\n # lookup locally with the default email\n user = User.find_by_email( User.email_from_cid( id ) )\n return user if user.present?\n\n # if we cannot find them, lookup in LDAP\n user_info = user_info_by_cid( id )\n return nil if user_info.nil?\n\n # now look them up with the located email\n user = User.find_by_email( user_info.email )\n return user if user.present?\n\n # create their account\n return User.new_user( user_info, user_info.email )\n end", "def api_user\n user = User.find_by_email(email)\n unless user.present?\n errors.add :message, \"Invalid email\"\n return nil\n end\n\n unless user.authenticate(password)\n errors.add :message, \"Invalid password\"\n return nil\n end\n\n return user\n end", "def find_user_by_email(auth_token, user_email, origin_oem_str)\n return nil if user_email.blank?\n body = { :auth_token => auth_token }\n options = { body: body.to_json,\n method: :get,\n return_err_value: nil,\n query: {email: user_email,\n origin_oem_str: origin_oem_str}\n }\n user = call_external_service_with_service_token(Aylauth::Settings.user_service_base_url + \"/api/v1/public/users/show_by_email.json\", options)\n return if user.blank?\n return UserData.new(user)\n end", "def user_existing_email(user)\n\t\tif user && user.authenticate(params[:homepage][:password]) # normal registered user\n\t\t\tif user.default_locations.count == 0\n\t\t\t\tredirect_to create_first_def_location_path(user_id: user.id)\n\t\t\telse\n\t\t\t\tlog_in user\n\t\t\t\tredirect_to calendar_day_path\n\t\t\tend\n\t\telse # registered user that provides a wrong password\n\t\t\tflash.now[:danger] = ERROR_MESSAGE\n\t\t\trender 'index'\n\t\tend\n\tend", "def recover_password\n person = Person.find_by_email(params[:email])\n\n if person\n UserMailer.recovery(:key => CryptoHelper.encrypt(\"#{person.id}:#{person.salt}\"),\n :email => person.email,\n :username => person.username,\n :domain => APP_CONFIG.server_domain).deliver\n render_json :messages => \"Recovery mail sent to specified address.\", :status => :ok and return\n else\n render_json :messages => \"Record not found.\", :status => :not_found and return\n end\n\n end", "def friend_email=(value)\n new_friend = User.find(:first, :conditions => { :email => value })\n raise(ActiveRecord::RecordNotFound) unless(new_friend)\n self.friend = new_friend\n end", "def with_user user_email, &block\n user = User.where(:email => user_email).first\n yield(user)\n end", "def validate_user\n @user = User.find_by_email(params[:email])\n if !@user \n render 'failure', :locals => {:message => 'User not found', :details => \"User: #{params[:email]}\"}\n end\n end", "def login_user(email, clean_password)\n user_data = User.find_by_email email\n return false unless user_data\n password = user_data.password\n return false unless password == hash_str(clean_password)\n return user_data\n end", "def get_user_by_email(order)\n response = HTTParty.get(\"#{Rails.application.secrets.mapp_integration[:api_endpoint]}\"+\"/user/getByEmail\", headers: headers, query: user_get_by_email_query(order.email))\n user_id_from_response = response.parsed_response[\"id\"]\n\n begin\n if user_id_from_response.nil?\n guest_user_response = Workarea::MappIntegration::MappIntegrationGateway.new.user_creation_for_guest_user(order)\n user_id = guest_user_response.parsed_response[\"id\"]\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id)\n else\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id_from_response)\n end\n rescue Timeout::Error => e\n Rails.logger.info \"Rescued #{e.message}\"\n end\n end", "def userbyemail\n user = User.find_by_email(params[:email])\n \n if user\n render json: user\n else\n render json: { :success => false }\n end\n end", "def user_info_by_email( email )\n id = User.cid_from_email( email )\n return user_info_by_cid( id )\n end", "def find_or_initialize_with_error_by_email(value, error)\n if value.present?\n record = find_by_email(value)\n end\n \n unless record\n record = new\n \n if value.present?\n record.email = value\n else\n error = :blank\n end\n \n record.errors.add(:email, error)\n end\n \n record\n end", "def find_or_create_user\n @user = User.find_by(email: auth_email)\n @user ||= create_new_user\n save_omniauth_details\n\n @user\n end", "def me\n User.find_by_email '[email protected]'\nend", "def does_user_exist?(email)\n user = User.find_by(email: email)\n if user\n return true\n else\n return false\n end\nend", "def create\n @user = User.find_by_email(params[:email])\n if @user\n @user.deliver_password_reset_instructions!\n flash[:notice] = t 'password_resets.instructions_are_sent'\n redirect_to login_path\n else\n flash.now[:error] = t 'password_resets.no_email', :email => params[:email]\n render :action => :new\n end\n end", "def create\n @user = User.find_by_email(params[:email])\n if @user\n @user.deliver_password_reset_instructions!\n flash[:notice] = \"Instructions to reset your account have been emaild to you. \" +\n \"Please check your email\"\n redirect_to root_url\n else\n flash[:notice] = \"No user was found with that email address\"\n render :action => new\n end\n end", "def user\n\t\taccount = Account.find_by_email(email)\n\t\t# If everything is true, the user will be returned\n\t\treturn account if account && account.valid_password?(password) #account.authenticate(password) #user&.authenticate?(password) #user && user.authenticate(password) \n\t\t# If not, the method will return nil\n\t\terrors.add :user_authentication, 'invalid credentials' \n\t\tnil \n\tend", "def email\n user.present? ? user.email : self[:email]\n end", "def find_by_unconfirmed_email_with_errors(attributes = T.unsafe(nil)); end", "def unique_email_user\n if self.class.where(email: email).count > 0\n errors.add(:email, :taken)\n end\n end", "def login(name_or_email, plain_password)\n name_or_email.downcase! # \n if name_or_email.include?(\"@\")\n user = User.find_by_email(name_or_email)\n else\n user = User.find_by_username(name_or_email)\n end\n if user == nil || user.password != plain_password || !user.validated\n user = nil\n end\n return user\nend", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound\n cookies.delete :guest_user_email\n guest_user\n end", "def create\n @user = User.find_by_email(params[:email])\n if @user\n @user.deliver_password_reset_instructions!\n flash[:notice] = \"Instructions to reset your password have been emailed to you. \" +\n \"Please check your email.\"\n redirect_to root_url\n else\n flash[:notice] = \"No user was found with that email address\"\n render :action => :new\n end\n end", "def email_credential\n user.credentials.where(name: email).first\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=\n User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound #\n cookies.delete :guest_user_email\n guest_user\n end", "def has_existing_email?\n User.find_by_email(self.email).present?\n end", "def identify(username_or_email)\n return nil if username_or_email.blank? or username_or_email == 'Public'\n \n if username_or_email =~ /@/ \n active.find_by_email(username_or_email)\n else\n active.find_by_username(username_or_email)\n end \n end", "def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end", "def set_user_email\n @user_email = UserEmail.find(params[:id])\n end", "def search_user_by_email\n @users = User.get_all_users(current_user).where(email:params[:email], is_active: true).first\n get_tenants_user(@users)\n end", "def create\n @<%=model_name %> = <%=class_name %>.find_by_email(params[:email])\n \n if @<%=model_name %>.initiate_password_reset_request!\n <%= class_name %>Mailer.password_change_request(@<%= model_name %>).deliver if @<%= model_name %>.needs_password_reset_mail?\n render :action => \"mail_sent\"\n else\n flash.now[:notice] = \"That email doesn't exist in our system.\"\n render :action => \"new\"\n end\n \n end", "def me\n User.find_by_email(\"[email protected]\") || User.find_by_email('[email protected]')\nend", "def create\n @user = User.find_by_email(params[:email])\n\n if @user\n UserMailer.forgot_password_email(@user).deliver!\n\n flash[:success] = \"Check your email for a link to reset your password. The link expires in 30 minutes.\"\n redirect_to root_url\n else\n flash.now[:alert] = \"We don't have anyone under \\\"#{params[:email]}\\\"\"\n render :new\n end\n end", "def create \n @user = User.find_by_email(params[:email])\n\n # This line sends an email to the user with instructions on how to reset their password (a url with a random token)\n if @user\n if @user.crypted_password.blank? && @user.authorizations.where(login:true).length > 0\n flash[:display] = \"login\"\n redirect_to(login_path, notice: \"Looks like you used #{@user.authorizations.where(login:true).take.provider.capitalize} to sign up. Please login with #{@user.authorizations.where(login:true).take.provider.capitalize}\")\n else\n @user.deliver_reset_password_instructions!\n flash[:success] = \"We sent the password reset email to #{params[:email]}. Check your email and follow the instructions to reset your login\"\n flash[:display] = \"login\"\n redirect_to(login_path)\n end\n else\n flash[:display] = \"login\"\n redirect_to(login_path, alert: \"Oops. We can't seem to find any user with the email #{params[:email]}. Is it entered correctly?\")\n end\n end", "def username_by_email(email)\n request = client.search_users(email)\n if (request[:total_count]).zero?\n raise GithubIntegration::UsernameResolveException, \"User with email '#{email}' was not found\"\n end\n request[:items].first[:login]\n end", "def user_with_email(email)\n client = self\n MagicBell::User.new(client, \"email\" => email)\n end", "def change_email(new_email)\n self.errors.clear\n \n if PublicEarth::Db::User.one.find_by_email_ne(new_email)\n self.errors.add(:email, \"The specified email address is not available.\")\n end\n \n if self.errors.empty?\n self.attributes = PublicEarth::Db::User.one.update_email(self.id, new_email) \n end\n \n self\n end", "def authenticate(email, password)\n # Because we use bcrypt we can't do this query in one part, first\n # we need to fetch the potential user\n user = User.find_by(email: email)\n\n if user\n # Then compare the provided password against the hashed one in the db.\n if BCrypt::Password.new(user.password).is_password? password\n # If they match we return the user\n return user\n end\n end\n # If we get here it means either there's no user with that email, or the wrong\n # password was provided. But we don't want to let an attacker know which.\n return nil\n end", "def identify_user\n user_email = params[:email]\n response = User.identify_user(user_email)\n render json: response\n end", "def forgot_password_create\n user = User.first(:email => params[:email])\n if user.nil?\n flash[:notice] = \"Your account could not be found, please check your email and try again.\"\n render \"login/forgot_password\"\n else\n Notifier.send_forgot_password_notification(user.email, user.set_password_reset_token)\n # Redirect to try to avoid repost issues\n session[:fp_email] = user.email\n redirect_to '/forgot_password_confirm'\n end\n end", "def check_email\n if params[:user][:email].present?\n @user = User.find_by_email(params[:user][:email]) || User.find_by_email(params[:user][:email])\n else \n end\n respond_to do |format|\n format.json { render :json => !@user }\n end\n end", "def create\n @user = User.find_by_email(user_params[:email]) if user_params[:email].present?\n\n if @user\n # Reset session when logged in user resets his password\n logout if logged_in?\n # This line sends an email to the user with instructions on how to reset their password (a url with a random token)\n @user.deliver_reset_password_instructions!\n end\n # Tell the user instructions have been sent whether or not email was found.\n # This is to not leak information to attackers about which emails exist in the system.\n render\n end", "def create\n @user = User.find_by_email(params[:email])\n respond_to do |format|\n if @user\n if @user.send_reset_password_instructions\n format.json { render json: @user }\n else\n format.text { render text: \"Email can't be sent to your email address. Please try again!\", status: :unprocessable_entity }\n end\n else\n format.text { render text: \"Could not find user with email\", status: :unprocessable_entity }\n end\n end\n\n end", "def set_email\n @user_email = UserEmail.find(params[:id])\n end", "def check_if_email_already_registered\n user = User.using_client_shard(client: @client).where(client_id: @client_id, email: @email).first\n\n return error_with_data(\n 'um_su_2',\n 'Registration Error',\n '',\n GlobalConstant::ErrorAction.default,\n {},\n {email: 'Email address is already registered'}\n ) if user.present?\n\n success\n end", "def email_already_exists?(email)\n if User.exists?(email: email)\n flash[:alert] = 'A user with that email address already exists!'\n return flash\n end\n end", "def recover_password params\n user = find_with_email(params[:email])\n user.send_recover_password\n end", "def create\n @user = User.find_by_email(params[:password][:email])\n\n if @user\n @user.deliver_reset_password_instructions!\n send_recovery_email\n redirect_to(sign_in_path,\n notice: I18n.t(\"messages.password.create.success\"))\n else\n flash.now[:error] = I18n.t(\"errors.password.invalid\")\n render(:new)\n end\n end", "def validate_email\n if User.find_by(email: params[:email]).present?\n render_error :unprocessable_entity, I18n.t('common.messages.registrations.duplicate_email')\n else\n render_response\n end\n end", "def email\n self.user.try(:email) || self.original_email\n end", "def email\n self.user.try(:email) || self.original_email\n end", "def new\n super\n @user=User.where(params[:email]).first\n end", "def registered_user_with_login_credentials\n login_credentials = decoded_credentials\n unless login_credentials.blank?\n email = login_credentials[0]\n password = login_credentials[1]\n registered_user = RegisteredUser.where(email: email).first\n if registered_user && registered_user.valid_password?(password)\n return registered_user\n else\n return nil\n end\n end\n end", "def user_authenticated_with_warden email, password\n user = User.where(email: email).first\n if user && user.valid_password?(password)\n user\n else\n nil\n end\n end", "def find_or_create_record\n\n #check if the email has already signed up.\n manager_record = Manager.where(email: @email).first\n\n if manager_record.present?\n return validation_error(\n 'am_w_e_2',\n 'invalid_api_params',\n ['email_already_signed_up'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n record = ManagerWhitelisting.where(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n ).first\n\n if record.present?\n return validation_error(\n 'am_w_e_3',\n 'invalid_api_params',\n ['email_already_whitelisted'],\n GlobalConstant::ErrorAction.default\n )\n end\n\n create_response = ManagerWhitelisting.create!(\n kind: GlobalConstant::ManagerWhitelisting.email_kind,\n identifier: @email\n )\n\n template_vars = { company_web_domain: CGI.escape(GlobalConstant::CompanyWeb.domain) }\n\n r = ::Email::HookCreator::SendTransactionalMail.new(\n receiver_entity_id: create_response.id,\n receiver_entity_kind: GlobalConstant::EmailServiceApiCallHook.whitelisting_requester_kind,\n template_name: GlobalConstant::PepoCampaigns.platform_whitelisting_done_template,\n template_vars: template_vars).perform\n return r unless r.success?\n\n success\n\n end", "def email_taken\n email = params[:user][:email].downcase\n render :json => User.find_by_email(email).nil?\n end", "def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end", "def authenticate(email, password)\n user = User.find_for_authentication(email: email)\n user.try(:valid_password?, password) ? user : nil\n end", "def email_exists?(email)\n return User.find_by_email(email.downcase) != nil\nend", "def check_user\n return nil unless userlogin_signed_in?\n\n User.find_by(email: current_userlogin.email)\n end", "def authenticate(email, password)\n user = User.find_by_email(email) #find user exist in db\n return user if user && user.password == password #authenticate pwd\n nil\n end", "def find_friend_by_email\n begin\n @friend_id = User.find_by(email: params[:email]).id\n rescue\n render json: {error: \"Friend not found\"}, status: 404\n end\n end", "def use_crypted_email\n begin\n if params[:f] || login_required\n @fan = Fan.find(:first, :conditions => [\"id = ? AND crypted_email = ?\", params[:id], params[:f]]) \n end\n if @fan.nil? && login_required\n @fan = Fan.find(params[:id])\n end\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Fan not found.\"\n redirect_to home_path\n end\n end", "def seller_email\r\n user.email rescue nil\r\n end" ]
[ "0.7761273", "0.7589866", "0.7378893", "0.6955551", "0.6955379", "0.6953675", "0.69320935", "0.69318366", "0.6923221", "0.69150925", "0.6903313", "0.6855238", "0.6822204", "0.68176556", "0.6700228", "0.66784024", "0.66736466", "0.66692185", "0.664485", "0.6636257", "0.6629487", "0.66242194", "0.66054136", "0.66039884", "0.6596602", "0.65797216", "0.6547114", "0.65133405", "0.6492811", "0.6487324", "0.6484484", "0.6483223", "0.647524", "0.64689946", "0.6461634", "0.64385974", "0.6432044", "0.6399645", "0.63782895", "0.63771296", "0.636603", "0.63495255", "0.6336909", "0.6336897", "0.6334737", "0.63304496", "0.6330372", "0.63230574", "0.63196206", "0.63075554", "0.6306449", "0.6299089", "0.6298116", "0.62962836", "0.6291024", "0.6289284", "0.62800395", "0.6277232", "0.62733567", "0.6262077", "0.62592566", "0.62549806", "0.62511265", "0.6248201", "0.62391794", "0.6232862", "0.6227079", "0.6217388", "0.62020826", "0.61978143", "0.61973447", "0.61952376", "0.6175219", "0.61732674", "0.61623704", "0.6157798", "0.61572057", "0.6156716", "0.6156386", "0.61539155", "0.61451983", "0.61437136", "0.6142965", "0.61423314", "0.61390734", "0.61386466", "0.6131277", "0.6131277", "0.612744", "0.6125875", "0.6125711", "0.6123701", "0.61223733", "0.612182", "0.61166507", "0.61133677", "0.6103319", "0.6089138", "0.60887426", "0.6078558", "0.6069831" ]
0.0
-1
Attempt to find a user by password reset token. If a user is found, return it If a user is not found, return nil source://devise//lib/devise/models/recoverable.rb114
def with_reset_password_token(token); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_password\n @token = params[:token]\n @user = User.load_from_reset_password_token(@token)\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def reset_password\n user = User.find_by(:reset_password_token => params[:token])\n\n if user\n self.establish_session user\n redirect_to profile_url\n else\n # render a 404\n end\n end", "def recover\n @user = User.find_by password_reset_digest: params[:token]\n if !@user\n flash[:alert] = 'Invalid link'\n redirect_to '/password-recovery/remind-password'\n return\n end\n @token = params[:token]\n end", "def edit\n @user = User.find_by_password_reset_token(params[:token]) \n end", "def reset_password\n @user = User.find_by_id_and_reset_password_token(params[:user_id], params[:reset_password_token])\n end", "def reset_password_valid\n @user = User.where(:id => params[:id], :reset_password_token => params[:reset_password_token]).first\n head (@user.nil? ? :forbidden : :ok)\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:id])\n end", "def get_user_by_token(token)\n decoded = JWT.decode(token, 'somesecrethere')\n now = Time.now().to_i\n\n if (decoded[0][:expires] < now)\n return nil\n end\n\n user = User.find_by uuid: decoded[0][:user_id]\n if (!user)\n return nil\n end\n\n return user\n end", "def user \n @user ||= User.find(decoded_token[:user_id]) if decoded_token\n rescue ActiveRecord::RecordNotFound => e \n raise (ExceptionHandler::InvalidToken, e.message)\n end", "def update\n # First find user by he token passed from the email, if no user throw a 404\n @user = User.find_by_password_reset_token!(params[:id])\n\n # If token is expired send back to reset page, otherwise attempt to update user, if error then renreder edit password page\n if @user.password_reset_sent_at < 2.hours.ago\n flash[:error] = \"New password token has expired\"\n redirect_to new_password_reset_path\n else\n @user.update_attributes(user_params)\n if @user.save\n flash[:success] = \"Password has been reset\"\n session[:user_id] = @user.id\n redirect_to user_path(@user)\n else\n render :edit\n end\n end\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:user_id])\n rescue ActiveRecord::RecordNotFound\n redirect_to new_password_reset_path, :flash => {:error => \"Password reset link has expired.\"}\n end", "def edit\n # Find user in DB by password reset token\n \t@user = User.find_by_password_reset_token!(params[:id])\n end", "def fetch_user_from_auth_token\n @user = decode_auth_token ? User.find(decode_auth_token['user_id']) : nil\n errors.add(:token, 'invalid token') if @user.nil?\n @user\n end", "def user\n # find a User matching the decoded token if the decode operation was successfull\n user = User.find(decoded_auth_token[:user_id]) if decoded_auth_token\n\n if user\n # return the user if active\n return user if user.active\n\n # Else raise a JWTException Inactive Account\n raise(API::JWTExceptionHandler::InactiveAccount, APIMessages.account_not_active)\n end\n rescue ActiveRecord::RecordNotFound => e\n # Raise an Invalid Token if there is no matching User from db\n raise(API::JWTExceptionHandler::InvalidToken, (\"#{APIMessages.invalid_token} #{e.message}\"))\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n unless @user\n flash[:notice] = \"We're sorry, but we could not locate your account.\" +\n \"If you are having issues try copying and pasting the URL \" +\n \"from your email into your browser or restarting the \" +\n \"reset password process.\"\n redirect_to root_url\n end\n end", "def find_by_token(encoded)\n token = Token.new(encoded: encoded)\n if token.valid?\n uid = token.payload[:uid] if token.payload\n User.find_by_id(uid)\n end\n end", "def find_user(params)\n Rails.application.eager_load!\n user = nil\n ActiveRecord::Base.descendants.select {|model| model < Umanage::User}.each do |umodel|\n user ||= umodel.find_by(email: params[:session][:email].downcase)\n end\n return user\n end", "def reset\r\n @user = User.new\r\n\r\n if params[:token].blank?\r\n redirect_to 'password/resetpass'\r\n flash[:danger] = 'Token password reset not present'\r\n end\r\n\r\n token = params[:token].to_s\r\n\r\n if User.exists?(reset_password_token: token)\r\n @user = User.find_by(reset_password_token: token)\r\n if @user.password_token_valid? == false\r\n redirect_to '/password/resetpass'\r\n flash[:danger] = \"Token password reset expired\"\r\n end\r\n else\r\n redirect_to '/password/resetpass'\r\n flash[:danger] = \"Invalid token password reset\"\r\n end\r\n end", "def get_user_from_token(token)\n # Heartbeat the session in order to get the user id\n result = Zerodha::User::Refresh.new(\n token: token\n ).call.response\n user_id = result.raw['userID']\n\n if user_id\n return result\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'User could not be found',\n messages: 'User could not be found'\n )\n end\n end", "def issue_reset_password_token(params)\n user = User.find_by_email(params[:email])\n if user.nil?\n fail BadRequestError.new(code: :not_exists, field: :email), \"Not exists email.\"\n end\n\n user.tap(&:issue_reset_password_token!)\n end", "def edit\n\t @user = User.find_by_password_reset_token!(params[:id])\n\tend", "def find_by_password_reset_token(email, secret, &block)\n Pillowfort::Helpers::DeprecationHelper.warn(self.name, :find_by_password_reset_token, :find_by_password_reset_secret)\n find_by_password_reset_secret(email, secret, &block)\n end", "def find_user\n login_email = params[:user][:email].downcase\n User.find_by(email: login_email) || AdminUser.find_by(email: login_email)\n end", "def reset_password(params)\n user = User.find_by_reset_password_token(params[:token])\n if user.nil?\n fail BadRequestError.user_not_found(:token), \"User not found by token.\"\n end\n\n user.reset_password!(params[:password], params[:password_confirmation])\n user\n end", "def reset_password_with_token\n user = User.first(:perishable_token => params[:token])\n if user.nil? || user.password_reset_sent.to_time < 2.days.ago\n flash[:notice] = \"Your link is no longer valid, please request a new one.\"\n redirect_to \"/forgot_password\"\n else\n @token = params[:token]\n @user = user\n render \"login/password_reset\"\n end\n end", "def user\n user = User.find_by_email(email)\n return user if user&.authenticate(password)\n\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def get_user_from_token(token)\n # Heartbeat the session in order to get the user id\n result = DriveWealth::User::Refresh.new(\n token: token\n ).call.response\n user_id = result.raw['userID']\n\n if user_id\n return result\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'User could not be found',\n messages: 'User could not be found'\n )\n end\n end", "def edit\n @user = User.find_by_password_reset_token!(params[:id])\n if !params[:password_reset_confirmation].nil? && params[:password_reset_confirmation]==\"no\"\n redirect_to root_url, :flash => {:notice => \"Thank you for verifying your profile! \"} and return\n end\n rescue ActiveRecord::RecordNotFound\n redirect_to new_password_reset_path, :flash => {:error => \"Password reset link is invalid.\"}\n end", "def user\n @user ||= User.find(decoded_auth_token[:user_id]) if decoded_auth_token\n @user || errors.add(:token, 'Invalid Token') && nil\n end", "def user\n user = User.find_by_email(email)\n return user if user && user.authenticate(password)\n errors.add :user_authentication, 'invalid credentials'\n nil\n end", "def load_user_using_perishable_token\n @user = User.find_using_perishable_token(params[:id])\n flash[:notice] = :id\n unless @user\n #flash[:notice] = \"We are sorry, but we could not locate your account. \" +\n #{}\"If you are having issues try coping and pasting the URL\" +\n #{}\"from your email into your browser or restarting the \" +\n #{}\"reset password process.\"\n redirect_to root_url\n end\n end", "def authenticate_or_use_token\n if params[:token].blank?\n return current_account.users.authenticate(params[:login], params[:password])\n else\n return current_account.users.first(:conditions => { :admin_login_token => params[:token] })\n end\n end", "def forgot_password\n # verify user\n @user = User.find_by(email: params[:email], token: params[:token])\n if @user\n render\n else\n redirect_to home_path, alert: 'Go away, wrong credentials!'\n end\n end", "def registered_user_with_login_credentials\n login_credentials = decoded_credentials\n unless login_credentials.blank?\n email = login_credentials[0]\n password = login_credentials[1]\n registered_user = RegisteredUser.where(email: email).first\n if registered_user && registered_user.valid_password?(password)\n return registered_user\n else\n return nil\n end\n end\n end", "def user\n user = User.find_by_email(email)\n # return the user if a user with that email is found and the password is valid\n return user if user && user.authenticate(password)\n #.authenticate is an ActiveModel::SecurePassword method\n #.authenticate is included via ActiveRecord inheritance and using has_secure_password in the User model\n #.authenticate returns self if password is correct, otherwise returns false\n\n # Otherwise, add this message to error messages & return nothing\n errors.add(:user_authentication, 'This email and password combination is invalid.')\n nil\n end", "def edit\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def edit\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def reset_password_by_token(attributes={})\n recoverable = find_or_initialize_with_error_by(:reset_password_token, attributes[:reset_password_token])\n if recoverable.persisted?\n if recoverable.reset_password_period_valid?\n recoverable.reset_password!(attributes[:password], attributes[:password_confirmation])\n else\n recoverable.errors.add(:reset_password_token, :expired)\n end\n end\n recoverable\n end", "def authenticate_user_from_token\n authenticate_with_http_token do |token, options|\n user_email = options[:email]\n user_email && User.where(email: user_email, authentication_token: token).first\n end\n end", "def password_reset\n\t token = params.first[0]\n\t @user = User.find_by_confirm_token(token)\n\n\t if @user.nil?\n\t flash[:error] = 'You have not requested a password reset.'\n\t return redirect_to :root\t \n\t end\n\n\t if @user.password_expires_after < DateTime.now\n\t clear_password_reset(@user)\n\t @user.save\n\t flash[:error] = 'Password reset has expired. Please request a new password reset.'\n\t redirect_to :forgot_password\n\t end\n\tend", "def check_user\n return nil unless userlogin_signed_in?\n\n User.find_by(email: current_userlogin.email)\n end", "def user\n\t\taccount = Account.find_by_email(email)\n\t\t# If everything is true, the user will be returned\n\t\treturn account if account && account.valid_password?(password) #account.authenticate(password) #user&.authenticate?(password) #user && user.authenticate(password) \n\t\t# If not, the method will return nil\n\t\terrors.add :user_authentication, 'invalid credentials' \n\t\tnil \n\tend", "def update\n if params[:reset_password_token].blank?\n render json: format_errors(reset_password_token: [\"can't be blank\"]),\n status: :bad_request\n return\n end\n\n @user = User.reset_password_by_token(password_params)\n\n if @user.errors.empty?\n render json: '', status: :no_content\n else\n render json: format_errors(@user.errors), status: :unprocessable_entity\n end\n end", "def reset_password\n password_reset_token = params[:password_reset_token]\n user = User.find_by_password_reset_token(password_reset_token)\n is_expired = Time.now > user.password_reset_token_expires_at if user\n delete_password_reset_token(user) if is_expired\n if ! user || is_expired\n flash[:error] = I18n.t(:reset_password_token_expired_error)\n redirect_to forgot_password_users_path\n else\n set_current_user(user)\n delete_password_reset_token(user)\n flash[:notice] = I18n.t(:reset_password_enter_new_password_notice)\n redirect_to edit_user_path(user)\n end\n end", "def password_reset_profile\n profile = profiles.order(activated_at: :desc).first\n profile if profile&.password_reset?\n end", "def edit\n @reset_password = ResetPassword.first(:token => params[:id], \n :expired_at.gt => Time.now )\n \n if @reset_password\n session[:reset_password] = @reset_password\n \n create_dummy_user\n puts current_user\n respond_to do |format|\n format.html { render :edit }\n format.xml { render :status => :ok, :location => edit_profile_path }\n end\n else\n flash[:notice] = \"unknown token\"\n redirect_to edit_profile_path\n end\n end", "def matching_user\n User.active.where(email: email).first\n end", "def reset_password_by_token(attributes = {})\n original_token = attributes[:reset_password_token]\n reset_password_token = Devise.token_generator.digest(self, :reset_password_token, original_token)\n\n recoverable = find_or_initialize_with_error_by(:reset_password_token, reset_password_token)\n\n if recoverable.persisted?\n if recoverable.reset_password_period_valid?\n recoverable.reset_password(attributes[:password], attributes[:password_confirmation])\n else\n recoverable.errors.add(:reset_password_token, :expired)\n end\n end\n\n recoverable.reset_password_token = original_token if recoverable.reset_password_token.present?\n recoverable\n end", "def access_token_user_finder(&blk)\n define_method(:_find_user_by_access_token, &blk)\n end", "def forgot_password\n return unless request.post?\n @user = User.find_first(['email = ?', @params[:user]['email']])\n if @user\n @user.update_attributes({ :token => token_string(10),\n :token_expiry => 7.days.from_now })\n url = url_for(:controller => 'user', :action => 'login_by_token', \n :id => @user.id, :token => @user.token)\n UserNotifier.deliver_forgot_password(@user, url) \n render :action => 'forgot_password_done'\n else\n flash[:notice] = \"El correo #{@params[:user]['email']} NO existe en el salva!\"\n end\n end", "def edit\n @momentum_cms_user = MomentumCms::User.load_from_reset_password_token(params[:id])\n @token = params[:id]\n\n if @momentum_cms_user.blank?\n not_authenticated\n return\n end\n end", "def call\n user = User.find(email: @email)\n\n return user if user&.authenticate(@password)\n\n raise(Exceptions::InvalidEmailOrPassword)\n end", "def reset_password\n @user = User.find_by_forgot_password_token(params[:forgot_password_token])\n raise_404 unless good_password_change_request?\n\n @user.reset_password!\n end", "def find_user\n @current_user = User.find_by github_access_token: session[:github_access_token]\n end", "def edit\n @token = params[:id]\n @user = Person.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n end", "def token_verification\n user = User.with_reset_password_token(params[:user][:reset_password_token])\n if user && user.email == params[:user][:email] && user.reset_password_period_valid?\n render_success_response({},\"Token is valid\")\n else\n json_response({\n success: false,\n message: \"Invalid Token\"\n }, 400)\n end\n end", "def fetch_user\n\n @user = User.where(id: @user_validation_hash_obj.user_id).first\n\n return validation_error(\n 'um_rp_9',\n 'invalid_api_params',\n ['invalid_r_t'],\n GlobalConstant::ErrorAction.default\n ) if @user.blank? || [email protected]_eligible_for_reset_passowrd?\n\n success\n\n end", "def update\n @user = User.find_by_password_reset_token(params[:token])\n if user.reset_password(params)\n redirect_to root_url, :notice => \"Your password was successfully reset. Try logging in now.\"\n else\n render :action => \"edit\"\n end\n end", "def authenticated_user_with_token\n ApiKey.find_user_with_token(decoded_token)\n end", "def find_user\n return nil if session[:user_id].nil?\n User.find(session[:user_id])\n end", "def find_user\n return nil if session[:user_id].nil?\n User.find(session[:user_id])\n end", "def find_user_by_email(auth_token, user_email, origin_oem_str)\n return nil if user_email.blank?\n body = { :auth_token => auth_token }\n options = { body: body.to_json,\n method: :get,\n return_err_value: nil,\n query: {email: user_email,\n origin_oem_str: origin_oem_str}\n }\n user = call_external_service_with_service_token(Aylauth::Settings.user_service_base_url + \"/api/v1/public/users/show_by_email.json\", options)\n return if user.blank?\n return UserData.new(user)\n end", "def authenticate?(email, password)\n user = User.find_by_email email\n return nil if user.nil?\n return user if user.has_password?(password)\n end", "def reset_password\n # Make sure there is an email with the user and reset token\n user = User.find_by({\n email: params[:user][:email],\n reset_password_token: params[:user][:reset_password_token],\n })\n \n if user\n # Make sure the password reset token is only good for 10 minutes\n if (Time.now > user.reset_password_sent_at + 10.minutes)\n # Invalidate the password reset data\n user.reset_password_token = nil\n user.reset_password_sent_at = nil\n user.save\n return render json: {errors: {general: ['Your password reset token has expired']}}, status: 400\n else\n # If the password confirmation matches the password\n if(params[:user][:password] === params[:user][:password_confirmation])\n user.password = params[:user][:password]\n # Invalidate the password reset data\n user.reset_password_token = nil\n user.reset_password_sent_at = nil\n user.save\n return render json: {status: 200 }, status: 200 \n else\n # if the password confirmation was incorrect\n return render json: {\n errors: {\n fields: {\n password_confirmation: ['Your passwords did not match']\n }\n }\n }\n end\n\n end\n else\n return render json: {status: 404}, status: 404 \n end\n end", "def read_user_emailtoken(emailtoken)\n filter = Net::LDAP::Filter.eq(ENTITY_ATTR_MAPPING[:emailtoken].to_s, emailtoken)\n return search_map_user_fields(filter, 1)[0]\n end", "def reset_password\n @user = User.find_by_username(params[:username]) if params[:username].length > 0\n \n if not @user then\n @user = User.find_by_email(params[:email]) if params[:email].length > 0\n end\n \n if not @user then\n return redirect_to users_reset_url, notice: \"Username or Email not found\"\n end\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end", "def edit\n super\n reset_password_token = Devise.token_generator.digest(\n User,\n :reset_password_token,\n resource.reset_password_token\n )\n\n return if reset_password_token.nil?\n\n user = User.where(\n reset_password_token: reset_password_token\n ).first_or_initialize\n\n return if user.reset_password_period_valid?\n\n flash[:alert] = expired_or_invalid_message_for_reset_password_token(user)\n redirect_to(new_user_password_url(user_email: user['email']))\n end", "def user_authenticated_with_warden email, password\n user = User.where(email: email).first\n if user && user.valid_password?(password)\n user\n else\n nil\n end\n end", "def reset_password_create\n user = nil\n\n if params[:token]\n user = User.first(:perishable_token => params[:token])\n if user and user.password_reset_sent.to_time < 2.days.ago\n user = nil\n end\n end\n\n unless user.nil?\n # XXX: yes, this is a code smell\n\n if params[:password].size == 0\n flash[:notice] = \"Password must be present\"\n redirect_to \"/reset_password/#{params[:token]}\"\n return\n end\n\n if params[:password] != params[:password_confirm]\n flash[:notice] = \"Passwords do not match\"\n redirect_to \"/reset_password/#{params[:token]}\"\n return\n end\n\n if user.email.nil?\n if params[:email].empty?\n flash[:notice] = \"Email must be provided\"\n redirect_to \"/reset_password/#{params[:token]}\"\n return\n else\n user.email = params[:email]\n end\n end\n\n user.password = params[:password]\n user.save\n flash[:notice] = \"Password successfully set\"\n redirect_to \"/\"\n else\n redirect_to \"/forgot_password\"\n end\n end", "def authenticate(email, password)\n user = User.find_by_email(email) #find user exist in db\n return user if user && user.password == password #authenticate pwd\n nil\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n\n # the next line makes the password confirmation validation work\n if params[:user][:password_confirmation] == params[:user][:password]\n # the next line clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n redirect_to(root_path, :notice => 'Password was successfully updated.')\n end\n else\n flash[:danger] = \"Password must match password confirmation.\"\n render :action => \"edit\"\n end\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n\n # the next line makes the password confirmation validation work\n @user.password_confirmation = params[:user][:password_confirmation]\n # the next line clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n auto_login(@user,true)\n redirect_to root_path\n else\n redirect_to(edit_password_reset_path, alert: \"Hmm. Our system doesn't seem to accept your password. Try again! Make sure the two passwords matches each other\")\n end\n end", "def password_reset\r\n token = params.first[0]\r\n @person = Person.find_by_password_reset_token(token)\r\n\r\n if @person.nil?\r\n flash[:error] = 'You have not requested a password reset.'\r\n redirect_to :root\r\n return\r\n end\r\n\r\n if @PERSON.password_expires_after < DateTime.now\r\n clear_password_reset(@person)\r\n @person.save\r\n flash[:error] = 'Password reset has expired. Please request a new password reset.'\r\n redirect_to :forgot_password\r\n end\r\n end", "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end", "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end", "def authenticate_user_from_token!\n user_email = params[:user_email].presence\n user = user_email && User.find_by_email(user_email)\n\n # Notice how we use Devise.secure_compare to compare the token\n # in the database with the token given in the params, mitigating\n # timing attacks.\n\n if user && Devise.secure_compare(user.authentication_token, params[:user_token])\n sign_in user, store: false\n end\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(@token)\n\n if @user.blank?\n not_authenticated\n return\n end\n\n #makes the password confirmation validation work\n @user.password_confirmation = params[:user][:password_confrimation]\n #clears the temporary token and updates the password\n if @user.change_password!(params[:user][:password])\n redirect_to(users_path, :notice => 'Password successfully updated')\n else\n render \"edit\"\n end\n end", "def authenticate(email, password)\n # Because we use bcrypt we can't do this query in one part, first\n # we need to fetch the potential user\n user = User.find_by(email: email)\n\n if user\n # Then compare the provided password against the hashed one in the db.\n if BCrypt::Password.new(user.password).is_password? password\n # If they match we return the user\n return user\n end\n end\n # If we get here it means either there's no user with that email, or the wrong\n # password was provided. But we don't want to let an attacker know which.\n return nil\n end", "def find_current_user\n session_token = session[:session_token]\n session_token && User.find_by(session_token: session_token)\n end", "def find_user(alias_, nickname=nil)\n if nickname && ['me', 'i', 'my'].include?(alias_)\n alias_ = nickname\n end\n user = @users.get(alias_)\n raise Pagerbot::UserNotFoundError.new(\"I don't know who #{alias_} is.\") unless user\n return user\n end", "def lookup_user\n reset_session #use this when they ask you to find a user\n if session[:user_id]\n @user = User.find(session[:user_id])\n end\n end", "def current_user\n if decoded_token\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n # Returns nil if not found\n end\n end", "def authenticate(email, password)\n user = User.find_for_authentication(email: email)\n user.try(:valid_password?, password) ? user : nil\n end", "def user_from_remember_token\n User.authenticate_with_salt(*remember_token)\n end", "def edit\n @user = User.load_from_reset_password_token(params[:id])\n @token = params[:id]\n not_authenticated if !@user\n\n auto_login @user\n flash[:success] = 'Установите новый пароль'\n redirect_to edit_password_path\n end", "def before_reset\n @id = params[:id]; @token = params[:token]; @user = User.find_by_id(params[:id])\n if params[:password] == params[:confirm_password]\n return true\n else\n @error = \"Password and confirm password should match\"\n render \"reset\"\n end\n end", "def update\n @<%=model_name %> = <%=class_name %>.find_by_password_reset_token(params[:token])\n if <%=model_name %>.reset_password(params)\n redirect_to root_url, :notice => \"Your password was successfully reset. Try logging in now.\"\n else\n render :action => \"edit\"\n end\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def login(name_or_email, plain_password)\n name_or_email.downcase! # \n if name_or_email.include?(\"@\")\n user = User.find_by_email(name_or_email)\n else\n user = User.find_by_username(name_or_email)\n end\n if user == nil || user.password != plain_password || !user.validated\n user = nil\n end\n return user\nend", "def request_password_reset\n return false if email.nil?\n Parse::User.request_password_reset(email)\n end", "def user_from_remember_token\n\t\t\tUser.authenticate_with_salt(*remember_token)\n\t\tend", "def forgot_password\n @user = User.new if request.get?\n \n if request.post?\n @user = User.find_by_email params[:user][:email]\n if @user.nil?\n @user = User.new\n flash[:error] = \"Could not find user with this email.\"\n else\n @user.generate_forgot_password_token\n UserMailer.deliver_forgot_password_token(@user)\n flash.now[:notice] = \"We have sent you a mail at #{@user.email}, please follow the instructions in the mail.\"\n @user = User.new\n end\n end\n end", "def forgot_password\n @user = User.find_by_email(params[:email])\n if @user\n @status = I18n.t(:Success)\n else\n @status = I18n.t(:Failure)\n end\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def update\n @token = params[:id]\n @user = User.load_from_reset_password_token(params[:id])\n\n if @user.blank?\n not_authenticated\n return\n end\n\n # Password confirmation validation\n @user.password_confirmation = params[:user][:password_confirmation]\n\n # Clears temporary token and updates password\n if @user.change_password!(params[:user][:password])\n redirect_to(root_path, :notice => 'Your password was successfully updated!')\n else\n render :action => 'edit'\n end\n end", "def find_user\n results = @ldap.search( :base => options[:ldap][:base], :filter => user_filter)\n return results.first\n end", "def reset_password\n user = User.find_by(reset_password_token: params[:token])\n\n return invalid_reset unless user&.password_token_valid?\n\n if user.reset_password!(params[:password])\n render json: { success: true }, status: 204\n else\n render json: { error: user.errors.full_messages }, status: 422\n end\n end", "def reset_password_from_email\n\t\temail = params[:email]\n\t\tuser = User.find_by_email(email)\n\t\t\n\t\trender :json=>{:success=>false, :msg=>'Email was not found.'} and return if user.nil?\n\t\t\n\t\tuser.set_temp_password()\n\t\t\n\t\trender :json=>{:success=>true, :msg=>'Temporary password mailed to '+user.email} and return\n\tend", "def password_reset\n user = User.first\n user.reset_token = SecureRandom.uuid\n user.e_token = User.digest(user.email)\n UserMailer.password_reset(user)\n end", "def update\n @token = params.fetch(:momentum_cms_user, {}).fetch(:token, nil)\n\n @momentum_cms_user = MomentumCms::User.load_from_reset_password_token(@token)\n\n if @momentum_cms_user.blank?\n not_authenticated\n return\n end\n\n # the next line makes the password confirmation validation work\n @momentum_cms_user.password_confirmation = params.fetch(:momentum_cms_user, {}).fetch(:password_confirmation, nil)\n # the next line clears the temporary token and updates the password\n if @momentum_cms_user.change_password!(params.fetch(:momentum_cms_user, {}).fetch(:password, nil))\n flash[:success] = 'Password was successfully updated.'\n redirect_to cms_admin_root_path\n else\n render action: :edit\n end\n end" ]
[ "0.72109276", "0.7109692", "0.70513827", "0.699898", "0.68306947", "0.6760328", "0.6745972", "0.66419685", "0.66232896", "0.6612386", "0.6585609", "0.65514493", "0.65035015", "0.6478909", "0.64681566", "0.6451692", "0.6444834", "0.64206", "0.6417399", "0.6361192", "0.63597214", "0.6350867", "0.6343372", "0.634241", "0.63407826", "0.63045335", "0.62953866", "0.62752926", "0.6266098", "0.62596714", "0.624168", "0.62302417", "0.6218263", "0.62070215", "0.6199106", "0.6184101", "0.6182145", "0.61535037", "0.61108303", "0.6100968", "0.60953796", "0.6062659", "0.60520786", "0.6045783", "0.6045098", "0.6028746", "0.60279465", "0.6020366", "0.6019897", "0.6019434", "0.60166717", "0.59944904", "0.59707606", "0.5968693", "0.5961208", "0.5954303", "0.5944852", "0.5943965", "0.5933089", "0.59242845", "0.59242845", "0.59178305", "0.59164435", "0.59156895", "0.5910319", "0.5907762", "0.58944976", "0.585206", "0.5810733", "0.58071727", "0.58041", "0.57930183", "0.5791925", "0.57866836", "0.57866836", "0.57796186", "0.577764", "0.5767952", "0.57675666", "0.5762898", "0.5762383", "0.5753714", "0.57433546", "0.5736721", "0.5728497", "0.57254386", "0.572479", "0.57231975", "0.57195985", "0.5719241", "0.5715024", "0.5707959", "0.5707169", "0.5703447", "0.56975967", "0.5696901", "0.56956625", "0.56919765", "0.5685754", "0.5681162" ]
0.6016243
51
A callback initiated after successfully being remembered. This can be used to insert your own logic that is only run after the user is remembered. Example: def after_remembered self.update_attribute(:invite_code, nil) end source://devise//lib/devise/models/rememberable.rb100
def after_remembered; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_remembered\n end", "def after_remember_me!(user)\n sorcery_config.after_remember_me.each do |callback|\n send(callback, user)\n end\n end", "def remember_me?; end", "def remember_me; end", "def after_password_reset; end", "def handle_remember_cookie! new_cookie_flag\n return unless @current_user\n case\n when valid_remember_cookie? then @current_user.refresh_token # keeping same expiry date\n when new_cookie_flag then @current_user.remember_me\n else @current_user.forget_me\n end\n send_remember_cookie!\n end", "def remember\n \tputs \"%USER-I-TRACE, remember called.\"\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def adminhandle_remember_cookie!(new_cookie_flag)\n return unless @current_administrator\n case\n when valid_remember_cookie? then @current_administrator.refresh_token # keeping same expiry date\n when new_cookie_flag then @current_administrator.remember_me \n else @current_administrator.forget_me\n end\n adminsend_remember_cookie!\n end", "def handle_remember_cookie!(new_cookie_flag)\n return unless @current_user\n case\n when valid_remember_cookie? then @current_user.refresh_token # keeping same expiry date\n when new_cookie_flag then @current_user.remember_me\n else @current_user.forget_me\n end\n send_remember_cookie!\n end", "def after_password_reset;\n end", "def handle_remember_cookie!(new_cookie_flag)\n return unless @current_user\n case\n when valid_remember_cookie? then @current_user.refresh_token # keeping same expiry date\n when new_cookie_flag then @current_user.remember_me \n else @current_user.forget_me\n end\n send_remember_cookie!\n end", "def remember\n self.remember_token = Incline::User::new_token\n update_attribute(:remember_digest, Incline::User::digest(self.remember_token))\n end", "def remember_me() return true; end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n updated_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\nend", "def remember\n self.remember_token = User.new_token\n\n # update_attribute bypasses validations, since we don't have user's password\n # here, which is normally necessary for changing records on the table\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\nself.remember_token = User.new_token\nupdate_attribute(:remember_digest, User.digest(remember_token))\nend", "def remember\nself.remember_token = User.new_token\nupdate_attribute(:remember_digest, User.digest(remember_token))\nend", "def remember!\n self.remember_token = User.random_token\n update_attribute(:remember_digest, User.password_digest_from(remember_token))\n end", "def remember\n\tself.remember_token = User.new_token\n\tupdate_attribute(:remember_digest, User.digest(remember_token))\nend", "def remember\n @remember\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n\n end", "def remember\n self.remember_token = User.new_token \n update_attribute(:remember_digest, User.digest(remember_token)) \n end", "def remember\n self.remember_token = User.generate_remember_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n # digest remember_token which is created from base64 library\n # -> update vao cai thang remember_digest!!!\n # noi chung la cu phai tu tu moi hieu het duoc !!!\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n # give the variable to \"self\", the user\n # sets the remember_token attribute of the user object\n self.remember_token = User.new_token\n # update attribute of the User, bypass validations (password), hash the\n # remember_token using digest (not totally sure that's right)\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n # Give the user a remember_me token string\n self.remember_token = User.new_token\n\n # Store the digest of the remember_token in the user model\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n \t\tself.remember_token = User.new_token\n \t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n self.remember_token = User.newtoken\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_token_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, (User.digest self.remember_token)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end" ]
[ "0.7106331", "0.6494363", "0.5966787", "0.5931182", "0.58541673", "0.5836536", "0.57540685", "0.57478374", "0.5720398", "0.5699815", "0.56983334", "0.5691265", "0.5684516", "0.56571114", "0.56539994", "0.564052", "0.56381434", "0.56361294", "0.56361294", "0.56230557", "0.5620656", "0.5608572", "0.55906576", "0.55906576", "0.5575104", "0.5574025", "0.5568763", "0.55577284", "0.55577284", "0.5549443", "0.5548397", "0.55445564", "0.5544086", "0.5538175", "0.55370545", "0.5533861", "0.5531702", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984", "0.55311984" ]
0.69599044
1
If the record is persisted, remove the remember token (but only if it exists), and save the record without validations. source://devise//lib/devise/models/rememberable.rb58
def forget_me!; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(:validate => false) \n end", "def forget_me\r\n self.remember_token_expires_at = nil\r\n self.remember_token = nil\r\n save(:validate => false)\r\n end", "def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(:validate => false)\n end", "def forget_me!\n return unless persisted?\n self.remember_token = nil if respond_to?(:remember_token)\n self.remember_created_at = nil if self.class.expire_all_remember_me_on_sign_out\n save(validate: false)\n end", "def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(false)\n end", "def forget_me\n self.remember_token_expires_at = nil\n self.remember_token = nil\n save(false)\n end", "def forget\n update_attribute(:remember_token, nil)\n end", "def remember_me!\n self.remember_token = new_remember_token_token\n self.remember_created_at = Time.now.utc\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{remember_token_expires_at}\")\n # save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 10.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate=> false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(validate: false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember\n self.remember_token_expires_at = 1.weeks.from_now.utc\n self.remember_token = Cryptography.encrypt_with_salt(\n SecureRandom.hex(10),\n remember_token_expires_at)\n save(false)\n end", "def forget\n self.remember_token = nil\n update_attribute(:remember_digest, nil)\n end", "def forget\n self.remember_token = nil\n update_attribute(:remember_digest, nil)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = User.encrypt(\"#{name}--#{remember_token_expires_at}\")\n save!(validate: false)\n end", "def forget\n self.remember_token = nil\n update_attribute(:remember_token_digest, nil)\n end", "def forget\n self.remember_token = nil\n self.update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n # We don't need the below line because if we update remember_digest to nil, then\n # you cannot use the old remember_token anyway, so it is unnecessary\n # self.remember_token = nil\n end", "def remember_me!\n self.remember_token = self.class.generate_token(:remember_token)\n self.remember_created_at = Time.now\n save\n end", "def sign_out\n #Setting current user's remember_token to a\n #new hash that is in valid\n #The idea is to make every record in the\n #table to look identical in an attempt to\n #thwart evil\n current_user.update_attribute(:remember_token, User.hash(User.new_remember_token))\n #Deletes current user's remember_token from hash\n cookies.delete(:remember_token)\n #sets current use to empty\n self.current_user = nil\n end", "def persist\n # Create a new token and save it to database.\n # NOTE: Bypass the validations because we don’t have access to the user’s password.\n @remember_token = User.new_token\n update_column(:remember_digest, User.digest(remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.months.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\r\n time = 1.week.from_now.utc\r\n self.remember_token_expires_at = time\r\n self.remember_token = self.class.encrypt(\"#{email}--#{remember_token_expires_at}\", self.salt)\r\n save(:validate => false)\r\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc #remember token lasts 2 weeks\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\r\n self.remember_token_expires_at = 2.weeks.from_now.utc\r\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\r\n save(false)\r\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 1.day.from_now\n self.remember_token = Digest::SHA1.hexdigest(\"#{salt}--#{self.email}--#{self.remember_token_expires_at}\")\n self.password = \"\" # This bypasses password encryption, thus leaving password intact\n self.save_with_validation(false)\n end", "def remember\n self.remember_token = User.new_token\n\n # update_attribute bypasses validations, since we don't have user's password\n # here, which is normally necessary for changing records on the table\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def refresh_token\n if remember_token?\n self.remember_token = make_token \n save(:validate => false) \n end\n end", "def remember_me!\n self.remember_token = encrypt(\"#{password_salt}--#{id}--#{Time.now.utc}\")\n save_without_validation\n end", "def refresh_token\n if remember_token?\n self.remember_token = self.class.create_token\n save(:validate => false)\n end\n end", "def remember\n self.remember_token = User.new_token\n # Writes token to db\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def sign_out\n new_remember_token = User.new_remember_token\n current_user.update_attribute(:remember_token, User.encrypt(new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def sign_out\n current_user.update_attribute(:remember_token, User.hash(User.new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def sign_out\n current_user.update_attribute(:remember_token, User.hash(User.new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{kerbid}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{login}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember\n self.remember_token = User.new_token\n self.remember_digest = User.digest(self.remember_token)\n update_attribute(:remember_digest, self.remember_digest) #for new user, this creates record\n end", "def remember\n # store virtually the new token\n self.remember_token = User.new_token\n # save the hash digest of the token on the database\n self.update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attributes!(remember_digest: remember_token.digest,\n remembered_since: Time.current)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def remember\n self.remember_token = Person.new_token\n # Generates a remember token for the current user.\n update_attribute(:remember_digest, Person.digest(remember_token))\n # Saves the hash digest of the token in the database.\n end", "def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend", "def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend", "def forget\n\t\tupdate_attribute(:remember_digest, nil)\n\tend", "def sign_out\n current_user.update_attribute(:remember_token,\n User.digest(User.new_remember_token))\n # we first change the user’s remember token in the database (in case the cookie has been stolen, \n # as it could still be used to authorize a user\n cookies.delete(:remember_token)\n # remove the remember token from the session\n self.current_user = nil\n end", "def forget\n update_attribute(:remember_digest, nil)\n \n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def invalidate!\n self.active = false\n self.save!\n if controller\n cookies.delete(:user_session)\n end\n end", "def forget\n update_attribute(:remember_digest, nil)\n end", "def forget\n \tupdate_attribute(:remember_digest, nil)\n end", "def forget\n \tupdate_attribute(:remember_digest, nil)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_token_digest, User.digest(remember_token))\n end", "def forget\n update_attribute :remember_digest, nil\n end", "def forget\n update_attribute :remember_digest, nil\n end", "def remember\n # give the variable to \"self\", the user\n # sets the remember_token attribute of the user object\n self.remember_token = User.new_token\n # update attribute of the User, bypass validations (password), hash the\n # remember_token using digest (not totally sure that's right)\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def forget\n\t\tupdate_attribute(:remember_digest,nil)\n\tend", "def remember\n self.remember_token = Incline::User::new_token\n update_attribute(:remember_digest, Incline::User::digest(self.remember_token))\n end", "def sign_out\n current_user.update_attribute(:remember_token,\n User.digest(User.new_remember_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "def remember\n self.remember_token = User.new_token\n update remember_digest: User.digest(remember_token)\n end", "def forget_me!\n sorcery_config.remember_me_token_persist_globally || force_forget_me!\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.new_token\n # encrypt remember_token and save it in :remember_digest field in db\n update_attribute(:remember_digest, User.digest(remember_token))\n end" ]
[ "0.7687476", "0.76822954", "0.7625986", "0.7417727", "0.72792107", "0.72792107", "0.72565675", "0.72268814", "0.7192024", "0.7167122", "0.71668667", "0.71560967", "0.7149649", "0.71081376", "0.7051845", "0.7051845", "0.7047851", "0.70139235", "0.6984327", "0.6979167", "0.69540155", "0.6946342", "0.69235605", "0.6912711", "0.6900724", "0.6892434", "0.68904346", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.6888102", "0.68876094", "0.6849491", "0.6819047", "0.67927384", "0.67720217", "0.6751915", "0.6744814", "0.6728878", "0.67208105", "0.67208105", "0.6711328", "0.67087674", "0.66883034", "0.6681199", "0.66565853", "0.6640228", "0.6640228", "0.6615416", "0.66081315", "0.66081315", "0.66081315", "0.6602844", "0.65947723", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6587266", "0.6585764", "0.65843046", "0.65639067", "0.65639067", "0.65633434", "0.6559695", "0.6559695", "0.6549624", "0.65474963", "0.65419596", "0.6535251", "0.6530532", "0.65182805", "0.65077215", "0.6503503", "0.6499579" ]
0.0
-1
Returns the value of attribute remember_me. source://devise//lib/devise/models/rememberable.rb44
def remember_me; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remember_me\n remember_me_for Ubiquo::Settings.context(:ubiquo_authentication).get(:remember_time)\n end", "def remember_me(value = nil)\n if value.nil?\n read_inheritable_attribute(:remember_me)\n else\n write_inheritable_attribute(:remember_me, value)\n end\n end", "def remember_me=(value)\n @remember_me = value\n end", "def remember_me\n return @remember_me if defined?(@remember_me)\n @remember_me = self.class.remember_me\n end", "def remember_me=(value)\n @remember_me = value\n end", "def remember_me\n remember_me_for REMEMBER_ME_TIME\n end", "def remember_me_string\n cookies[:remember_me] || \"0\"\n end", "def remember_me_string\n cookies[:remember_me] || \"0\"\n end", "def remember_me_string\n cookies[:remember_me]||\"0\"\n end", "def remember_me_for\n return unless remember_me?\n self.class.remember_me_for\n end", "def remember_me?\n return (self.remember_me == \"1\")\n end", "def remember_me_for(value = :_read)\n if value == :_read\n read_inheritable_attribute(:remember_me_for) || remember_me_for(3.months)\n else\n write_inheritable_attribute(:remember_me_for, value)\n end\n end", "def remember_me\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n @remember\n end", "def remember_me?\n remember_me == true || remember_me == \"true\" || remember_me == \"1\"\n end", "def remember\n # Give the user a remember_me token string\n self.remember_token = User.new_token\n\n # Store the digest of the remember_token in the user model\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{login}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_token\r\n cookies.signed[:remember_token] || [nil, nil]\r\n end", "def remember_me\n true\n end", "def remember_me\n true\n end", "def remember_me\n true\n end", "def remember_me\n self.remember_token_expires_at = 2.months.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me(value = nil)\n config(:remember_me, value, false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc #remember token lasts 2 weeks\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me?; end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{remember_token_expires_at}\")\n # save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = User.encrypt(\"#{name}--#{remember_token_expires_at}\")\n save!(validate: false)\n end", "def remember_me?\n self.remember_me ==\"1\"\n end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me_login\n validate_token User, cookies[:remember_me]\n end", "def remember_token\n cookies.signed[:remember_token] || session[:remember_token] || [nil, nil]\n end", "def remember_me\r\n self.remember_token_expires_at = 2.weeks.from_now.utc\r\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\r\n save(false)\r\n end", "def remember_me\n remember_me_for 2.years\n end", "def remember_me?\n remember_me == \"1\"\n end", "def remember_me?\n remember_me == \"1\"\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_token\n\t\t\tcookies.signed[:remember_token] || [nil, nil]\n\t\tend", "def remember_me\n self.remember_token_expires_at = 10.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate=> false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(validate: false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{kerbid}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me(user)\n rememberable = remember_me_adapter(user)\n rememberable.remember_me!\n cookies.signed[remember_cookie_name] = remember_cookie_values(user)\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me_for(value = :_read)\n config(:remember_me_for, value, 3.months, :_read)\n end", "def remember_me\n remember_me_for(14)\n end", "def remember_token_field(value = nil)\n if value.nil?\n read_inheritable_attribute(:remember_token_field) || remember_token_field(klass.remember_token_field)\n else\n write_inheritable_attribute(:remember_token_field, value)\n end\n end", "def remember_me\n remember_me_for 1.year\n end", "def remember_me\n remember_me_for 3.month\n end", "def remember_me\n self.remember_token_expires_at = 1.day.from_now\n self.remember_token = Digest::SHA1.hexdigest(\"#{salt}--#{self.email}--#{self.remember_token_expires_at}\")\n self.password = \"\" # This bypasses password encryption, thus leaving password intact\n self.save_with_validation(false)\n end", "def remember_me\r\n time = 1.week.from_now.utc\r\n self.remember_token_expires_at = time\r\n self.remember_token = self.class.encrypt(\"#{email}--#{remember_token_expires_at}\", self.salt)\r\n save(:validate => false)\r\n end", "def remember_me?\n valid_params? && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me])\n end", "def remember_me?\n valid_params? && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me])\n end", "def remember\n #remember_token is virtual\n #actually, there is no remember_token attribtue in User model\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me?\n false\n end", "def remember_me?\n false\n end", "def remember_me\n remember_me_for 3.months\n end", "def remember\n # give the variable to \"self\", the user\n # sets the remember_token attribute of the user object\n self.remember_token = User.new_token\n # update attribute of the User, bypass validations (password), hash the\n # remember_token using digest (not totally sure that's right)\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def update_remember_me(user, remember_me)\n if remember_me == 1\n remember_me = SecureRandom.urlsafe_base64\n user.remember_me = remember_me\n cookies.permanent[:remember_me] = remember_me\n else\n user.remember_me = nil\n cookies.permanent[:remember_me] = nil\n end\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 10.years\n end", "def remember\n self.remember_token = User.new_token\n updated_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.token\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.generate_remember_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember_me\n remember_me_for 1.month\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end", "def remember_me\n remember_me_for 2.weeks\n end" ]
[ "0.80517334", "0.8016384", "0.79461455", "0.78617114", "0.7859976", "0.76116407", "0.7602038", "0.7602038", "0.74815947", "0.74055606", "0.73837703", "0.7351035", "0.7293275", "0.71684813", "0.71531653", "0.714065", "0.7132567", "0.712488", "0.7120697", "0.7120697", "0.7120697", "0.7118263", "0.71138495", "0.7094762", "0.7075616", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70740604", "0.70707655", "0.7062529", "0.7062383", "0.70621747", "0.7057162", "0.70565444", "0.7056231", "0.7040143", "0.7038156", "0.7036991", "0.70317525", "0.7023674", "0.7023674", "0.69916385", "0.69782895", "0.6975416", "0.69684625", "0.6963391", "0.696061", "0.6959938", "0.69571453", "0.6953732", "0.6932213", "0.68998593", "0.6862148", "0.6861823", "0.68593353", "0.68424094", "0.68307984", "0.68307984", "0.6813505", "0.6771327", "0.6771327", "0.6770786", "0.6770786", "0.6747794", "0.6747279", "0.67247915", "0.6723727", "0.6712457", "0.67108554", "0.6702718", "0.66941196", "0.66927505", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925", "0.66565925" ]
0.669742
85
Sets the attribute remember_me
def remember_me=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remember_me=(value)\n @remember_me = value\n end", "def remember_me=(value)\n @remember_me = value\n end", "def remember_me(value = nil)\n if value.nil?\n read_inheritable_attribute(:remember_me)\n else\n write_inheritable_attribute(:remember_me, value)\n end\n end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me(resource)\n resource.remember_me = remember_me? if resource.respond_to?(:remember_me=)\n end", "def remember_me\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{login}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{kerbid}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me!\n self.remember_token = new_remember_token_token\n self.remember_created_at = Time.now.utc\n save(:validate => false)\n end", "def remember_me\r\n self.remember_token_expires_at = 2.weeks.from_now.utc\r\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\r\n save(false)\r\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember\n # Give the user a remember_me token string\n self.remember_token = User.new_token\n\n # Store the digest of the remember_token in the user model\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.months.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me(value = nil)\n config(:remember_me, value, false)\n end", "def remember_me!\n self.remember_token = self.class.generate_token(:remember_token)\n self.remember_created_at = Time.now\n save\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc #remember token lasts 2 weeks\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 1.day.from_now\n self.remember_token = Digest::SHA1.hexdigest(\"#{salt}--#{self.email}--#{self.remember_token_expires_at}\")\n self.password = \"\" # This bypasses password encryption, thus leaving password intact\n self.save_with_validation(false)\n end", "def remember\n\t\tself.remember_token = User.new_token\n\t\t# 'update_attribute' relieves me of the requirement to provide password when updating\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = User.encrypt(\"#{name}--#{remember_token_expires_at}\")\n save!(validate: false)\n end", "def remember\n self.remember_token = User.generate_remember_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def set_remember_me_cookie!(user)\n cookies.signed[:remember_me_token] = {\n value: user.send(\n user.sorcery_config.remember_me_token_attr_name\n ),\n expires: user.send(\n user.sorcery_config.remember_me_token_expires_at_attr_name\n ),\n httponly: sorcery_config.remember_me_httponly,\n domain: sorcery_config.cookie_domain\n }\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{remember_token_expires_at}\")\n # save(:validate => false)\n end", "def set_remember_token()\n self.remember_token = User.new_token()\n update_attribute :remember_digest, User.digest(self.remember_token)\n end", "def remember\n self.remember_token = User.token\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(validate: false)\n end", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute( :remember_digest, User.digest(remember_token))\n\tend", "def remember\n self.remember_token = Incline::User::new_token\n update_attribute(:remember_digest, Incline::User::digest(self.remember_token))\n end", "def remember\n\t\tself.remember_token = User.new_token #set users remember_token attribute\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 10.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n return @remember_me if defined?(@remember_me)\n @remember_me = self.class.remember_me\n end", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attributes(remember_digest: User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attribute(:remember_digest, User.digest(self.remember_token))\n\tend", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate=> false)\n end", "def remember\n # give the variable to \"self\", the user\n # sets the remember_token attribute of the user object\n self.remember_token = User.new_token\n # update attribute of the User, bypass validations (password), hash the\n # remember_token using digest (not totally sure that's right)\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n \t#without self the assignment would create a local variable called remember_token, \n \t#Using self ensures that assignment sets the user’s remember_token attribute.\n self.remember_token = User.new_token\n #the update_attribute method updates the remember digest.\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = Client.new_remember_token\n update_attribute(:remember_token, Client.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me?\n self.remember_me ==\"1\"\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attributes!(remember_digest: remember_token.digest,\n remembered_since: Time.current)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me\r\n time = 1.week.from_now.utc\r\n self.remember_token_expires_at = time\r\n self.remember_token = self.class.encrypt(\"#{email}--#{remember_token_expires_at}\", self.salt)\r\n save(:validate => false)\r\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n self.remember_token = User.new_token\n updated_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.newtoken\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n\t\tself.remember_token = User.new_token\n\t\tupdate_attributes(:remember_digest, User.digest(remember_token))\n\tend", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, (User.digest self.remember_token)\n end" ]
[ "0.9027261", "0.8959037", "0.8282885", "0.81633335", "0.81388307", "0.8138389", "0.80527556", "0.8049869", "0.79691017", "0.79537696", "0.7884275", "0.7854306", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.78540474", "0.7847875", "0.78422004", "0.7836748", "0.7825441", "0.77624637", "0.7761394", "0.77503675", "0.7733448", "0.77305907", "0.7709441", "0.7708361", "0.769512", "0.76733166", "0.7663478", "0.7658467", "0.7652916", "0.76384354", "0.76216125", "0.7613386", "0.7609061", "0.7602684", "0.75976455", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.75974077", "0.7594525", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7593288", "0.7590619", "0.7590619", "0.7590619", "0.7585746", "0.7585746", "0.7584985", "0.758268", "0.7577667", "0.75716865", "0.75699884", "0.756791", "0.75630856", "0.75626683", "0.7553534", "0.7544593", "0.7544593", "0.7543281", "0.7540873", "0.7540008", "0.7530934", "0.75296515", "0.75291073", "0.75286245" ]
0.0
-1
Generate a token checking if one does not already exist in the database. source://devise//lib/devise/models/rememberable.rb147
def remember_token; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_token\n unless self.token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(token: random_token)\n end\n self.save\n end\n end", "def ensure_token\n if self.token_expiration and Time.now > self.token_expiration\n self.token = nil\n end\n self.token ||= self.generate_token\n self.token_expiration = Time.now + 1.day\n self.save\n return self.token\n end", "def generate_auth_token\n begin\n token = SecureRandom.hex\n end while AuthToken.exists?(auth_token: token)\n self.auth_tokens.create(auth_token: token)\n token\n end", "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end", "def generate_auth_token!\n loop do\n @token = Devise.friendly_token\n break unless Token.find_by(token: @token)\n end\n self.tokens.create token: @token\n return @token\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while User.exists?(auth_token: auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while User.exists?(auth_token: auth_token)\n end", "def generate_auth_token!\n \tbegin\n \t\tself.auth_token = Devise.friendly_token\n \tend while User.exists?(auth_token: auth_token)\n\tend", "def generate_auth_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: self.auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_unique_authentication_token\n loop do\n token = SecureRandom.hex[0..6]\n if !User.where(authentication_token: token).exists? && !EmailAuthenticationToken.where(authentication_token: token).exists?\n break token\n end\n end\n end", "def ensure_token_uniqueness\n self.session_token = generate_token\n while User.find_by(session_token: self.session_token)\n self.session_token = generate_token\n end\n self.session_token\n end", "def generate_token\n self.token = SecureRandom.hex if new_record?\n end", "def generate_authentication_token!\n begin\n self.auth_token = SecureRandom.hex(20)\n end while self.class.exists?(auth_token: auth_token)\n end", "def generate_auth_token\n loop do \n token = SecureRandom.hex\n break token unless self.class.exists?(auth_token: token)\n end\n end", "def generate_authentication_token!\n\tbegin\n\t\tself.auth_token = Devise.friendly_token\n\tend while self.class.exists?(auth_token: auth_token)\nend", "def generate_token\n self.token ||= loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless self.class.exists?(token: random_token)\n end\n end", "def ensure_authentication_token\n authorization = Authorization.where(:provider => 'devise', :customer_id => id.to_s).first_or_initialize\n\n if authorization.token.blank?\n #generate new token\n authorization.token = Devise.friendly_token\n end\n\n authorization.save\n end", "def generate_auth_token\n \tbegin\n \t\tself.auth_token = User.new_token\n \tend while self.class.exists?(auth_token: auth_token)\n end", "def generate_remember_token(token = SecureRandom.urlsafe_base64)\n self.remember_token = Digest::SHA1.hexdigest(token)\n end", "def generate_authentication_token\n\t\tloop do\n\t\t\ttoken = SecureRandom.base64.tr('+/=', 'Qrt')\n\t\t\tbreak token unless User.exists?(authentication_token: token)\n\t\tend\n\tend", "def generate_token!(column)\n attempts = 3\n\n begin\n token = SecureRandom.urlsafe_base64(24)\n update_column(column, token)\n rescue ActiveRecord::RecordNotUnique\n retry if (attempts -= 1) > 0\n end\n\n send(column) == token\n end", "def token\n return self[:token] if self[:token] # <- Will not generate a token more than once.\n begin\n byte_string = [self.user_id, rand(2**32)].pack('L*') << rand(256)\n self[:token] = Base64.urlsafe_encode64(byte_string)\n end while UserAuthToken.exists?(token: self[:token])\n end", "def generate_token\n self.token = UniqueToken.generate\n end", "def create_token\n if self.token.nil?\n self.token = loop do\n random_token = \"BON-#{SecureRandom.uuid.split('-').first}\"\n break random_token unless self.class.exists?(token: random_token)\n end\n end\n end", "def generate_token!\n self.token = SecureRandom.hex\n save!\n end", "def generate_token\n self.token = loop do\n random_token = SecureRandom.base58(UID_LENGTH)\n break random_token unless Session.exists?(token: random_token)\n end\n end", "def populate_token\n if new_record? && self.token.nil?\n self.token = SecureRandom.uuid().to_s.last(8)\n while check_token?(self.token) == true\n self.token = SecureRandom.uuid().to_s.last(8)\n end\n end\n end", "def generate_authentication_token\n begin\n self.access_token = Devise.friendly_token\n end while self.class.exists?(access_token: access_token)\n end", "def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless self.class.exists?(authentication_token: token)\n end\n end", "def ensure_authentication_token (remember)\n token = AuthToken.create!(token: generate_authentication_token,\n remember: remember,\n user_id: self.id)\n end", "def token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: auth_token)\n end", "def generate_token\n if self.token.blank?\n self.id = self.token = UniqueToken.generate\n end\n end", "def generate_token\n self.token ||= SecureRandom.hex(16)\n end", "def assign_unique_token\n unless(self.token)\n begin\n self.token = rand(36**8).to_s(36).downcase # a-z \n end while self.class.exists?(:token => token)\n end\n end", "def generate_token\n self.token = custom_token.presence || SecureRandom.hex(3)\n self.custom_token = nil\n generate_token if AliasedLink.exists?(token: token)\n end", "def generate_token\n self.perishable_token = Digest::MD5.hexdigest(\"#{Time.now}\")\n end", "def generate_authentication_token\n loop do\n token = generate_secure_token_string\n break token unless User.where(:authentication_token=>token).first\n end\n end", "def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless User.where(authentication_token: token).first\n end\n end", "def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless User.where(authentication_token: token).first\n end\n end", "def ensure_authentication_token\n self.authentication_token = rand(72**8).to_s(36)\n end", "def generate_access_token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: token)\n end", "def generate_access_token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: token)\n end", "def generate_token\n loop do\n token = SecureRandom.base64(44).tr(\"+/=\", \"xyz\").first(16).upcase\n break token unless self.class.where(:token => token).first\n end\n end", "def generate_new_authentication_token\n token = User.generate_unique_secure_token\n update_attributes authentication_token: token\n end", "def check_auth_token\n generate_authentication_token! if new_record? || user_status_id_changed?\n end", "def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless User.where(authentication_token: token).first\n end\n end", "def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless User.where(authentication_token: token).first\n end\n end", "def generate_token\n begin\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end while Invitation.exists?(:token => self.token)\n end", "def keep_or_generate_token!\n if api_token.nil? || api_token.empty?\n self.api_token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(api_token: random_token)\n end\n update_column(:api_token, api_token) unless new_record?\n end\n end", "def generate_login_token!\n new_login_token = SecureRandom.hex(24)\n salt = SecureRandom.hex(24)\n hash = token_hash(new_login_token, salt)\n\n update_attributes(:login_token => concatenate_token_record(hash, salt), :login_token_expires_at => 1.week.from_now)\n new_login_token\n end", "def ensure_session_token\n self.token ||= SecureRandom.hex\n end", "def generate_token(column=nil)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def create_authentication_token!\n begin\n self.authentication_token = User.token\n end while User.exists?(authentication_token: self.authentication_token)\n end", "def generate_token\n #Token.generate_token(self.id)\n end", "def regenerate_token\n self.auth_token = nil\n generate_token\n save!\n end", "def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end", "def save_token\n self.token = SecureRandom.uuid unless self.token\n end", "def generate_auth_token\n token = AuthToken.new(user: self)\n token if token.save\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64(8)\n end while User.exists?(column => self[column])\n end", "def generate_token\n self.token = Digest::MD5.hexdigest(\"PersonRecordToken#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end", "def ensure_session_token\n self.token ||= self.class.random_string\n end", "def create_token(opts = {})\n self.token = Digest::SHA256.hexdigest(\n Time.now.to_s + Rails.application.secrets.salt + email\n )\n save if opts[:save] == true\n end", "def new_remember_token_token\n #It's only in Ruby 1.9\n #see https://github.com/rails/rails/commit/b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5\n SecureRandom.base64.gsub(\"/\",\"_\").gsub(/=+$/,\"\")\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\nend", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\nend", "def generate_token(column)\n \tbegin\n \t\tself[column] = SecureRandom.urlsafe_base64\n \tend while User.exists?(column => self[column])\n \tend", "def generate_token(column)\r\n begin\r\n self[column] = SecureRandom.urlsafe_base64\r\n end while User.exists?(column => self[column])\r\nend", "def generate_token(column)\n\t\tbegin self[column] = SecureRandom.urlsafe_base64(10)\n\t\tend while User.exists?(column => self[column])\n\tend", "def create_remember_token \n self.remember_token = SecureRandom.urlsafe_base64\n end", "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def generate_token\n\t\t\tself.id_token ||= SecureRandom.hex(8) \n\t\t\tif Appointment.exists?(:id_token => id_token)\n\t\t\t\tself.id_token = nil\n\t\t\t\traise\n\t\t\tend\t\t\t\n\t\trescue Exception => e\n\t\t\t@token_attempts = @token_attempts.to_i + 1\n\t\t\tputs \"Record not unique \" + @token_attempts.to_s\n\t\t\tretry if @token_attempts < MAX_RETRIES\n\t\t\traise e, \"#{I18n.t(:professional)}: #{I18n.t(:create_unsuccess)} #{I18n.t(:uniqueness_unsuccess)}\"\n\t\tend", "def generate_remember_token_digest!\n remember_token = _generate_token(:remember)\n update_column(:remember_token_digest, SCrypt::Password.create(remember_token))\n remember_token\n end", "def generate_token\n self.token ||= Base64.urlsafe_encode64(SecureRandom.random_bytes(12))\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def generate_token\n\t\tself.token = loop do\n\t\t\trandom_token = SecureRandom.urlsafe_base64(nil, false)\n\t\t\tbreak random_token unless Invite.exists?(token: random_token)\n\t\tend\n\tend", "def regenerate_auth_token\n self.auth_token = nil\n generate_token\n save!\n end", "def regenerate_auth_token\n self.auth_token = nil\n generate_token\n save!\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end\n #end while User.exists?(column => self[column])\n end", "def generate_token!\n new_token = User.unique_random(field_name: 'api_token')\n update_column(:api_token, new_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def generate_token\n # Repeat method until unique token is found\n self.token = loop do\n random_token = (Digest::MD5.hexdigest \"#{SecureRandom.hex(10)}-#{DateTime.now.to_s}\")[1..16]\n break random_token unless Bar.where(token: random_token).exists?\n end\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end", "def generate_token(column)\n begin\n self[column] = SecureRandom.urlsafe_base64\n end while User.exists?(column => self[column])\n end" ]
[ "0.7915641", "0.7909524", "0.78145707", "0.77566385", "0.7751523", "0.77165943", "0.77165943", "0.7701939", "0.7625914", "0.762303", "0.7610301", "0.7610301", "0.7610301", "0.7610301", "0.7596694", "0.7563081", "0.75540364", "0.75499743", "0.75120616", "0.75078446", "0.7507804", "0.74805784", "0.7477673", "0.7469942", "0.74485946", "0.7413093", "0.7397492", "0.7388493", "0.73804", "0.73725456", "0.7360939", "0.7330859", "0.7323511", "0.7318862", "0.73033196", "0.72800094", "0.7270846", "0.72621304", "0.7255015", "0.72443867", "0.7237882", "0.7237836", "0.72010607", "0.72010607", "0.7182343", "0.71814793", "0.71814793", "0.71443695", "0.7142613", "0.71392345", "0.7137411", "0.7137083", "0.7134761", "0.713033", "0.71220976", "0.7106248", "0.709626", "0.709226", "0.70921296", "0.7090469", "0.70904243", "0.70841056", "0.70821434", "0.7069814", "0.70689774", "0.7068054", "0.7066263", "0.70645577", "0.70449", "0.70449", "0.7044696", "0.70422924", "0.70382553", "0.70255524", "0.7025326", "0.70190066", "0.70185894", "0.70156914", "0.70025986", "0.69985586", "0.6960844", "0.69557", "0.69531643", "0.69531643", "0.6951042", "0.6948694", "0.6944757", "0.6944757", "0.6944757", "0.69442374", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799", "0.6942799" ]
0.0
-1
Recreate the user based on the stored cookie source://devise//lib/devise/models/rememberable.rb139
def serialize_from_cookie(*args); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_current_user(user)\n sha1 = Digest::SHA1.hexdigest(user.id.to_s + Time.now.to_i.to_s)\n cookies[:remember_token] = { :value => sha1, :expires => 3.years.from_now }\n user.remember_token = sha1\n user.save\n @current_user = user\n end", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def sign_in(user)\n remember_token = User.new_remember_token\n cookies.permanent[:remember_token] = remember_token\n user.update_attribute(:remember_token, User.hash(remember_token))\n self.current_user = user\n end", "def sign_in(user)\n remember_token = User.new_remember_token\n cookies.permanent[:remember_token] = remember_token\n user.update_attribute(:remember_token, User.hash(remember_token))\n self.current_user = user\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def remember\n self.remember_token = Incline::User::new_token\n update_attribute(:remember_digest, Incline::User::digest(self.remember_token))\n end", "def remember\n self.remember_token_expires_at = 1.weeks.from_now.utc\n self.remember_token = Cryptography.encrypt_with_salt(\n SecureRandom.hex(10),\n remember_token_expires_at)\n save(false)\n end", "def remember\n self.remember_token = User.new_token\n self.remember_digest = User.digest(self.remember_token)\n update_attribute(:remember_digest, self.remember_digest) #for new user, this creates record\n end", "def remember(user)\n user.remember # Defined in the User model\n cookies[:user_id] = { value: user.id,\n expires: 20.years.from_now.utc }\n\n cookies[:remember_token] = { value: user.remember_token,\n expires: 20.years.from_now.utc }\n end", "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend", "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end", "def create_remember_token\n \t\tself.remember_token = User.encrypt(User.new_remember_token)\n \tend", "def sign_in(user)\n # Issues new random piece of text (aka\n # remember_token) to user\n remember_token = User.new_remember_token\n # Giving user plain text token\n cookies.permanent[:remember_token] = remember_token\n # Hashing the version of the remember_token which the host maintains.\n user.update_attribute(:remember_token, User.hash(remember_token))\n #sets the one who signed in (user) to current user\n self.current_user=user\n end", "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end", "def remember_me\n self.remember_token_expires_at = 1.day.from_now\n self.remember_token = Digest::SHA1.hexdigest(\"#{salt}--#{self.email}--#{self.remember_token_expires_at}\")\n self.password = \"\" # This bypasses password encryption, thus leaving password intact\n self.save_with_validation(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = User.encrypt(\"#{name}--#{remember_token_expires_at}\")\n save!(validate: false)\n end", "def assign_user_cookie_or_register\n if !self.persisted?\n self.is_registered = true if !self.email.nil?\n if !self.is_registered\n self.user_cookie = User.generate_new_user_cookie if self.user_cookie.blank?\n end\n end\n end", "def sign_in(user)\n remember_token = User.new_token\n cookies.permanent[:remember_token] = remember_token\n user.update_attribute(:remember_digest, User.digest(remember_token))\n cookies.permanent.signed[:user_id] = user.id\n self.current_user = user\n end", "def sign_in(user)\n # save current_user in remember_token cookie\n self.current_user = user \n cookies.permanent.signed[:remember_token] = [user.email, user.salt] \n end", "def handle_remember_cookie!(new_cookie_flag, klass)\n class_name = get_klass_name(klass)\n return unless @current_user\n if new_cookie_flag\n @current_user.remember_me \n else\n @current_user.refresh_token if valid_remember_cookie?(class_name) # keeping same expiry date\n end\n @current_user.reload\n cookie_options = {\n value: @current_user.remember_token,\n expires: @current_user.remember_token_expires_at\n }\n write_cookie!(klass, cookie_options)\n end", "def create_remember_token\n self.remember_token = User.new_token.to_s\n self.remember_digest = User.digest(remember_token)\n end", "def remember(user)\n user.remember # Calls model\n cookies.permanent.signed[:user_id] = user.id # Save off encryped user ID\n cookies.permanent[:remember_token] = user.remember_token # Save off random thing for validation\n end", "def set_user\n zeus = User.find(@zeus_user.id)\n zeus.state = User.states['retrieved_password']\n zeus.save!\n \n request.session[:rbac_user_id] = @zeus_user.id\n end", "def remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\nend", "def save_session user\n # The password_seed method is used to generate the stored token.\n # The remember_token is then stored as a signed cookie along with the\n # user's ID from the database.\n remember_token = password_seed\n cookies.permanent.signed[:remember_user_id] = user.id\n cookies.permanent.signed[:remember_user_token] = remember_token\n \n # The WHIRLPOOL hash of remember_token and the user's password seed is\n # then stored in the database.\n remember_hash = Digest::Whirlpool.hexdigest(remember_token +\n user.password_seed)\n user.update_attributes(:remember_hash => remember_hash)\n user.save\n end", "def remember!\n self.remember_token = User.random_token\n update_attribute(:remember_digest, User.password_digest_from(remember_token))\n end", "def create\n user = User.from_omniauth(request.env['omniauth.auth'])\n if params[:remember_me]\n cookies[:auth_token] = { value: user.auth_token,\n expires: 1.weeks.from_now.utc }\n else\n # browser doesn't delete session cookies if session restore used\n cookies[:auth_token] = { value: user.auth_token,\n expires: 30.minutes.from_now.utc }\n end\n redirect_to user_path(user), notice: \"Welcome #{user.nickname}\"\n end", "def create\n self.current_user = User.authenticate(params[:login], params[:password])\n if logged_in?\n if params[:remember_me] == \"1\"\n self.current_user.remember_me\n cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }\n end\n flash[:notice] = \"Welcome back, #{self.current_user.login}!\"\n #forget_location if stored_location == root_path\n redirect_back_or_default(user_url(current_user))\n else\n flash[:error] = true\n redirect_to login_path\n end\n end", "def remember\n self.remember_token = User.new_token\n # digest remember_token which is created from base64 library\n # -> update vao cai thang remember_digest!!!\n # noi chung la cu phai tu tu moi hieu het duoc !!!\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def sign_in(user)\n remember_token = User.new_remember_token # create a new remember token\n cookies.permanent[:remember_token] = remember_token # save the remember token on the client side as a cookie\n user.update_attributes remember_token: User.hash(remember_token) # save the remember token on the server side in the DB\n self.current_user = user\n end", "def remember\n self.login_token = User.new_token\n update_attribute(:login_digest, User.digest(self.login_token))\n end", "def remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember\n self.remember_token = User.generate_remember_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n # give the variable to \"self\", the user\n # sets the remember_token attribute of the user object\n self.remember_token = User.new_token\n # update attribute of the User, bypass validations (password), hash the\n # remember_token using digest (not totally sure that's right)\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember(user, type)\n user.remember_token = user.new_token\n user.update_attribute(:remember_digest, user.digest(user.remember_token))\n\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n cookies.permanent[:user_type] = type\n end", "def remember(user)\n#goes to remember method in user.rb and returns user.remember_token, and saves hashed one\n user.remember\n# saves users id\n cookies.permanent.signed[:user_id]=user.id\n# saves users cookies token\n cookies.permanent[:remember_token]=user.remember_token\n end", "def remember user\n # generates the remember token and saves it's encrypted form to the db\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def log_in_as(user)\n cookies[:remember_token] = user.remember_token\n end", "def remember(user)\n if user.class == Student\n user.remember_token = Student.new_token\n user.update_attribute(:remember_digest, Student.digest(user.remember_token))\n cookies.permanent.signed[:student_id] = user.id\n elsif user.class == Tutor\n user.remember_token = Tutor.new_token\n user.update_attribute(:remember_digest, Tutor.digest(user.remember_token))\n cookies.permanent.signed[:tutor_id] = user.id\n end\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember(user)\nuser.remember\ncookies.permanent.signed[:user_id] = user.id\ncookies.permanent[:remember_token] = user.remember_token\nend", "def remember_me\n self.remember_token_expires_at = 10.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end", "def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end", "def remember(user) \n user.remember # the method creates remember_token for that user and saves the hashed the version in the db \n cookies.permanent.signed[:user_id] = user.id # This stores the user.ID(encrypted) in the browser cookie\n cookies.permanent[:remember_token] = user.remember_token # This stores the remember token(encrypted) in the cookie \n # the remember token was created in the first line of code \"user.remember\"\n end", "def remember_me\r\n time = 1.week.from_now.utc\r\n self.remember_token_expires_at = time\r\n self.remember_token = self.class.encrypt(\"#{email}--#{remember_token_expires_at}\", self.salt)\r\n save(:validate => false)\r\n end", "def remember\n self.remember_token = User.new_token\n self.update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n self.remember_token = User.new_token\n update remember_digest: User.digest(remember_token)\n end", "def reset_user\n return unless exists?(:previous_user)\n set :user, fetch(:previous_user)\n unset :previous_user\n clear_sessions\n end", "def update_remember_me(user, remember_me)\n if remember_me == 1\n remember_me = SecureRandom.urlsafe_base64\n user.remember_me = remember_me\n cookies.permanent[:remember_me] = remember_me\n else\n user.remember_me = nil\n cookies.permanent[:remember_me] = nil\n end\n end", "def remember\n self.remember_token = User.new_token\n # encrypt remember_token and save it in :remember_digest field in db\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def user_remember(user)\n user.remember_user\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember(user)\n user.save_remember_digest\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember\n self.remember_token = User.new_token\n\n # update_attribute bypasses validations, since we don't have user's password\n # here, which is normally necessary for changing records on the table\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token \n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token\n\t\tself.remember_token = self.class.hash(User.new_token)\n\tend", "def remember\n self.remember_token = User.new_token\n self.update_attribute(:remember_digest, User.digest(self.remember_token))\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate=> false)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_token_digest, User.digest(remember_token))\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def user_remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc #remember token lasts 2 weeks\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{remember_token_expires_at}\")\n # save(:validate => false)\n end", "def remember\n #remember_token is virtual\n #actually, there is no remember_token attribtue in User model\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def login_from_cookie\nuser = cookies[:auth_token] && User.find_by_remember_token(cookies[:auth_token])\nif user && user.remember_token?\ncookies[:auth_token] = { :value => user.remember_token, :expires => user.remember_token_expires_at }\nself.current_user = user\nend\nend", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(validate: false)\n end", "def remember_me\n self.remember_token_expires_at = 2.months.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end", "def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end" ]
[ "0.7050115", "0.7045717", "0.7045717", "0.7045717", "0.6986146", "0.6921216", "0.6913341", "0.6873811", "0.6873811", "0.6862426", "0.6862426", "0.6862426", "0.68522865", "0.68513405", "0.68448716", "0.68182653", "0.68168133", "0.6803161", "0.6801333", "0.67731035", "0.6766844", "0.67436755", "0.67407256", "0.6737356", "0.6727997", "0.6727675", "0.672194", "0.671651", "0.67107385", "0.67083216", "0.6699131", "0.66984564", "0.6697448", "0.66972953", "0.66791147", "0.66779286", "0.6677131", "0.66709596", "0.66653377", "0.66629976", "0.666277", "0.66541123", "0.66479313", "0.66457605", "0.66405267", "0.663475", "0.66268873", "0.66265357", "0.662589", "0.662589", "0.66208035", "0.66178465", "0.6614502", "0.6612584", "0.661029", "0.66054", "0.66045696", "0.6602887", "0.6595856", "0.6592121", "0.6583562", "0.6580329", "0.65773875", "0.65756273", "0.6569442", "0.6568183", "0.656278", "0.65620756", "0.655434", "0.65520775", "0.65463793", "0.65457857", "0.6544858", "0.65385634", "0.65385634", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65373147", "0.65366936", "0.65366805", "0.65365094", "0.653547", "0.653321", "0.653321", "0.653321", "0.653321" ]
0.0
-1
Create the cookie key using the record id and remember_token source://devise//lib/devise/models/rememberable.rb134
def serialize_into_cookie(record); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end", "def create_remember_token\n \t\tself.remember_token = User.encrypt(User.new_remember_token)\n \tend", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.encrypt(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end", "def create_remember_token\n\t self.remember_token = User.encrypt(User.new_remember_token)\n\t end", "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n self.remember_token = User.hash(User.new_remember_token)\n end", "def create_remember_token\n\t\tself.remember_token = Client.encrypt(Client.new_remember_token)\n\tend", "def create_remember_token\n\t\tself.remember_token = self.class.hash(User.new_token)\n\tend", "def create_remember_token\n # Using the urlsafe-base64 method from the SecureRandom module\n # in the Ruby standard library, creates a Base64 string safe \n # for use in URIs, hence safe for use in cookies.\n # Returns a random string of length 16 composed of A-Z, a-z, 0-9,\n # - and _.\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def remember(user)\n#goes to remember method in user.rb and returns user.remember_token, and saves hashed one\n user.remember\n# saves users id\n cookies.permanent.signed[:user_id]=user.id\n# saves users cookies token\n cookies.permanent[:remember_token]=user.remember_token\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token \n self.remember_token = SecureRandom.urlsafe_base64\n end", "def remember!(cookies)\n cookie_expiration = 10.years.from_now\n cookies[:remember_me] = {:value => \"1\",\n :expires => cookie_expiration}\n self.authorization_token = unique_identifier\n self.save!\n cookies[:authorization_token] = {\n :value => self.authorization_token,\n :expires => cookie_expiration }\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def create_remember_token\n self.remember_token = SecureRandom.urlsafe_base64\n end", "def remember(user)\n user.remember # Defined in the User model\n cookies[:user_id] = { value: user.id,\n expires: 20.years.from_now.utc }\n\n cookies[:remember_token] = { value: user.remember_token,\n expires: 20.years.from_now.utc }\n end", "def remember!(cookies)\n cookies[:remember_me] = {:value => \"1\",\n :expires => COOKIE_EXPIRATION }\n \n self.authorization_token = unique_identifier\n self.save!\n cookies[:authorization_token] = {:value => self.authorization_token,\n :expires => COOKIE_EXPIRATION }\n end", "def create_remember_token \n\t\t\tself.remember_token = SecureRandom.urlsafe_base64\n\t\tend", "def create_remember_token\r\n \t\tself.remember_token = SecureRandom.urlsafe_base64\r\n \tend", "def remember!(cookies)\n cookie_expiration = 10.years.from_now\n cookies[:remember_me] = { :value => \"1\",\n :expires => cookie_expiration }\n self.authorization_token = unique_identifier\n save!\n cookies[:authorization_token] = { :value => authorization_token,\n :expires => cookie_expiration }\n end", "def remember!(cookies)\n cookie_expiration = 14.days.from_now\n cookies[:remember_me] = {:value => \"1\",\n :expires => cookie_expiration}\n self.authorization_token = unique_identifier\n save!\n cookies[:authorization_token] = {:value => authorization_token,\n :expires => cookie_expiration}\n end", "def remember_me!\n self.remember_token = encrypt(\"#{password_salt}--#{id}--#{Time.now.utc}\")\n save_without_validation\n end", "def serialize_into_cookie\n [uid, self.remember_token]\n end", "def remember(user) \n user.remember # the method creates remember_token for that user and saves the hashed the version in the db \n cookies.permanent.signed[:user_id] = user.id # This stores the user.ID(encrypted) in the browser cookie\n cookies.permanent[:remember_token] = user.remember_token # This stores the remember token(encrypted) in the cookie \n # the remember token was created in the first line of code \"user.remember\"\n end", "def remember\n self.remember_token_expires_at = 1.weeks.from_now.utc\n self.remember_token = Cryptography.encrypt_with_salt(\n SecureRandom.hex(10),\n remember_token_expires_at)\n save(false)\n end", "def create_remember_token\r\n #Creates the token\r\n self.remember_token = SecureRandom.urlsafe_base64\r\n #note: the capital \"R\" here, and caps in general MATTER\r\n \r\n #w/o the \"self\" assignment, would create local variable called\r\n #remember_token, using self ensures that assignment sets the\r\n #user's remember_token in the database with its other attributes\r\n #when the user is saved\r\n \r\n #SecureRandom is a module in the Ruby standard library that\r\n #creates a Base64 string safe for us in URIs (and therefore\r\n #cookies), it returns a random 16 character string, each character\r\n #has 64 possibilities\r\n end", "def remember!(cookies)\n\t\tcookie_expiration = 10.years.from_now\n\t\tcookies[:remember_me] = { :value => \"1\",\n\t\t\t\t\t\t\t\t :expires => cookie_expiration}\n\t\tself.authorization_token = secure_unique_identifier \n\t\tsave!\n\t\tcookies[:authorization_token] = {:value => authorization_token,\n\t\t\t\t\t\t\t\t\t\t :expires => cookie_expiration }\n\tend", "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end", "def remember(user)\nuser.remember\ncookies.permanent.signed[:user_id] = user.id\ncookies.permanent[:remember_token] = user.remember_token\nend", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{kerbid}--#{remember_token_expires_at}\")\n save(false)\n end", "def create_remember_token\n self.remember_token = User.digest(User.new_remember_token)\n end", "def remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\nend", "def serialize_from_cookie(*args)\n id, token, generated_at = *args\n\n record = to_adapter.get(id)\n record if record && record.remember_me?(token, generated_at)\n end", "def remember(user)\n user.remember # Calls model\n cookies.permanent.signed[:user_id] = user.id # Save off encryped user ID\n cookies.permanent[:remember_token] = user.remember_token # Save off random thing for validation\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{remember_token_expires_at}\")\n # save(:validate => false)\n end", "def set_cookie\n self.current_user.remember\n cookies[:auth_token] = { \n :value => self.current_user.remember_token, \n :expires => self.current_user.remember_token_expires_at }\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc #remember token lasts 2 weeks\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def stash_cookie\n cookies[self.class.els_options['cookie']] = {\n :value => @els_identity.token_id,\n :domain => request.env[\"SERVER_NAME\"],\n :path => '/',\n :expires => Time.now + 24.hours\n }\n end", "def create_remember_token\n self.remember_token = User.new_token.to_s\n self.remember_digest = User.digest(remember_token)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = User.encrypt(\"#{name}--#{remember_token_expires_at}\")\n save!(validate: false)\n end", "def get_id_from_cookie\n Sinatra::Authentication::Cookies::Hashing.decrypt(cookies[:ottoman_connection], settings.private_key)\n end", "def remember_me\n self.remember_token_expires_at = 10.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember(employee)\n employee.remember\n cookies.permanent.signed[:employee_id] = employee.id\n cookies.permanent[:remember_token] = employee.remember_token\n end", "def remember(baby)\n baby.remember\n cookies.permanent.encrypted[:baby_id] = baby.id\n cookies.permanent[:remember_token] = baby.remember_token\n end", "def generate_and_set_session_key email, expire=2592000\n email.downcase!\n session_key = SecureRandom.uuid\n $redis.set(\"userhash:#{session_key}\",email)\n session['userhash']=session_key\n session['user']=email\n if !expire.nil?\n $redis.expire(\"userhash:#{session_key}\",expire)\n end\n end", "def cookie\n { :value => Crypt.encrypt(cookie_value), :expires => 1.year.from_now }\n end", "def add_token_to_cookie(cookies)\n token = SecureRandom.urlsafe_base64()\n @user.update(token: token)\n cookies['token'] = token\n create_return_object()\n end", "def remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def remember_me\r\n self.remember_token_expires_at = 2.weeks.from_now.utc\r\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\r\n save(false)\r\n end", "def remember(user)\n user.remember\n cookies.permanent.signed[:user_id] = user.id # encrypt the user_id instead of plaintext\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember_me\n self.remember_token_expires_at = 2.months.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(false)\n end", "def generate_remember_token(token = SecureRandom.urlsafe_base64)\n self.remember_token = Digest::SHA1.hexdigest(token)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{login}--#{remember_token_expires_at}\")\n save(false)\n end", "def create_remember_token(column)\n self[column] = SecureRandom.urlsafe_base64\n end", "def remember(user)\n user.remember # call remember method from User model class\n # places these two cookies on the browser\n cookies.permanent.signed[:user_id] = user.id\n cookies.permanent[:remember_token] = user.remember_token\n end", "def remember(user)\n user.set_remember_token\n cookies.permanent.signed[:user_id] = user.id\n #user.remember_token is the User::remember_token class variable, \n #no getters on the rails train...\n cookies.permanent[:remember_token] = user.remember_token\n \n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate => false)\n end", "def remember_me\n self.remember_token_expires_at = 2.weeks.from_now.utc\n self.remember_token = encrypt(\"#{email}--#{remember_token_expires_at}\")\n save(:validate=> false)\n end", "def set_uuid_cookie\n uuid = cookies[:uuid] || UUIDTools::UUID.random_create.to_s\n cookies[:uuid] = { value: uuid, expires: 5.years.from_now }\n end", "def login_from_cookie\nuser = cookies[:auth_token] && User.find_by_remember_token(cookies[:auth_token])\nif user && user.remember_token?\ncookies[:auth_token] = { :value => user.remember_token, :expires => user.remember_token_expires_at }\nself.current_user = user\nend\nend", "def remember_me\r\n time = 1.week.from_now.utc\r\n self.remember_token_expires_at = time\r\n self.remember_token = self.class.encrypt(\"#{email}--#{remember_token_expires_at}\", self.salt)\r\n save(:validate => false)\r\n end", "def remember(account)\n account.remember\n cookies.permanent.signed[:account_id] = account.id\n cookies.permanent[:remember_token] = account.remember_token\n end", "def remember(doctor)\n doctor.remember\n cookies.permanent.signed[:doctor_id] = doctor.id\n cookies.permanent[:remember_token] = doctor.remember_token\n end", "def remember(doctor)\n doctor.remember\n cookies.permanent.signed[:doctor_id] = doctor.id\n cookies.permanent[:remember_token] = doctor.remember_token\n end", "def remember(customer)\n\t\tcookies.permanent.signed[:customer_id] = customer.id \n\tend", "def set_remember_token\n self.remember_token = SecureRandom.urlsafe_base64(32) if self.remember_token.blank?\n end", "def new_remember_token_token\n #It's only in Ruby 1.9\n #see https://github.com/rails/rails/commit/b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5\n SecureRandom.base64.gsub(\"/\",\"_\").gsub(/=+$/,\"\")\n end", "def sign_in(user)\n # save current_user in remember_token cookie\n self.current_user = user \n cookies.permanent.signed[:remember_token] = [user.email, user.salt] \n end", "def remember(user)\n # make a call to user.remember in our session controller remember method\n user.remember\n\n # now place the 2 cookies on the browser:\n # step 1:\n # cookies[:user_id] = { value: user.id, expires: 20.years.from_now.utc } -- same as:\n # cookies.permanent[:user_id] = user.id -- but this leaves user.id unencrypted..\n # session will encrypt user.id, but cookies will not so we need to call signed ..\n cookies.permanent.signed[:user_id] = user.id\n\n # step 2:\n # here we set random string(user.remember_token) to our cookies remember token..\n cookies.permanent[:remember_token] = user.remember_token\n\n # now lets modify current user to pull out permanent cookie if the user is NOT logged in..\n end", "def remember\n new_tok = User.new_token\n # Convert times to System.nanoTime(), Java style\n time = (Time.now.to_f * 10**9).to_i.to_s\n remember_hash[time] = Encrypt::Password.createHash(new_tok)\n update_attributes! remember_hash: remember_hash\n new_tok\n end", "def remember(person)\n person.remember\n # Generates a remember_token and saves its hash in the database.\n # Defined in person.rb.\n cookies.permanent.signed[:person_id] = person.id\n cookies.permanent[:remember_token] = person.remember_token\n # Encrypts id and remember_token and saves them as cookies.\n end", "def remember_token\r\n cookies.signed[:remember_token] || [nil, nil]\r\n end" ]
[ "0.71083146", "0.7097374", "0.7082634", "0.70500904", "0.7048962", "0.7048962", "0.7048962", "0.6994764", "0.6994764", "0.69767946", "0.6975423", "0.6975423", "0.6975423", "0.6940833", "0.69367534", "0.6936178", "0.69025475", "0.6874813", "0.6847579", "0.6847579", "0.6824919", "0.6808353", "0.6803664", "0.67918634", "0.6791008", "0.6771783", "0.67699546", "0.67622954", "0.674091", "0.67363155", "0.67264324", "0.67127794", "0.6711342", "0.67058015", "0.6670308", "0.6659454", "0.66302687", "0.65590924", "0.65574723", "0.65352166", "0.6496389", "0.6493738", "0.648386", "0.6474091", "0.64589244", "0.6458619", "0.6446487", "0.64435726", "0.64204663", "0.64170724", "0.6415938", "0.6409426", "0.64052683", "0.6393804", "0.63888335", "0.63865566", "0.63851184", "0.6378743", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6378184", "0.6365208", "0.6353718", "0.6346071", "0.63450044", "0.6344521", "0.63409454", "0.63236696", "0.63106155", "0.63039035", "0.63026005", "0.6301158", "0.629732", "0.62725794", "0.62653935", "0.6253429", "0.6253429", "0.62350893", "0.6226074", "0.6218684", "0.62142074", "0.6214119", "0.620918", "0.61975276", "0.6196832" ]
0.6371973
76
Checks whether the user session has expired based on configured time.
def timedout?(last_access); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_expired?\n if session[:last_authenticated_action_at]\n session_expires_at = session[:last_authenticated_action_at] + (60 * 60 * SESSION_HOURS)\n session_expires_at < Time.now\n else\n false\n end\n end", "def session_expired?\n return remote_user_name.nil? if remote_auth?\n return true if session[:timeout].nil?\n\n Time.zone.parse(session[:timeout]) < Time.current\n end", "def session_expired?\n ! (Time.now < session[:expire_at])\n end", "def expired_session?\n if session_info.nil?\n false\n else\n creds = session_info['credentials']\n creds['expires'] && creds['expires_at'] <= Time.now.to_i\n end\n end", "def access_expired? (time = Time.current)\n access_expires_at && time > access_expires_at\n end", "def expired?\n if user.where(:username => current_user).where(:expiration_time) < Time.now\n\n end\n end", "def session_expired?\n return true unless !session[:timeout].nil?\n if MarkusConfigurator.markus_config_remote_user_auth\n return true if @markus_auth_remote_user.nil?\n # Expire session if remote user does not match the session's uid\n current_user = User.find_by_id(session[:uid])\n if !current_user.nil?\n return true if ( current_user.user_name != @markus_auth_remote_user )\n end\n end\n return session[:timeout] < Time.now\n end", "def session_valid?\n @session_expiry_time > Time.now if @session_expiry_time\n end", "def expired?\n return true if authentication.nil?\n\n authentication.expires_at < 2.days.from_now\n end", "def expired_time? time\n time + self.class.ttl_in_seconds.to_i < Time.now\n end", "def expired?\n expires_at.to_time <= Time.now.utc\n end", "def expired?\n expires_at.to_time <= Time.now.utc\n end", "def session_valid?\n @session_expiry_time > Time.now if @session_expiry_time\n end", "def expired?\n Time.current >= expires_at\n end", "def expired?\n @expiry_time < Time.now\n end", "def expired?\n return false if @expires_in.nil?\n @start_time + Rational(@expires_in - @refresh_timeout, 86400) < DateTime.now\n end", "def expired?\n Time.now > expiration if expiration\n end", "def expired?\n @expires_at <= Time.now\n end", "def expired?\n expires_at && expires_at <= Time.now\n end", "def session_expiry\n unless session[:expires_at].nil?\n @time_left = (session[:expires_at] - Time.now).to_i\n unless @time_left > 0\n logout_killing_session!\n flash[:error] = 'Your session expired. Please, login again.'\n redirect_to login_url\n end\n end\n end", "def session_expiry\n unless session[:expires_at].nil?\n @time_left = (session[:expires_at] - Time.now).to_i\n unless @time_left > 0 \n logout_killing_session!\n gflash :notice => 'Your session expired. Please, login again.'\n redirect_to login_url\n end \n end \n end", "def session_expiry\n @time_left = (expiry_time - Time.now).to_i\n do_flash = false\n unless @time_left > 0\n unless current_user_session.nil?\n current_user_session.destroy\n do_flash = true\n end\n reset_session\n store_location\n flash[:notice] = t('app.security.session_expired',\n :default => \"Your session has been expired by inactivity.\") if do_flash\n redirect_to new_session_url\n end\n end", "def expired?\n @expires_in && @created_at + @expires_in <= Time.now.to_f\n end", "def expired?(now)\n @expires_at <= now\n end", "def expired?\n DateTime.now.utc >= self.expires_at\n end", "def expired?\n exp < Time.now.to_i\n end", "def expired?\n !respond_to?(:expires_at) || expires_at < Time.current\n end", "def expired?\n Time.now.in_time_zone > expires_at\n end", "def expired?\n expires_at && Time.now > expires_at\n end", "def expired?\n self.expires_at && Time.now.utc > self.expires_at\n end", "def expired?\n if expires?\n Time.now >= expires_at\n else\n false\n end\n end", "def expired?\n expiration_date <= Time.now\n end", "def expired?\n Time.now > @expires\n end", "def session_expiry\n get_session_time_left\n unless @session_time_left > 0\n # Commented this out as this was showing when the server comes up after being idle\n # If a user's session times out, the user is shown the message in sessions_helper.rb, deny_access method\n # flash.now[:error] = \"Your session has timed out or you haven't logged in. Please log in.\"\n sign_out\n \n end\n end", "def expired?\n !expires_at.nil? && Time.now >= expires_at\n end", "def expired?\n self.expires_at && Time.now > self.expires_at\n end", "def session_expired?\n return true if session[:timeout].nil?\n if Settings.remote_user_auth\n # expire session if there is not REMOTE_USER anymore.\n return true if @markus_auth_remote_user.nil?\n # If somebody switched role this state should be recorded\n # in the session. Expire only if session timed out.\n unless session[:real_uid].nil?\n # Roles have been switched, make sure that\n # real_user.user_name == @markus_auth_remote_user and\n # that the real user is in fact an admin.\n real_user = User.find_by_id(session[:real_uid])\n if real_user.user_name != @markus_auth_remote_user ||\n !real_user.admin?\n return true\n end\n # Otherwise, expire only if the session timed out.\n return Time.zone.parse(session[:timeout]) < Time.current\n end\n # Expire session if remote user does not match the session's uid.\n # We cannot have switched roles at this point.\n current_user = User.find_by_id(session[:uid])\n unless current_user.nil?\n return true if current_user.user_name != @markus_auth_remote_user\n end\n end\n # No REMOTE_USER is involed.\n Time.zone.parse(session[:timeout]) < Time.current\n end", "def expired?\n expires? && (expires_at < Time.now.to_i)\n end", "def expired?\n return false unless expires_at\n expires_at < Time.now\n end", "def check_session_time\n if !Rails.env.test? && @current_user && (@current_user.current_sign_in_at + 8.hours) < Time.now\n sign_out @current_user\n unless request[:path] == root_path\n redirect_to new_user_session_path\n end\n end\n end", "def check_validity\n if @expires_at == nil\n raise OAuthSessionError, \"Expiration not properly initialized.\"\n end\n if @expires_at < Time.new\n if not do_refresh\n raise OAuthSessionError, \"Token could not be refreshed.\"\n end\n end\n return true\n end", "def timeout_check\n # session[\"warden.user.user.session\"] comes from adding timeoutable to the user model\n # example: {\"last_request_at\"=>1537283353}\n if !session || !session[\"warden.user.user.session\"]\n render json: { timeout_status: 'no_current_user' }, status: 100\n elsif session[\"warden.user.user.session\"] && Time.zone.now.to_i > timeout_timestamp.to_i\n sign_out current_user\n flash[:notice] = \"Your session has timed out.\"\n render json: { timeout_status: 'timed_out' }, status: 200\n elsif session[\"warden.user.user.session\"] && Time.zone.now.to_i > timeout_warning_timestamp.to_i\n render json: { timeout_status: 'timeout_warning' }, status: 200\n else\n render json: { timeout_status: 'not_timed_out' }, status: 200\n end\n end", "def expired?(expire_time)\n return false if expire_time.nil? # Assume that expire check is disabled.\n return true unless expire_time.respond_to?(:to_i) # Verify that expire_time can be converted into an integer.\n\n # Checks to see if the expire time will elapse in the next 10 seconds.\n # True if now is greater than expire time. False if now is less than expire time.\n Time.now.to_i >= (expire_time.to_i - 10)\n end", "def expired?\n expires? && (Time.now > expires_at)\n end", "def expired?\n DateTime.now > @expires\n end", "def expired?\n Time.now > @expiration if @expiration\n end", "def session_expiry\n reset_session if session[:expiry_time] and session[:expiry_time] < Time.now\n\n session[:expiry_time] = MAX_SESSION_PERIOD.seconds.from_now\n return true\n end", "def expired?\n self.expires_on? and self.expires_on < Time.now\n end", "def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end", "def has_expired?\n self.expires_at ? self.expires_at < Time.now.utc : false\n end", "def expired?\n expires && expires < Time.now\n end", "def token_expired?\n return true\n expires_at < Time.now if expires_at?\n end", "def is_expired?\n (!end_time.nil? and end_time < Clock.time)\n end", "def expired? time\n time ||= Timers.now\n time >= @fire_time\n end", "def expired?\n Time.now > valid_until\n end", "def expired?\n Time.now > self.to_be_expired_at\n end", "def not_expired?\n self.expires_at && Time.now <= self.expires_at\n end", "def expired?(payload)\n Time.at(payload['exp']) < Time.now\n end", "def expired?\n # expired_at set (manually, via cron, etc.)\n return expired_at < Time.now.utc unless expired_at.nil?\n\n # if it is not set, check the last activity against configured expire_after time range\n return last_activity_at < self.class.expire_after.ago unless last_activity_at.nil?\n\n # if last_activity_at is nil as well, the user has to be 'fresh' and is therefore not expired\n false\n end", "def expired?\n return true if expires - Time.now <= 0\n return false\n end", "def time_expired?\n (Time.now - @duration) > @start_time\n end", "def expired?\n can_expire? && (self.expires_in + self.time_created) < Time.now.to_i\n end", "def expired?\n can_expire? && @expiry < Time.now.to_i\n end", "def request_expired?\n parsed_timestamp < request_expires_at\n end", "def check_session_expiry\n manage_session_expiry(ReferenceData::SystemParameter.lookup('PWS', 'SYS', 'RSTU', safe_lookup: true))\n end", "def expired?(time = Timers.now)\n time >= @fire_time\n end", "def expired?\n if (self.last_retrieved == nil)\n return true\n elsif (self.time_to_live < 30.minutes)\n return (self.last_retrieved + 30.minutes) < Time.now.gmtime\n else\n return (self.last_retrieved + self.time_to_live) < Time.now.gmtime\n end\n end", "def expired?\n age > ttl\n end", "def expired?\n age > ttl\n end", "def expired?\n false\n end", "def cached_daw_session_valid?\n login_time_set = rdaw_session.include?(:login_time)\n session_age = Time.now - Time.parse(rdaw_session[:login_time]) if login_time_set\n is_valid = login_time_set && session_age < session_timeout\n\n logger.debug('[rdaw] session expired or invalid') unless is_valid\n cookie_changed = hashcookie != rdaw_session[:hash]\n logger.debug(\"[rdaw] session invalidated because #{daw_cookie_name} cookie changed\") if cookie_changed\n\n is_valid && !cookie_changed\n end", "def expired?\n Time.zone.today > expires_at\n end", "def has_expired?(user)\n get_due_time(user) < Time.zone.now\n end", "def expired?\n Time.now - @created_time > @ttl\n end", "def expired?\n lifetime_in_days = time_in_seconds(@lifetime)\n @born + lifetime_in_days < DateTime.now\n end", "def expired?\n timestamp.nil? || (Time.now.to_i - timestamp.to_i).abs > 300\n end", "def expired?\r\n return Time.now > self.created_on + @@validity_time\r\n end", "def is_expired(datetime=nil)\n unless datetime\n datetime = Time.zone.now\n end\n \n if self.expiration_date < datetime\n return true\n else\n return false\n end\n end", "def access_token_expired?\n\t\taccess_token_expires_at && access_token_expires_at < Time.zone.now\n\tend", "def expiring?\n return true if expires - Time.now < 60\n return false\n end", "def is_token_expired?\n (Time.now - self.updated_at) > 3300\n end", "def token_expired?\n self.expires < Time.zone.now.to_i\n end", "def expired?\n @expired\n end", "def sign_out_expired_session\n return unless current_user.present?\n return if current_user.last_sign_in_check.present? && current_user.last_sign_in_check <= 5.minutes.ago\n\n current_user.update last_sign_in_check: Time.now\n\n if UniversumSsoClient.signed_out?(current_user.uid)\n session[:user_id] = nil\n @current_user = nil\n clear_iris_session\n end\n end", "def access_token_expired?\n Time.zone.now >= self.expires_at\n end", "def access_token_expired?\n Time.zone.now >= self.expires_at\n end", "def expired?(timeout)\n !@time_started.nil? && @time_completed.nil? && ((Time.now - @time_started) > timeout)\n end", "def access_token_expired?\n\t\t\t\treturn false if self.expires_at.nil?\n\n\t\t\t\t# Expiration date less than now == expired\n\t\t\t\tself.expires_at < Time.now\n\t\t\tend", "def expired?\n Date.today > self.expires_on\n end", "def refresh_expired?\n can_refresh_expire? && @refresh_expiry < Time.now.to_i\n end", "def check_valid_session\n unless current_user && !current_user.token_expired?\n sign_out(current_user)\n flash.keep[:notice]=\"Your session has expired.\"\n redirect_to :root\n return true\n end\n end", "def isTokenExpired\n if Time.now.to_i - @access_token_timestamp >= access_token_expires\n puts \"had to reauthenticate\"\n self.authenticate\n end\n end", "def expired?\n return if missing?\n\n validity < (reference_time - time)\n end", "def expired?\n end", "def check_session\n session.delete(\"accepted\") if session[:updated_at].present? && session[:updated_at].to_time <= 10.minutes.ago\n end", "def expired?\n return @expired\n end", "def lifetime_exceeded?(signed_in_at)\n feature_enabled? && !signed_in_at.nil? && signed_in_at <= max_session_lifetime.ago\n end", "def expired?\n return self.expires_on < Date.today if self.expires_on\n true\n end", "def session_timeout\n #return if Rails.env.test?\n #check session last_seen\n if session[:last_seen] < SESSION_TIMEOUT_MINUTES.minutes.ago\n reset_session\n else\n session[:last_seen] = Time.now.utc\n end unless session[:last_seen].nil?\n #check when session created\n if Session.first.created_at < SESSION_WIPEOUT_HOURS.hours.ago\n Session.sweep\n end unless Session.first.nil?\n end", "def check_session_validity\n if @current_user && @current_user.disabled_at\n sign_out @current_user\n redirect_to root_path, alert: 'Your account has been disabled by an administrator. Please contact us if you think this is incorrect.'\n end\n end", "def session_expired\n render :template => 'components/session_expired', :layout => 'application', :status => 400\n true\n end" ]
[ "0.812342", "0.8068149", "0.789425", "0.78812116", "0.7850685", "0.7731524", "0.76962364", "0.7664225", "0.76518095", "0.7648691", "0.76276946", "0.76276946", "0.7613397", "0.7604098", "0.7559811", "0.7526609", "0.74674106", "0.74661803", "0.744919", "0.74236035", "0.74197245", "0.741328", "0.7400951", "0.73907053", "0.738763", "0.738615", "0.7382989", "0.7380731", "0.73768264", "0.7374432", "0.7358212", "0.7357946", "0.7337691", "0.73252076", "0.731813", "0.73078537", "0.7307035", "0.730116", "0.72965467", "0.72793216", "0.72781724", "0.7269456", "0.72673833", "0.72595006", "0.72570926", "0.7251192", "0.7241078", "0.72370183", "0.72362226", "0.72362226", "0.72310215", "0.7222265", "0.7218228", "0.72103554", "0.7200776", "0.71837795", "0.71814454", "0.7175326", "0.71718764", "0.7157963", "0.71552044", "0.71466535", "0.7129667", "0.7114551", "0.71074426", "0.71010923", "0.7094942", "0.7090568", "0.7090568", "0.7081752", "0.7064388", "0.7043004", "0.70381284", "0.70293504", "0.700607", "0.700578", "0.7000048", "0.6993392", "0.69823086", "0.69731736", "0.6959443", "0.6936494", "0.69264334", "0.6924867", "0.6923925", "0.6923925", "0.69223666", "0.69204843", "0.69200695", "0.6917591", "0.6916972", "0.69150764", "0.6912213", "0.69115967", "0.6889855", "0.68845564", "0.68709284", "0.68706405", "0.68481725", "0.6837737", "0.6834" ]
0.0
-1
Checks whether a password is needed or not. For validations only. Passwords are always required if it's a new record, or if the password or confirmation are being set somewhere.
def password_required?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_required?\n @password_required\n end", "def password_required?\n self.crypted_password.blank? || !self.password.blank?\n end", "def password_required?\n crypted_password.blank? || !password.blank?\n end", "def password_required?\n return false if new_record?\n return false if can_log_in?\n return false if password.blank? and password_confirmation.blank?\n end", "def password_required?\n \n ( new_record? && oauth2_uid.nil? ) || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n password.present? || password_confirmation.present?\n end", "def password_required?\n force_password_validation || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n (!password.blank? && !password_confirmation.blank?) || new_record?\n end", "def password_required?\n (!password.blank? && !password_confirmation.blank?) || new_record?\n end", "def password_required?\n !persisted? || password.present? || password_confirmation.present?\n end", "def password_required?\n false\n end", "def password_required?\n false\n end", "def password_required?\n self.new_record? || self.encrypted_password.blank?\n end", "def password_required?\n new? or password\n end", "def password_required?\n\t\t!persisted? || ( !password.nil? and !password.blank? ) || !password_confirmation.nil?\n\tend", "def password_required?\n self.new_record? or !self.password.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.blank? || !password_confirmation.blank?\n end", "def password_required?\n if !persisted?\n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end", "def password_required?\n if !persisted?\n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end", "def password_required?\n encrypted_password.blank? || !password.blank?\n end", "def password_required?\r\n #!persisted? || !password.nil? || !password_confirmation.nil?\r\n !password.nil? || !password_confirmation.nil?\r\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n\n ( new_record? && meetup_uid.nil? ) || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n if persisted?\n return (!password.nil? || !password_confirmation.nil?)\n else\n return (password == \"\")\n end\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n !persisted? || !password.nil? || !password_confirmation.nil?\n end", "def password_required?\n if !persisted? \n false\n else\n !password.nil? || !password_confirmation.nil?\n end\n end", "def password_required?\n !password.nil?\n end", "def password_required?\n !password.nil?\n end", "def password_required?\n password_digest.nil? || !password.blank?\n end", "def password_required?\n confirmed? && (!password.blank?)\n end", "def password_required?\n new? or password\n end", "def validate_password?\n new_record? || password.present? || password_confirmation.present?\n end", "def password_required?\n (!persisted? && user_tokens.empty?) || password.present? || password_confirmation.present?\n end", "def password_required?\n if authentications.empty?\n super || encrypted_password.blank?\n elsif new_record?\n false\n else\n super || encrypted_password.blank? && authentications.find{|a| a.valid?}.nil?\n end\n end", "def password_required?\n if authentications.empty?\n super || encrypted_password.blank?\n elsif new_record?\n false\n else\n super || encrypted_password.blank? && authentications.find{|a| a.valid?}.nil?\n end\n end", "def password_required?\n !self.encrypted_password.nil?\n end", "def password_required?\n hashed_password.blank? || password.present?\n end", "def password_required?\n hashed_password.blank? || password.present?\n end", "def password_required?\n\t\tencrypted_password.blank? || !password.blank?\n\tend", "def password_required?\n if new_record?\n !(password.blank? && password_confirmation.blank?)\n else\n super\n end\n end", "def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end", "def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end", "def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end", "def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end", "def password_required?\n new_record? ? not_using_openid? && (crypted_password.blank? || !password.blank?) : !password.blank?\n end", "def password_required?\n false\n end", "def password_required?\n false\n end", "def password_required?\n false\n end", "def password_required?\n false\n end", "def password_required?\n false\n end", "def password_required? \n false \n end", "def password_required?\n admin? && (!persisted? || !password.nil? || !password_confirmation.nil?)\n end", "def password_required?\n # Skip password validations if facebook connect user\n return false if facebook_connect_user?\n crypted_password.blank? || !password.blank?\n end", "def password_required?\n signing && (!persisted? || !password.nil? || !password_confirmation.nil?)\n end", "def validate_password?\n password.present? || password_confirmation.present?\n end", "def validate_password?\n password.present?\n end", "def password_required?\n ## only validate a password when no authentication password is available\n ## delegate to super so we can inherit that behaviour too\n (authentications.empty? || !password.blank?) && super\n end", "def should_validate_password?\n self.encrypted_password.nil? || !self.password.nil?\n end", "def password_required?\n super\n end", "def password_required?\n super\n end", "def validate_password?\n active? && (password_hash.blank? || password.present? || password_required)\n end", "def needs_password?\n self.new_record? || !self.password.blank?\n end", "def needs_password?\n self.new_record? || !self.password.blank?\n end", "def password_required?; false; end", "def password_required?\n return false if using_open_id? || fb_user?\n crypted_password.blank? || !password.blank?\n end", "def filled_passwords?\n return true if password.present? && confirmation.present?\n\n @message = I18n.t('password.errors.password_required')\n false\n end", "def validate_password_presence\n if (new_record? && @password.blank?) || ([email protected]? && @password.empty?)\n errors.add(:password, \"can't be blank\")\n end\n end", "def password_required?\n super && self.is_password_set\n end", "def password_requirements(&block) #:nodoc:\n (class << self; self end).send(:define_method, :is_valid_password?, block)\n end", "def password_required\n return @password_required\n end", "def password_required\n return @password_required\n end", "def password_required\n return @password_required\n end", "def valid_password?\n password.present?\n end", "def valid_password?\n password.present?\n end", "def password_requirements(&block) #:nodoc:\n self.send(:define_method, :is_valid_password?, block)\n end", "def password_required?\n allow_blank_password ? false : super\n end", "def password_required?\n allow_blank_password ? false : super\n end", "def password_required?\n\t\t(authentications.empty? || !password.blank?) && super\n\tend", "def check_create_user_password_is_valid\n return self.password != \"\" ? true : false\n end", "def password_required?\n return false if self.guest? || self.customer?\n super\n end", "def password_must_be_present\n errors.add(:password, \"Missing password\") unless passwd.present?\n end", "def needs_password?(_user, params)\n params[:password].present?\n end", "def requires_password?\n is_new = (respond_to?(:new_record?) && new_record?)\n is_new || !ZeroAuth::Utils.empty?(password)\n end", "def should_give_password?\n self.password_hash.nil?\n end", "def should_validate_password?\n if self.crypted_password_changed?\n return true\n elsif self.force_password_validation\n return true\n else\n return false\n end\n end", "def password_reqs? \n pass = params[:user][:password]\n notice = []\n still_true = true\n\n if pass.length < MIN_PASS_LENGTH\n notice << \"Please use a longer password (at least #{MIN_PASS_LENGTH} characters).<br/>\"\n still_true = false\n end\n if pass.index( /[^[:alnum:]]/ ) == nil\n notice << \"Please include a symbol.<br/>\"\n still_true = false\n end\n if pass.index( /[0-9]/ ) == nil\n notice << \"Please include a number.<br/>\"\n still_true = false\n end\n if pass.index( /[a-z]/ ) == nil\n notice << \"Please include a lowercase letter.<br/>\"\n still_true = false\n end\n if pass.index( /[A-Z]/ ) == nil\n notice << \"Please include an uppercase letter.<br/>\"\n still_true = false\n end\n\n flash[:notice] = notice.join\n return still_true\n end", "def require_password?\n if self.new_record?\n APP_CONFIG[:auto_activate] or self.password\n else\n true and !self.password.nil?\n end\n end", "def validate_password\n if @user.password.blank?\n @user.errors.add :password, 'can\\'t be blank'\n elsif @user.password_confirmation.blank?\n @user.errors.add(\n :password_confirmation,\n \"is needed!\"\n )\n elsif @user.password.length < PASSWORD_MIN_LENGTH ||\n @user.password.length > PASSWORD_MAX_LENGTH\n @user.errors.add(\n :password,\n \"must be between #{PASSWORD_MIN_LENGTH} and #{PASSWORD_MAX_LENGTH} characters\"\n )\n end\n end", "def needs_password?\n params[:submit_method] == \"security\" ||\n (user_params[:email].present? && user.email != user_params[:email]) ||\n (user_params[:password].present? || user_params[:password_confirmation].present?)\n end", "def password_required?\n (authentications.empty? || !password.blank?) && super\n end", "def password_required?\n (authentications.empty? || !password.blank?) && super\n end" ]
[ "0.8490054", "0.8451329", "0.84213793", "0.8366036", "0.8310565", "0.83059686", "0.830266", "0.8282749", "0.8282749", "0.8279403", "0.82699335", "0.82699335", "0.82520956", "0.8245441", "0.82379097", "0.8226701", "0.8226691", "0.8226691", "0.82148165", "0.82130283", "0.82130283", "0.82099485", "0.8202287", "0.8183379", "0.81715107", "0.8163929", "0.8163929", "0.8162873", "0.8155181", "0.8155181", "0.8155181", "0.8155181", "0.8155181", "0.8155181", "0.8151407", "0.8144187", "0.8144187", "0.81343937", "0.80823517", "0.8075881", "0.80744857", "0.8063697", "0.80609244", "0.80609244", "0.8054876", "0.80343825", "0.80343825", "0.80304456", "0.8006513", "0.7994579", "0.7994579", "0.7994579", "0.7994579", "0.7994579", "0.79829544", "0.79829544", "0.79829544", "0.79829544", "0.79829544", "0.79809767", "0.79772407", "0.79721034", "0.7969164", "0.79448557", "0.7937426", "0.79121166", "0.78908545", "0.7876445", "0.7876445", "0.78293926", "0.7817062", "0.7817062", "0.7812748", "0.77859986", "0.7745857", "0.7737071", "0.770402", "0.7703514", "0.769256", "0.769256", "0.769256", "0.7685445", "0.7685445", "0.7664176", "0.762195", "0.762195", "0.76107913", "0.7599989", "0.7598943", "0.75959134", "0.7593085", "0.7591027", "0.7589772", "0.75877863", "0.7582481", "0.7578049", "0.75759727", "0.7569829", "0.7557752", "0.7557752" ]
0.80650663
41
Returns the value of attribute args. source://devise//lib/devise/omniauth/config.rb15
def args; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def args\n raw_args\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def config\n @default_args || Surrealist::HashUtils::EMPTY_HASH\n end", "def args\n @args.args\n end", "def omniauth\n request.env[\"omniauth.auth\"]\n end", "def args\n defined_args = []\n self.class.init_args.keys.each do | arg |\n if arg_val = send(arg)\n defined_args << \":#{arg} => #{arg_val}\"\n end\n end\n defined_args.join(\",\\n\")\n end", "def auth_hash\n # raise request.env['omniauth.auth'].to_yaml\n request.env[\"omniauth.auth\"]\n end", "def omniauth_params\n request.env['omniauth.auth'].to_hash\n end", "def omniauth_params\n request.env['omniauth.auth'].to_hash\n end", "def configName _args\n \"configName _args;\" \n end", "def authenticated_end_user?(args) \n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "def args\n @payload['args']\n end", "def arguments\n Properties[self.class] ||= {}\n return Properties[self.class][:args] || []\n end", "def authenticated_end_user?(args)\n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "def authenticated_end_user?(args)\n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "def auth\r\n request.env['omniauth.auth']\r\n end", "def auth_oauth_custom\n @attributes[:auth_oauth_custom]\n end", "def user_entry(arg)\n arg = arg.sub(/@.*$/, '').presence&.to_sym if arg.is_a?(String)\n # noinspection RubyMismatchedReturnType\n arg if arg.is_a?(Symbol) && (arg != :anonymous)\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def args\n @args\n end", "def auth\n \trequest.env['omniauth.auth']\n \tend", "def argument(args)\n args.first\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def args (configLoc)\n conf = File.dirname(__FILE__) + \"/#{configLoc}\"\n args = Array.new\n args << \"--private_token=#{ENV['TOKEN']}\"\n args << \"--config=#{conf}\"\n return args\n end", "def get_log_args\n args = {}\n args[\"APP_UUID\"] = @application.uuid if @application\n args[\"DOMAIN\"] = (@application.domain_namespace if @application) || (@domain.namespace if @domain)\n args\n end", "def following\n config['following']\nend", "def api_args\n return @api_args unless @api_args.blank?\n \n @api_args = settings.select_keys(\"client_id\", \"client_secret\")\n\n @api_args[\"response_type\"] = \"code\"\n\n uri = URI(my_addr)\n uri.path = \"/#{app.name}/authCallback\" \n @api_args[\"redirect_uri\"] = uri.to_s\n\n \n @api_args[\"token\"] = access_token if signed_in?\n\n @api_args[\"id\"] = user_entity[\"id\"].to_s if signed_in?\n\n return @api_args\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_params\n params = ActionController::Parameters.new(env[\"omniauth.auth\"])\n Hashie::Mash.new params.permit(:uid, :provider, info: [:name, :email])\n end", "def kernel_args(arg=nil)\n set_or_return(:kernel_args, arg, :kind_of => String)\n end", "def config=(*args); end", "def config=(*args); end", "def method_missing(name, *args, &block)\n if name.to_s[-1] == '='\n config[name[0..-2].to_s.upcase] = args[0]\n else\n config.fetch(name.to_s.upcase) {nil}\n end\n end", "def username\n @config['username']\n end", "def options\n @options ||= args.dig(:options) || {}\n end", "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "def initialize(args)\n args.symbolize_keys!\n\n @user = args.fetch(:user)\n @admin = args.fetch(:admin)\n end", "def arg(name)\n args = elements[\"arguments\"]\n args.each do |arg|\n arg_name = arg.elements[\"name\"].text\n if arg_name == name\n return arg.elements[\"value\"].text\n end\n end\n nil\n end", "def args\n @args \n end", "def arguments\n \"\"\n end", "def options\n params[:siringa_args]\n end", "def protected_args(args)\n args.map { |a| \"'#{a}'\" }\n end", "def omniauth_credentials\n if omniauth_hash = request.env['omniauth.auth']\n {\n provider: omniauth_hash['provider'],\n uid: omniauth_hash['uid'],\n email: omniauth_hash['info']['email'],\n name: omniauth_hash['info']['name'],\n }\n else\n nil\n end\n end", "def auth\n cfg_get(:auth)\n end", "def args() return @args end", "def parse_extension_args(args)\n @preferred_auth_policies = []\n policies_str = args['preferred_auth_policies']\n if policies_str\n policies_str.split(' ').each{|uri|\n add_policy_uri(uri)\n }\n end\n\n max_auth_age_str = args['max_auth_age']\n if max_auth_age_str\n @max_auth_age = max_auth_age_str.to_i\n else\n @max_auth_age = nil\n end\n end", "def clean_args(args)\r\n require_arg(args, :username)\r\n require_arg(args, :password)\r\n args[:username] = args[:username].downcase\r\n args[:override] = false unless args.key?(:override)\r\n return args\r\n end", "def user_id; config[:user_id]; end", "def process_attrasgn exp\n return exp unless @inside_config\n\n if exp.target == RAILS_CONFIG\n # Get rid of '=' at end\n attribute = exp.method.to_s[0..-2].to_sym\n if exp.args.length > 1\n # Multiple arguments?...not sure if this will ever happen\n @tracker.config.rails[attribute] = exp.args\n else\n @tracker.config.rails[attribute] = exp.first_arg\n end\n elsif include_rails_config? exp\n options = get_rails_config exp\n level = @tracker.config.rails\n options[0..-2].each do |o|\n level[o] ||= {}\n\n option = level[o]\n\n if not option.is_a? Hash\n Railroader.debug \"[Notice] Skipping config setting: #{options.map(&:to_s).join(\".\")}\"\n return exp\n end\n\n level = level[o]\n end\n\n level[options.last] = exp.first_arg\n end\n\n exp\n end", "def auth_param; end", "def social_identity\n auth = request.env['omniauth.auth']\n end", "def sign_in(*args); end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def auth\n cfg_get(:auth)\n end", "def access_token_in_request_params\n request.env['omniauth.auth']\n end", "def arguments=(value)\n @arguments = value.to_s.strip # TODO: Parse\n end", "def args\n @function.args\n end", "def incapacitatedState _args\n \"incapacitatedState _args;\" \n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def omniauth(provider, *args); end", "def url\n @url ||= args.dig(:url)\n end", "def args()\n #This is a stub, used for indexing\n end", "def argumentos(args)\n\thash = Hash.new\n\targs.each do |arg| \n\t\thash[arg.split('=').first] = arg.split('=').second\n\tend \n\treturn hash\nend", "def user_info\n auth_hash['user_info']\n end", "def getConnectedUav _args\n \"getConnectedUav _args;\" \n end", "def arguments\n self.class.dry_initializer.attributes(self)\n end", "def username\n @config[\"username\"]\n end", "def method_missing(*args)\n name = args[0].to_s\n if args.length == 1 # Getter\n if name =~ /^default_(.*)$/\n config_get_default('bgp_af', Regexp.last_match(1))\n else\n config_get('bgp_af', name, @get_args)\n end\n elsif args.length == 2 && name =~ /^(.*)=$/ # Setter\n set_args_keys(state: args[1] ? '' : 'no')\n config_set('bgp_af', Regexp.last_match(1), @set_args)\n else\n super\n end\n end", "def arguments; end", "def arguments; end" ]
[ "0.57246846", "0.565244", "0.5652251", "0.5652251", "0.5618413", "0.55730945", "0.5566852", "0.5563416", "0.55266315", "0.55177397", "0.55177397", "0.5515389", "0.5515245", "0.55147207", "0.5428537", "0.5420053", "0.5420053", "0.5408982", "0.54062474", "0.54042166", "0.5401278", "0.5401278", "0.5389372", "0.53713584", "0.53560835", "0.53116006", "0.53116006", "0.53116006", "0.53116006", "0.5308681", "0.52876157", "0.52423203", "0.52272356", "0.52252734", "0.52252734", "0.52252734", "0.52252734", "0.52252734", "0.52252734", "0.5222413", "0.5191244", "0.5176955", "0.5176955", "0.51729685", "0.5164272", "0.5154639", "0.5134653", "0.51191515", "0.50994056", "0.5095495", "0.5092098", "0.5092075", "0.5089016", "0.5087119", "0.50806415", "0.50583917", "0.5049934", "0.50453347", "0.502586", "0.5020108", "0.5004983", "0.49953786", "0.49870795", "0.49862587", "0.49556264", "0.4948096", "0.49433365", "0.49311247", "0.49220887", "0.4919155", "0.49190664", "0.49181667", "0.49108946", "0.48895073", "0.4877667", "0.48739976", "0.48589894", "0.48381773", "0.48335287", "0.4827533", "0.4827533" ]
0.4898716
92
Returns the value of attribute options. source://devise//lib/devise/omniauth/config.rb15
def options; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options\n attributes.fetch(:options)\n end", "def options\n config.options\n end", "def get_options\n @options\n end", "def options\n data[:options]\n end", "def options\n self.read_attribute(:options).split(\"\\n\") unless self.read_attribute(:options).nil?\n end", "def options\n @options\n end", "def options\n @options\n end", "def get_current_user_options\n response = get_current_user_meta('options')\n ret = {}\n response['query']['userinfo']['options'].each { |k, v| ret[k] = v }\n end", "def options\n @options\n end", "def options\n @options\n end", "def options\n @options\n end", "def options\n @options\n end", "def options\n return @options\n end", "def options\n return @options\n end", "def options\n self[:options] || {}\n end", "def options\n self[:options] || {}\n end", "def options\n @options ||= {}\n @options\n end", "def options\n @options ||= self.class.options\n end", "def html_options\n @options\n end", "def options\n @options ||= {}\n end", "def options\n @options ||= {}\n end", "def auth_oauth_custom\n @attributes[:auth_oauth_custom]\n end", "def initialization_options\n attributes.fetch(:initializationOptions)\n end", "def options\n @options ||= {}\n end", "def options\n @options ||= {}\n end", "def options\n @options ||= {}\n end", "def options\n self.class.instance_variable_get(:@__options) || []\n end", "def options\n @@options\n end", "def options\n @@options\n end", "def options\n @@options\n end", "def options\n @options ||= {}\n end", "def options\n @options ||= {}\n end", "def options\n @options ||= {}\n end", "def options\n return @data.options\n end", "def options ; @options ||= get(:options) end", "def options\n self.class.options\n end", "def options\n\t\treturn {\n\t\t\tdomain: self.domain,\n\t\t\tpath: self.path,\n\t\t\tsecure: self.secure?,\n\t\t\thttponly: self.httponly?,\n\t\t\texpires: self.expires,\n\t\t\tmax_age: self.max_age,\n\t\t\tversion: self.version,\n\t\t}\n\tend", "def user_options\n @user_options ||= {\n :max_email_size => self.max_email_size\n }\n end", "def options\n @options || {}\n end", "def options\n Hash[VALID_OPTIONS.map { |key| [key, send(key)] }]\n end", "def options\n @options || parse_and_return(:@options)\n end", "def user_options\n @additional_options.join(' ')\n end", "def options\n\t\t\tVALID_OPTIONS_KEYS.inject({}) do |option,key|\n\t\t\t\toption.merge!(key => send(key))\n\t\t\tend\n\t\tend", "def user_options; end", "def config_text\n owner.options\n end", "def option\n return @manager.configurable.class.configuration.options[key]\n end", "def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def get_options; end", "def omniauth\n request.env[\"omniauth.auth\"]\n end", "def options\n Hash[ *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def openid_options(value = nil)\n rw_config(:openid_options, value, {})\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def config\n @options[:config]\n end", "def attrs\n @options[:attrs]\n end", "def options\n\t\t\toptions = {}\n\t\t\tVALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n\t\t\toptions\n\t\tend", "def options_values\n options.map{ |opt| opt.value}\n end", "def options\n options = super\n\n options.merge(login: preferred_secret_key)\n end", "def option_details\n @@option_details\n end", "def options\n app.options\n end", "def options\n app.options\n end", "def options\n @_options ||= {}\n end", "def auth_options\n cfg = APP_CONFIG[\"ldap\"]\n {\n auth: {\n username: cfg[\"authentication\"][\"bind_dn\"],\n password: cfg[\"authentication\"][\"password\"],\n method: :simple\n }\n }\n end", "def options\n Hash[\n *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten\n ]\n end", "def options\n @scope.options\n end", "def attribute_options\n if self.class_variable_defined?(:@@attribute_options)\n class_variable_get(:@@attribute_options)\n else\n class_variable_set(:@@attribute_options, {})\n class_variable_get(:@@attribute_options)\n end\n end", "def options\n VALID_OPTIONS_KEYS.reduce({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def parsed_options\n config\n end", "def options \n self.merge!(@config.opts)\n end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def options\n {}.tap{ |options| VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) } }\n end", "def options=(value)\n @options = value\n end", "def options\n opts = {}\n self.configuration_options.each do |option|\n opts.merge!({option.name.to_sym => option.value})\n end\n opts\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def retrieve_options\n options = {}\n options['an'] = self.accession_number\n options['dbid'] = self.database_id\n options\n end", "def options\n Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end", "def options\n @options ||= Launchr::OrderedHash.new\n @options\n end", "def to_h\n @options.merge(\n 'value' => @value,\n 'HttpOnly' => http_only?,\n 'secure' => secure?\n )\n end", "def option_attributes\n @option_attributes || {}\n end", "def auth_google\n @attributes[:auth_google]\n end", "def options\n VALID_OPTIONS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n render \"devise/shared/_links\"\n end", "def warden_options\n env['warden.options']\n end", "def options\n @env || @default_options\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end", "def attr_encrypted_options=(options)\n @attr_encrypted_options = options\n end", "def options\n @options ||= OpenStruct.new\n end", "def attr_options name, options = {}\n @attr_options ||= {}\n @attr_options[name] = options\n end", "def options\n Properties[self.class] ||= {}\n return Properties[self.class][:opts] || []\n end", "def options \n options = {}\n VALID_OPTIONS_KEYS.each {|k| options[k] = send(k)}\n options\n end", "def options=(value)\n @@options = value\n end", "def options=(value)\n @@options = value\n end", "def options\n self.class.options(url)\n end" ]
[ "0.69141525", "0.65716684", "0.6566565", "0.6505163", "0.6429098", "0.6361147", "0.6361147", "0.6327273", "0.6310098", "0.6310098", "0.62896806", "0.6288678", "0.6284015", "0.62655485", "0.62122744", "0.61872447", "0.6166469", "0.616398", "0.61032736", "0.6097892", "0.6097892", "0.6092552", "0.6083809", "0.60787386", "0.60787386", "0.60787386", "0.6078729", "0.6074509", "0.6074509", "0.6074509", "0.6071064", "0.6071064", "0.6071064", "0.6054412", "0.6040222", "0.6035413", "0.602533", "0.6002389", "0.59643847", "0.59420973", "0.5931462", "0.59289247", "0.591751", "0.59111875", "0.5907598", "0.589228", "0.58738726", "0.58738726", "0.5860168", "0.58571327", "0.58558035", "0.5839519", "0.58244044", "0.58238876", "0.58238876", "0.5823106", "0.5821491", "0.58210534", "0.5816632", "0.5815228", "0.5808665", "0.5805898", "0.5805898", "0.5801918", "0.5785637", "0.5781467", "0.57571167", "0.5754517", "0.5743904", "0.57422316", "0.57420546", "0.5734825", "0.5726856", "0.5726201", "0.57253015", "0.5720784", "0.56997764", "0.5686516", "0.567643", "0.5671805", "0.56557894", "0.56523323", "0.56392545", "0.56386507", "0.56368065", "0.56354773", "0.5629189", "0.56133026", "0.56133026", "0.56133026", "0.56133026", "0.56133026", "0.56133026", "0.5611761", "0.56082463", "0.56002516", "0.5595383", "0.559143", "0.5588668", "0.5588668", "0.55852497" ]
0.0
-1
Returns the value of attribute provider. source://devise//lib/devise/omniauth/config.rb15
def provider; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provider_name\n return @provider_name\n end", "def resolve_provider\n attributes.fetch(:resolveProvider)\n end", "def provider_id\n return @provider_id\n end", "def provider\n @provider\n end", "def provider\n get(PROVIDER)\n end", "def provider\n authorization.provider\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def user_provider; end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def omniauth\n request.env[\"omniauth.auth\"]\n end", "def provider\n conf['provider'] || 'defaults'\n end", "def name\n @provider_name\n end", "def provider_name\n @json['profile']['providerName'] rescue nil\n end", "def auth_oauth_custom\n @attributes[:auth_oauth_custom]\n end", "def social_identity\n auth = request.env['omniauth.auth']\n end", "def provider_name(provider)\n Account.provider_name(provider)\n end", "def color_provider\n attributes.fetch(:colorProvider)\n end", "def moniker_provider\n attributes.fetch(:monikerProvider)\n end", "def provider\n use_provider('null') unless defined? @provider\n @provider\n end", "def diagnostic_provider\n attributes.fetch(:diagnosticProvider)\n end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def aws_access_key_attribute\n\t\t\"provider_account_#{Digest::MD5.hexdigest(name || 'unknown')}_aws_access_key\"\n\tend", "def provider_config\n @config[:providers].each do |provider|\n # Convert the symbol from the config into a string for comparison\n return (provider[1].nil? ? {} : provider[1]) if provider[0].to_s == @provider_name\n end\n\n nil\n end", "def provider_type\n provider.to_s.gsub(\"oauth2\", \"\").try(:titleize)\n end", "def provider_name=(value)\n @provider_name = value\n end", "def my_provider\n self.class.my_provider\n end", "def implementation_provider\n attributes.fetch(:implementationProvider)\n end", "def configured_providers\n Rails.configuration.providers.select do |provider|\n Rails.configuration.send(\"omniauth_#{provider}\")\n end\n end", "def configured_providers\n Rails.configuration.providers.select do |provider|\n Rails.configuration.send(\"omniauth_#{provider}\")\n end\n end", "def provider_name\n object.provider_id.titleize\n end", "def auth_google\n @attributes[:auth_google]\n end", "def provider_id=(value)\n @provider_id = value\n end", "def name\n @provider[:name]\n end", "def saml_provider_metadata_url\n @attributes[:saml_provider_metadata_url]\n end", "def is_provider?\n self.provider?\n end", "def provider_name\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller2_debug_verbose\n rv = params[:provider] || provider_name_from_state || browser.providers.each_key.to_a.first\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_name rv=#{rv}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n rv\n end", "def call_provider(value)\n method = self.class.name.to_s + \"=\"\n unless provider.respond_to? method\n self.fail \"The #{provider.class.name} provider can not handle attribute #{self.class.name}\"\n end\n provider.send(method, value)\n end", "def auth\r\n request.env['omniauth.auth']\r\n end", "def omniauth_providers\n @omniauth_providers ||= Account.omniauth_providers.map(&:to_s)\n end", "def provider\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller2_debug_verbose\n prov_name = provider_name\n rv = browser.providers[prov_name.to_sym] if prov_name.present?\n rv ||= browser.first_provider\n # browser.providers[provider_name.to_sym] || browser.first_provider\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider=#{rv}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n rv\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def creds\n\t\tRails.application.secrets.oa_cred[provider]\n\tend", "def provider\n providers.first\n end", "def auth_provider=( type )\n\t\t\t@auth_provider = Strelka::AuthProvider.get_subclass( type )\n\t\t\tself.log.debug \"Auth provider set to %p\" % [ @auth_provider ]\n\t\t\treturn @auth_provider\n\t\tend", "def provider_class\n self.class\n end", "def provider_class\n self.class\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def oauth_provider_humanized\n case provider\n when 'google' then 'Google'\n when 'github' then 'GitHub'\n end\n end", "def completion_provider\n attributes.fetch(:completionProvider)\n end", "def provider_name(provider)\n I18n.t(provider, scope: 'account.provider_name')\n end", "def access_token(provider)\n @provider = Config.send(provider)\n @provider.access_token\n end", "def inline_value_provider\n attributes.fetch(:inlineValueProvider)\n end", "def rename_provider\n attributes.fetch(:renameProvider)\n end", "def provider=(provider)\n @provider = provider\n end", "def providify\n newparam(:provider)\n nil\n end", "def auth\n \trequest.env['omniauth.auth']\n \tend", "def omniauth_credentials\n if omniauth_hash = request.env['omniauth.auth']\n {\n provider: omniauth_hash['provider'],\n uid: omniauth_hash['uid'],\n email: omniauth_hash['info']['email'],\n name: omniauth_hash['info']['name'],\n }\n else\n nil\n end\n end", "def references_provider\n attributes.fetch(:referencesProvider)\n end", "def provider_key\n map_options.try(:[], :provider_key)\n end", "def provider_name=(provider)\n unless provider.nil?\n @provider_name = provider.downcase\n end\n end", "def get_auth_data(provider, token)\n\t\t\tcase provider\n\t\t\t\twhen 'Facebook'\n\t\t\t\t\treturn {\n\t\t\t\t\t\t:uid \t=> token['uid'],\n\t\t\t\t\t\t:token \t=> token['extra']['raw_info']['token'],\n\t\t\t\t\t\t:email \t=> token['extra']['raw_info']['email'],\n\t\t\t\t\t\t:name \t=> token['extra']['raw_info']['name'],\n\t\t\t\t\t\t:link \t=> token['extra']['raw_info']['link'],\n\t\t\t\t\t\t:image_url\t=> token['image']\n\t\t\t\t\t}\n\n\t\t\t\twhen 'Google'\n\t\t\t\t\treturn {\n\t\t\t\t\t\t:uid => token['uid'],\n\t\t\t\t\t\t:token => token['credentials']['token'],\n\t\t\t\t\t\t:email => token['info']['email'],\n\t\t\t\t\t\t:name => token['info']['name']\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\traise \"Provider #{provider} not handled\"\n\t\t\tend\n\t\tend", "def provider\n system.provider\n end", "def current_provider\n if (provider_id = session[:provider_id])\n @current_provider ||= Provider.find_by(id: session[:provider_id])\n elsif (user_id = cookies.signed[:provider_id])\n user = User.find_by(id: provider_id)\n if user && user.authenticated?(:remember, cookies[:remember_token])\n log_in provider\n @current_provider = provider\n end\n end\n end", "def authentication provider=:identity\n Authentication.where(user_id: id, provider: provider).all.first\n end", "def provider\n SwitchUser::Provider.init(self)\n end", "def crypto_provider\n acts_as_authentic_config[:crypto_provider].tap { |provider|\n raise NilCryptoProvider if provider.nil?\n }\n end", "def cim_gateway\n @provider\n end", "def facebook?\n self.provider == 'facebook'\n end", "def providers\n authentication_strategies.pluck :provider\n end", "def configuration\n Rally.provider_configuration[name]\n end", "def provider_resource_id\n return @provider_resource_id\n end", "def token_for(provider)\n ident = self.identities_dataset.where(:provider => provider.to_s).first\n if(ident)\n ident.credentials[:token]\n end\n end", "def code_action_provider\n attributes.fetch(:codeActionProvider)\n end", "def provider_identity\n [self.source.name, self.uid].compact.join('_')\n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def omniauth?\n provider? && uid?\n end", "def gender\n\n if self.providers.size == 0\n return self.gender_custom\n end\n\n if self.gender_custom != \"none\"\n return self.gender_custom\n end\n\n return nil if self.providers.size == 0\n genders = self.providers.map(&:gender).compact\n return genders.first if !genders.empty?\n nil \n end", "def code_lens_provider\n attributes.fetch(:codeLensProvider)\n end", "def provider\n return @provider if defined? @provider\n Config.providers.each do |provider, config|\n if config[:exchanger_match] && matches?(config[:exchanger_match])\n return @provider = provider\n end\n end\n @provider = :default\n end", "def person_omniauth_authorize_path_or_url(provider)\n SecureUrlHelper.https? ? person_omniauth_authorize_url(provider, :protocol => 'https') : person_omniauth_authorize_path(provider)\n end", "def from_omniauth?\n uid.present? && provider.present?\n end", "def identify\n @user = User.new\n if omniauth = session[:omniauth]\n @provider = omniauth.provider.capitalize\n @user.apply_omniauth(omniauth)\n end\n end", "def crypto_provider(value = nil)\n config(:crypto_provider, value, CryptoProviders::Sha512)\n end", "def provider_class\n @provider_class ||= \"::Providers::#{self.provider.camelize}\".constantize.new(self)\n end", "def formatted_provider\n if provider_missing?\n case provider\n when 'ELDERSERVEHEALTH'\n Provider[5]\n when 'AMERIGROUP'\n Provider[1]\n else\n Provider[16]\n end\n else\n Provider.where(name: provider).first\n end\n end", "def get_value_for(value_provider, base = nil, **options)\n value_provider.get_value(base, **options)\n end", "def [](key)\n if key == \"provider\"\n return @provider\n end\n @hash[key]\n end", "def saml_provider_issuer_url\n @attributes[:saml_provider_issuer_url]\n end", "def provider\n global.env(@node.environment).provider\n end", "def user_provider=(_arg0); end", "def gender\n get_attribute(Yoti::Attribute::GENDER)\n end", "def provider\n EmailAddress::Config.providers.each do |name, defn|\n return name if EmailAddress::DomainMatcher.matches?(@host_name, defn[:domains])\n end\n nil\n end", "def authentication_method\n @attributes[:authentication_method]\n end" ]
[ "0.67844707", "0.6616658", "0.6591114", "0.65826297", "0.65462047", "0.6512388", "0.6508067", "0.65069693", "0.65069693", "0.65030724", "0.64132106", "0.64132106", "0.6408347", "0.63841444", "0.6352632", "0.63102144", "0.63056695", "0.62675506", "0.62518024", "0.623375", "0.6211306", "0.620311", "0.61944795", "0.61693656", "0.6153463", "0.61247575", "0.61034405", "0.61024404", "0.6074117", "0.6073661", "0.6060358", "0.6060358", "0.60435736", "0.6037026", "0.6023826", "0.59985006", "0.599329", "0.59883857", "0.59652185", "0.5953587", "0.59170794", "0.59123033", "0.5906191", "0.5901672", "0.5901672", "0.58754677", "0.5874977", "0.5851671", "0.5851438", "0.5851438", "0.58495486", "0.58495486", "0.58495486", "0.58495486", "0.58457637", "0.5825891", "0.580985", "0.58093315", "0.5806024", "0.5795467", "0.57876325", "0.57759935", "0.5768209", "0.5762078", "0.575761", "0.57502705", "0.5739899", "0.571004", "0.57079256", "0.568763", "0.5682122", "0.56751984", "0.5673948", "0.56606394", "0.56601834", "0.56478286", "0.56477505", "0.56457233", "0.56377244", "0.5631424", "0.5627194", "0.5620517", "0.5617603", "0.56128", "0.554585", "0.5532379", "0.55262774", "0.55226207", "0.5502493", "0.54944587", "0.5482936", "0.5482906", "0.5481209", "0.5456187", "0.5433948", "0.5429746", "0.54212385", "0.54057086", "0.5403213", "0.54023623", "0.5376311" ]
0.0
-1
Returns the value of attribute strategy. source://devise//lib/devise/omniauth/config.rb14
def strategy; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sso_strategy_id\n @attributes[:sso_strategy_id]\n end", "def strategy=(strategy)\n @strategy = strategy\n end", "def strategy=(strategy)\n case strategy\n when :user, :search\n @strategy = strategy\n end\n end", "def strategy_name\n options[:name] || @provider\n end", "def strategy_name; end", "def accessor_strategy\n @accessor_strategy_klass\n end", "def auth_oauth_custom\n @attributes[:auth_oauth_custom]\n end", "def strategy(value = nil)\n if value\n Registration.repositories[self].strategy = value\n Registration.clear_method_cache(self)\n else\n Registration.repositories[self].strategy\n end\n end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def secret_strategy\n ::Doorkeeper.config.token_secret_strategy\n end", "def secret_strategy\n ::Doorkeeper.config.token_secret_strategy\n end", "def myp_activity?\n self.strategy.class.name == \"UserStrategy\" \n end", "def secret_strategy\n ::Doorkeeper.config.application_secret_strategy\n end", "def auth_google\n @attributes[:auth_google]\n end", "def strategies\n Warden::Strategies\n end", "def social_identity\n auth = request.env['omniauth.auth']\n end", "def scim_authentication_method\n @attributes[:scim_authentication_method]\n end", "def providers\n authentication_strategies.pluck :provider\n end", "def color_provider\n attributes.fetch(:colorProvider)\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def account_mapping_mode(value=:auto)\n\t\t\t\taccount_mapping_mode_value(value)\n\t\t\tend", "def algorithm\n attributes.fetch(:algorithm) do\n Ably::Util::Crypto::DEFAULTS.fetch(:algorithm)\n end.downcase\n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def find_strategy(type)\n \"Simple::OAuth2::Strategies::#{type.to_s.camelize}\".constantize\n end", "def human_auth_method\n self[:auth_method].to_human\n end", "def implementation_provider\n attributes.fetch(:implementationProvider)\n end", "def mode\n attributes.fetch(:mode) do\n Ably::Util::Crypto::DEFAULTS.fetch(:mode)\n end.downcase\n end", "def omniauth\n request.env[\"omniauth.auth\"]\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def active_person_authorization\n return @children['active-person-authorization'][:value]\n end", "def provider\n authorization.provider\n end", "def auth\r\n request.env['omniauth.auth']\r\n end", "def initialize\n super\n @strategy = :user\n end", "def resolve_provider\n attributes.fetch(:resolveProvider)\n end", "def gender\n get_attribute(Yoti::Attribute::GENDER)\n end", "def default_strategy\n {\n strength: 10,\n speed: 20,\n intelligence: 10,\n integrity: 60,\n }\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def auth\n request.env['omniauth.auth']\n end", "def [](label)\n strategies[label]\n end", "def authorization_value(url)\n unless @@auth_config\n # Load auth.yml and make sure the information is not logged\n @@auth_config = LibertyBuildpack::Util::ConfigurationUtils.load('auth', true, false)\n # Sort keys by size with longest first.\n @@sorted_keys = @@auth_config.keys.sort { |a, b| b.size <=> a.size }\n end\n\n # Find the longest substring of the url among keys\n key = @@sorted_keys.find { |k| url.start_with? k }\n key ? @@auth_config[key] : nil\n end", "def person_omniauth_authorize_path_or_url(provider)\n SecureUrlHelper.https? ? person_omniauth_authorize_url(provider, :protocol => 'https') : person_omniauth_authorize_path(provider)\n end", "def [](label)\n _strategies[label]\n end", "def creds\n\t\tRails.application.secrets.oa_cred[provider]\n\tend", "def user_provider; end", "def auth\n \trequest.env['omniauth.auth']\n \tend", "def completion_provider\n attributes.fetch(:completionProvider)\n end", "def set_strategy\n @strategy = Strategy.find(params[:id])\n end", "def configure_membership_validation_strategy(strategy = nil)\n @membership_validator =\n case strategy.to_s\n when \"classic\"\n GitHub::Ldap::MembershipValidators::Classic\n when \"recursive\"\n GitHub::Ldap::MembershipValidators::Recursive\n when \"active_directory\"\n GitHub::Ldap::MembershipValidators::ActiveDirectory\n else\n # fallback to detection, defaulting to recursive strategy\n if active_directory_capability?\n GitHub::Ldap::MembershipValidators::ActiveDirectory\n else\n GitHub::Ldap::MembershipValidators::Recursive\n end\n end\n end", "def fallback_secret_strategy\n ::Doorkeeper.config.token_secret_fallback_strategy\n end", "def fallback_secret_strategy\n ::Doorkeeper.config.token_secret_fallback_strategy\n end", "def scheme\n attributes.fetch(:scheme)\n end", "def scheme\n attributes.fetch(:scheme)\n end", "def scheme\n attributes.fetch(:scheme)\n end", "def set_oauth_service_info(strategy_class, config)\n strategy_class.const_set(\"CONFIG\", config) unless strategy_class.const_defined?(\"CONFIG\")\n end", "def get(id)\n self.class.strategies.select { |strategy| strategy.id == strategy.id }\n end", "def preference_id\n user.uuid\n end", "def auth_hash\n # raise request.env['omniauth.auth'].to_yaml\n request.env[\"omniauth.auth\"]\n end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def strategy_class\n return unless auth?\n case @image\n when /\\.amazonaws\\.com/ # IE: 112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra\n Ecr\n when /gcr\\.io/\n Gcr\n end\n end", "def fallback_secret_strategy\n ::Doorkeeper.config.application_secret_fallback_strategy\n end", "def authorization_mode; end", "def saml_provider_sso_target_url\n @attributes[:saml_provider_sso_target_url]\n end", "def course_activity?\n self.strategy.class.name == \"CourseStrategy\"\n end", "def graph_strategy=(strategy)\n @graph_strategy = strategy\n end", "def usermode; @user_mode; end", "def hibernatemode\n return nil unless @property_hash.has_key? 'hibernatemode'\n\n @property_hash['hibernatemode'].to_i\n end", "def authentication_type; end", "def require_login_by\n @attributes[:require_login_by]\n end", "def policy\n self.permissions['policy'].to_sym\n end", "def automatic_user_consent_settings\n return @automatic_user_consent_settings\n end", "def custom_http_auth_scheme\n @custom_http_auth_scheme.to_s\n end", "def auth\n cfg_get(:auth)\n end", "def strategy\n @strategy ||= :file\n end", "def get_auth_url(use_callback_flow=true)\n raise 'To be implemented in child classes'\n end", "def authenticatable_salt\n read_attribute(:authenticatable_salt)\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def provider\n conf['provider'] || 'defaults'\n end", "def authorization_mode=(mode); end", "def strategy=(s); end", "def auth\n cfg_get(:auth)\n end", "def saml_provider_metadata_url\n @attributes[:saml_provider_metadata_url]\n end", "def bot_mode\n self['BOT']\n end", "def facebook?\n self.provider == 'facebook'\n end", "def profile\n @property[:profile]\n end", "def set_strategy\n if params[:id]\n @strategy = Strategy.find(params[:id])\n else \n @strategy = Strategy.find_by(uuid: params[:uuid])\n end\n end", "def auth_scheme; end" ]
[ "0.62699264", "0.6046586", "0.5935227", "0.5777281", "0.5736054", "0.5695039", "0.56903386", "0.5667022", "0.5644003", "0.5613939", "0.5613939", "0.5532913", "0.5532913", "0.5519923", "0.55030084", "0.5289134", "0.52737063", "0.52551293", "0.5249911", "0.51997143", "0.5199326", "0.51303643", "0.5129499", "0.5129499", "0.5121455", "0.5109474", "0.50687253", "0.5053672", "0.5040637", "0.5029025", "0.50275904", "0.50121444", "0.5009678", "0.5009678", "0.4983365", "0.4983255", "0.49809745", "0.49807778", "0.49676743", "0.4965889", "0.493642", "0.49299812", "0.49299812", "0.49299812", "0.49299812", "0.49223414", "0.48945573", "0.48899075", "0.4876112", "0.4866899", "0.4861517", "0.4857648", "0.48490024", "0.48423567", "0.4821267", "0.48143452", "0.48143452", "0.47872633", "0.47872633", "0.47872633", "0.47826856", "0.4774227", "0.47650835", "0.47535715", "0.47488737", "0.47488737", "0.47362563", "0.47362563", "0.47321323", "0.47197747", "0.4718659", "0.47182998", "0.47109437", "0.4705452", "0.47009555", "0.4693308", "0.46808162", "0.46622783", "0.46574697", "0.46518365", "0.46501455", "0.46437618", "0.46266854", "0.46236765", "0.46213958", "0.46058327", "0.46058327", "0.46058327", "0.46058327", "0.46058327", "0.46058327", "0.46014816", "0.45820016", "0.45818445", "0.4579951", "0.45729208", "0.45697215", "0.45556235", "0.4550367", "0.45501745", "0.4550068" ]
0.0
-1
Sets the attribute strategy
def strategy=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strategy=(strategy)\n @strategy = strategy\n end", "def set_attribute(name, value); end", "def setAttrib(name,value)\n\t\t@attributes[name] = value\n\tend", "def attribute_setter(attribute_name)\n \"set#{attribute_name.to_s.camelcase(:upper)}\"\n end", "def define_attribute_setter(attribute_name, options)\n define_method \"#{attribute_name}=\" do |value|\n send(\"#{attribute_name}_will_change!\") unless value == send(attribute_name)\n\n value = ActiveModel::Type.lookup(options[:type]).deserialize(value) if options[:type]\n\n instance_variable_set(\"@#{attribute_name}\", value)\n end\n end", "def attribute(turn_on, turn_off)\n RDoc::Markup::AttrChanger.new turn_on, turn_off\n end", "def attribute_set(name, value) \n if (name.to_sym == :aspects)\n @assigned_aspects = value\n else\n super(name, value)\n end\n end", "def set attribute, value\n attributes[attribute] = value\n end", "def []=(attribute, value)\n attribute = attribute.to_s.gsub(/[^a-zA-Z0-9_\\-]/, '').gsub('_', '-')\n # FIXME => Attributes per class\n unless POSSIBLE_ATTRIBUTES.include? attribute\n # FIXME: Log, don't print\n puts \"Warning! Attribute #{attribute} not recognized\"\n @canvas << js_method('attr', {attribute => value})\n return nil\n end\n @canvas << js_method('attr', {attribute => value})\n return self\n end", "def set_rateable_attribute\n @rateable_attribute = RateableAttribute.find(params[:id])\n end", "def attribute!(name, options={})\n super(name, options)\n define_method(\"#{name}=\") do |value|\n typecast_value = typecast_attribute(typecaster_for(self.class._attribute_type(name)), value)\n send(\"#{name}_will_change!\") unless typecast_value == read_attribute(name)\n super(value)\n end\n end", "def set_attribute(a,b)\n write_attribute(a,b)\n end", "def set_strategy\n if params[:id]\n @strategy = Strategy.find(params[:id])\n else \n @strategy = Strategy.find_by(uuid: params[:uuid])\n end\n end", "def set_attr\n @attr = Attr.find(params[:id])\n end", "def set_attr\n @attr = Attr.find(params[:id])\n end", "def set attrib, value\n if attrib.is_a? String and attrib.include? \".\"\n syms = attrib.split(\".\")\n first = syms[0]\n rest = syms[1..-1].join(\".\")\n self.send(first).set(rest, value)\n else\n self.send(\"#{attrib}=\".to_sym, value)\n end\n end", "def strategy=(strategy)\n case strategy\n when :user, :search\n @strategy = strategy\n end\n end", "def set_strategy\n @strategy = Strategy.find(params[:id])\n end", "def attributes=(*args)\n define_dynamic_answer_setters!\n super(*args)\n end", "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end", "def set_attribute\n @attribute = Attribute.find(params[:id])\n end", "def set_attribute\n @attribute = Attribute.find(params[:id])\n end", "def setAttribute(attributeName)\n @attributeName = attributeName\n end", "def set_attribute(key_, value_)\n attribute(key_, value_, :set)\n end", "def post_code_attribute_set(instance, name, attributes)\n self.default_attribute_set(instance, name, attributes)\n end", "def create_setter(name, meth)\n define_method(\"#{meth}=\") do |value|\n write_attribute(name, value)\n end\n end", "def set_attribute(name, value)\n @attributes[name] = value\n end", "def attr_setter(*attrs)\n code, made = '', []\n attrs.each do |a|\n code << \"def #{a}(*a); a.size > 0 ? (@#{a}=a[0]; self) : @#{a} end\\n\"\n made << a.to_sym\n end\n module_eval(code)\n made\n end", "def on_attribute(attribute)\n @attribute = attribute\n self\n end", "def []=(attr, value)\n @attrs[attr] = value\n end", "def []=(attr, value)\n if Roomorama::Property::ATTRIBUTES.include?(attr)\n setter = [attr, \"=\"].join\n public_send(setter, value)\n end\n end", "def strategy=(classifier)\n is_interchangeable?(classifier)\n if @strategy && classifier.category_count == 0\n previous_strategy = @strategy\n @strategy = classifier\n convert_categories_with_docs(previous_strategy)\n else\n @strategy = classifier\n end\n end", "def set_attribute(ents, handle, name, value)\n ents.each { |e|\n e.set_attribute(handle, name, value)\n }\n end", "def set_single_attribute(attribute_name, attribute_value, opts = {})\n Operation::Service.set_attribute(\n :attribute_name => attribute_name,\n :attribute_value => attribute_value,\n :encrypt => opts[:encrypt],\n :service_instance => self.service_instance,\n :service_instance_dir => self.service_instance_dir\n )\n end", "def use(strategy)\n prediction_strategies << strategy\n end", "def attribute=(name, value)\n @attributes ||= {}\n @attributes[name] = value\n end", "def set_attribute(attribute,value,index=0)\n index = normalize_index(index)\n# puts \"<br>SETTING ATTRIBUTE #{attribute}[#{index}]=#{value} [caller: #{trace}]\"\n @attributes[index] ||= {}\n @attributes[index][normalize_attribute(attribute)] = value\n end", "def attribute_to_set; end", "def configure_attr(attr, default_value = nil)\n v = instance_variable_get(\"@#{attr}\".to_sym)\n v = default_value if v.nil?\n instance_variable_set(\"@#{attr}\".to_sym, eval_attr(v))\n end", "def set_attraction\n @attraction = Attraction.find(params[:id])\n end", "def attribute=(_arg0); end", "def attribute=(_arg0); end", "def attribute=(attribute_name, value)\n write_attribute(attribute_name, value)\n end", "def attribute=(attribute_name, value)\n write_attribute(attribute_name, value)\n end", "def update_attr_with_ial(attr, ial); end", "def update_attr_with_ial(attr, ial)\n ial[:refs]&.each do |ref|\n update_attr_with_ial(attr, ref) if (ref = @alds[ref])\n end\n ial.each do |k, v|\n if k == IAL_CLASS_ATTR\n attr[k] = \"#{attr[k]} #{v}\".lstrip\n elsif k.kind_of?(String)\n attr[k] = v\n end\n end\n end", "def []=(attr_name, value)\n if self.attribute_names.include?(attr_name.to_s)\n write_attribute(attr_name, value)\n else\n set_custom_attribute(attr_name, value)\n end\n end", "def use_accessor_strategy(klass, params={})\n klass.on_use(self, params)\n @accessor_strategy_params = params\n @accessor_strategy_klass = klass\n end", "def set_attribute(id, attr)\n\t\t\t@current_context.set_attribute(id, attr)\n\t\tend", "def attribute_set(name, value)\n properties[name].set(self, value)\n end", "def update_behavior(behavior, attributes)\n behavior.update(attributes)\n end", "def set_attr(name, value)\n each_value {|x| x[name] = value }\n end", "def set_attr(key, value)\n value = format_value(value)\n key = format_key(key)\n send(\"#{key}=\", value)\n rescue\n unless defined?(Rails).nil?\n $lxca_log.info(\n 'XClarityClient::Endpoints::BuildableResourceMixin',\n \"UNEXISTING ATTRIBUTES FOR #{self.class}: #{key}\"\n )\n end\n end", "def attributes= (attrs)\n attrs.each_pair do |name, value|\n field = schema.fields[name.to_s] || FieldDefinition.new(name, :type => value.class)\n setter = \"#{name}=\".to_sym\n if respond_to?(setter)\n send(setter, value)\n else\n write_attribute(field, value, self)\n end\n end\n end", "def set_product_strategy\n @product_strategy = ProductStrategy.find(params[:id])\n end", "def set(attribute, value)\n @attributes[attribute.to_s] = value\n nil\n end", "def attribute(attribute_name, options = T.unsafe(nil), &block); end", "def add_strategy(strategy)\n strategy = strategy.new(feature_set: self) if strategy.is_a? Class\n @strategies[strategy.name] = strategy\n end", "def attribute_method\n method_options = options\n\n lambda do |name, type = Object, options = {}|\n super(name, type, method_options.update(options))\n end\n end", "def generate_strategy_accessors\n\n attributes = []\n columns.keys.each do |column_name|\n attributes << column_name\n\n self.send(:define_attribute_methods, column_name)\n self.send(:define_method, column_name) { @strategy_hash[column_name] }\n self.send(:define_method, \"#{column_name}=\") do |value|\n send(\"#{column_name}_will_change!\") unless value == instance_variable_get(\"@_#{column_name}\")\n @strategy_hash[column_name] = value\n end\n end\n\n self.send(:define_method, :attributes) do\n Hash[attributes.map { |name, _| [name, send(name)] }]\n end\n end", "def strategy=(s); end", "def assign(attribute, value)\n @attributes[attribute.to_sym] = value\n end", "def define_attribute_methods(name, options) # :nodoc:\n define_method name do\n attributes[name] || options[:default]\n end\n\n define_method \"#{name}=\" do |object|\n attributes[name] = object\n end\n\n self.attribute_options[name] = options\n end", "def []= (attr_name, value) \n write_attribute(attr_name, value)\n end", "def create_setter_for(attribute, options)\n setter_method = \"#{attribute}=\"\n\n define_method setter_method do |value|\n if options[:allow_blank] || value != \"\"\n write_attribute(attribute, value)\n end\n end\n end", "def prepare_attribute!(_element, options)\n if options[:attribute].is_a?(FalseClass)\n options.except!(:attribute)\n elsif !options.key?(:attribute)\n options[:attribute] = true\n end\n end", "def attr_secure(*attributes)\n options = {\n :encryption_class => Secure,\n :secret_class => Secret,\n :env => ENV\n }.merge!(attributes.last.is_a?(Hash) ? attributes.pop : {})\n\n attribute = attributes.first\n\n define_method(\"#{attribute}=\") do |value|\n adapter = self.class.attr_secure_adapter\n secret = options[:secret_class].new(options).call(self)\n crypter = options[:encryption_class].new(secret)\n value = crypter.encrypt(value)\n\n adapter.write_attribute self, attribute, value\n end\n\n define_method(\"#{attribute}\") do\n adapter = self.class.attr_secure_adapter\n secret = options[:secret_class].new(options).call(self)\n crypter = options[:encryption_class].new(secret)\n value = adapter.read_attribute(self, attribute)\n\n crypter.decrypt value\n end\n end", "def store(attr_name, attr_options = {})\n attr_name = attr_name.to_sym\n if attributes.has_key? attr_name\n raise \"You should only call store or key once for #{model.name}##{attr_name}\"\n end\n attributes[attr_name] = DataMiner::Attribute.new self, attr_name, attr_options\n end", "def store(attr_name, attr_options = {})\n attr_name = attr_name.to_sym\n if attributes.has_key? attr_name\n raise \"You should only call store or key once for #{model.name}##{attr_name}\"\n end\n attributes[attr_name] = DataMiner::Attribute.new self, attr_name, attr_options\n end", "def write_set_attribute(attribute_name, value)\n column_type = ((column_definition = self.class.columns_hash[attribute_name.to_s]) and column_definition.type)\n value = value.to_s(10) if column_type == :string\n write_attribute(attribute_name, value)\n end", "def SetOverride(attrname, attrtype, values)\n assert { attrname.instance_of? String }\n assert { [SPH_ATTR_INTEGER, SPH_ATTR_TIMESTAMP, SPH_ATTR_BOOL, SPH_ATTR_FLOAT, SPH_ATTR_BIGINT].include?(attrtype) }\n assert { values.instance_of? Hash }\n\n @overrides << { 'attr' => attrname, 'type' => attrtype, 'values' => values }\n\t end", "def approach=(approach)\n validator = EnumAttributeValidator.new('String', ['unrestricted', 'curb'])\n unless validator.valid?(approach)\n fail ArgumentError, 'invalid value for \"approach\", must be one of #{validator.allowable_values}.'\n end\n @approach = approach\n end", "def attr_set_sb4(attr_type, attr_value)\n #This is a stub, used for indexing\n end", "def []=(attr_name, value)\n writer_method = \"#{attr_name}=\"\n send(writer_method, value) if respond_to?(writer_method)\n end", "def dc_initialize_attribute(kopy, attribute)\n default_value = self.class.initialize_attributes(self.class.column_defaults.dup)[attribute.to_s]\n kopy.send(:write_attribute, attribute, default_value)\n end", "def set_attribute_set\n @attribute_set = AttributeSet.find(params[:id])\n end", "def attribute=(name, val)\n write_attribute(name, val)\n end", "def method_missing(method_name, *args, &block)\n if method_name.to_s.end_with?('=')\n set_attribute(method_name, *args)\n elsif has_attribute?(method_name)\n get_attribute(method_name)\n else\n super\n end\n end", "def tool_attrs=(tool_attributes={})\n tool_attributes.each_pair do |k,v|\n tool.send(\"#{k}=\", v)\n end\n end", "def attrs_authoritative\n @authority = :attributes\n self\n end", "def set_execution_strategy(strategy)\n @execution_strategy = strategy\n end", "def set_b_strategy\n @b_strategy = BStrategy.find(params[:id])\n end", "def []=(attr_name, value)\n @attributes[attr_name.to_s] = value\n end", "def create_attribute options\n attributes = options[ :attributes ]\n attr_value = options[ :value ]\n attributes.each do | attr_name |\n self.class.class_eval do\n define_method attr_name do\n instance_variable_get \"@#{ attr_name }\"\n end\n define_method \"#{ attr_name }=\" do | value |\n instance_variable_set( \"@#{ attr_name }\", value )\n end\n end\n self.public_send( \"#{ attr_name }=\", attr_value )\n end\n end", "def []=(attribute, hint)\n self[attribute] << hint\n end", "def []=(attr_name, value)\n write_attribute(attr_name, value)\n end", "def set_image_attrib\n @image_attrib = ImageAttrib.find(params[:id])\n end", "def set_attractive\n @attractive = Attractive.find(params[:id])\n end", "def []=(attr_name, value)\n write_attribute(attr_name, value)\n end", "def []=(attr_name, value)\n write_attribute(attr_name, value)\n end", "def []=(attr_name, value)\n write_attribute(attr_name, value)\n end", "def []=(attr_name, value)\n write_attribute(attr_name, value)\n end", "def prepare_attribute!(_element, _options)\n end", "def set_attribute(dict_name, key, value)\n end", "def set_attributes(attrs = {})\n attrs.each do |key, value|\n set_attribute(key, value)\n end\n end", "def set_attribute(dict_name, key, value)\n end", "def set_attribute(dict_name, key, value)\n end", "def define_attribute_method(method_name)\n attribute_name = method_name.to_s.gsub(/([=\\?]?)$/, '')\n modifier = $1\n \n attribute = PublicEarth::Db::Attribute.find_by_name(attribute_name) || \n PublicEarth::Db::Attribute.find_by_name!(attribute_name.singularize)\n\n singular = attribute.name.singularize\n plural = attribute.name.pluralize\n\n # logger.debug \"Generating methods for #{attribute}\"\n \n unless base_respond_to? singular\n # logger.debug \"Generating #{singular} method\"\n instance_eval <<-DEFINE_METHODS\n def #{singular}(language = @current_language)\n @attributes[language.to_s][:#{attribute.name}]\n end\n DEFINE_METHODS\n end\n \n unless base_respond_to?(plural) \n if !attribute.allow_many?\n # logger.debug \"Aliasing #{plural} method to #{singular} method\"\n instance_eval <<-DEFINE_ALIAS\n alias :#{plural} :#{singular}\n DEFINE_ALIAS\n else\n # logger.debug \"Generating #{plural} method\"\n instance_eval <<-DEFINE_METHODS\n def #{plural}(language = @current_language)\n @attributes[language.to_s][:#{singular}] ||= ManyValues.new(self,\n PublicEarth::Db::Details::Attribute.new(self, nil, \n '#{singular}', nil, nil, @current_language, \n (@current_source_data_set && @current_source_data_set.id || nil), #{attribute.readonly == 't'}, 9999, false, \n false, #{attribute.allow_many == 't'}, '#{attribute.data_type}'))\n end\n DEFINE_METHODS\n end\n end\n\n unless base_respond_to? \"#{singular}=\"\n # logger.debug \"Generating #{singular}= method\"\n instance_eval <<-DEFINE_METHODS\n def #{singular}=(value)\n self['#{singular}'] = value\n end\n DEFINE_METHODS\n end\n \n unless base_respond_to?(\"#{plural}=\") || !attribute.allow_many?\n # logger.debug \"Generating #{plural}= method\"\n instance_eval <<-DEFINE_METHODS\n def #{plural}=(value)\n self['#{singular}'] = value\n end\n DEFINE_METHODS\n end\n \n unless base_respond_to? \"#{singular}?\"\n # logger.debug \"Generating #{singular}? method\"\n instance_eval <<-DEFINE_METHODS\n def #{singular}?\n self['#{singular}'].blank?\n end\n DEFINE_METHODS\n end\n\n unless base_respond_to?(\"#{plural}?\") || !attribute.allow_many?\n # logger.debug \"Generating #{plural}? method\"\n instance_eval <<-DEFINE_METHODS\n def #{plural}?\n self['#{singular}'].blank?\n end\n DEFINE_METHODS\n end\n \n end", "def set_attrs (key, val)\n self.instance_variable_set(\"@#{key}\", val)\n self.class.send(:define_method, key, proc {self.instance_variable_get(\"@#{key}\")})\n end", "def attribute name, *attr\n\n # Add the attribute\n _attr = AttributeDefinition.new( name, *attr )\n attribute_definitions << _attr\n\n # Inject object with getter and setter for attribute\n define_setter_and_getter(name, _attr)\n end", "def assign_attribute(name, value)\n self.send(\"#{name}=\", value) if has_attribute?(name)\n end" ]
[ "0.64490783", "0.63256466", "0.6319037", "0.62971205", "0.6225093", "0.6007117", "0.59310037", "0.5903632", "0.5888784", "0.5823315", "0.5805067", "0.5804279", "0.5734053", "0.5719925", "0.5719925", "0.57176334", "0.57173824", "0.571669", "0.570502", "0.56747437", "0.5659538", "0.5659538", "0.56447", "0.5638804", "0.5636718", "0.56272066", "0.5618695", "0.561695", "0.5607751", "0.5600169", "0.55971915", "0.55849797", "0.5577788", "0.5568608", "0.5561667", "0.55610025", "0.55378705", "0.55356133", "0.5518772", "0.5511581", "0.5508556", "0.5508556", "0.54995584", "0.54995584", "0.5478116", "0.54733676", "0.54724026", "0.5465993", "0.5465199", "0.54621476", "0.5457575", "0.54435784", "0.5437927", "0.54323274", "0.5430001", "0.5421185", "0.5414129", "0.54051274", "0.5393881", "0.53938687", "0.5380006", "0.53683454", "0.5367961", "0.53556466", "0.535415", "0.5348417", "0.5344589", "0.5307122", "0.5307122", "0.5306963", "0.5300112", "0.52946836", "0.5293963", "0.5288576", "0.52870005", "0.52830184", "0.5282245", "0.5275579", "0.5273003", "0.52711505", "0.52668947", "0.52646494", "0.52528185", "0.5250918", "0.52495724", "0.5247764", "0.5245948", "0.5241605", "0.52385086", "0.5236316", "0.5236316", "0.5236316", "0.5236142", "0.5235838", "0.52293926", "0.5228825", "0.5228825", "0.5226397", "0.52233326", "0.52209496", "0.52058727" ]
0.0
-1
Returns the value of attribute strategy_name. source://devise//lib/devise/omniauth/config.rb15
def strategy_name; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strategy_name\n options[:name] || @provider\n end", "def sso_strategy_id\n @attributes[:sso_strategy_id]\n end", "def strategy=(strategy)\n @strategy = strategy\n end", "def strategy=(strategy)\n case strategy\n when :user, :search\n @strategy = strategy\n end\n end", "def provider_name\n return @provider_name\n end", "def provider_name(provider)\n Account.provider_name(provider)\n end", "def name\n @provider_name\n end", "def find_strategy(type)\n \"Simple::OAuth2::Strategies::#{type.to_s.camelize}\".constantize\n end", "def provider_name\n @json['profile']['providerName'] rescue nil\n end", "def name\n @provider[:name]\n end", "def strategy(value = nil)\n if value\n Registration.repositories[self].strategy = value\n Registration.clear_method_cache(self)\n else\n Registration.repositories[self].strategy\n end\n end", "def provider_name\n object.provider_id.titleize\n end", "def secret_strategy\n ::Doorkeeper.config.token_secret_strategy\n end", "def secret_strategy\n ::Doorkeeper.config.token_secret_strategy\n end", "def oauth_provider_humanized\n case provider\n when 'google' then 'Google'\n when 'github' then 'GitHub'\n end\n end", "def provider_type\n provider.to_s.gsub(\"oauth2\", \"\").try(:titleize)\n end", "def secret_strategy\n ::Doorkeeper.config.application_secret_strategy\n end", "def service_name\n if settings && settings[\"service_name\"].present?\n settings[\"service_name\"]\n else\n APP_CONFIG.global_service_name || \"Sharetribe\"\n end\n end", "def service_name\n if settings && settings[\"service_name\"].present?\n settings[\"service_name\"]\n else\n APP_CONFIG.global_service_name || \"Sharetribe\"\n end\n end", "def providers\n authentication_strategies.pluck :provider\n end", "def name\n config[\"name\"]\n end", "def provider_name(provider)\n I18n.t(provider, scope: 'account.provider_name')\n end", "def myp_activity?\n self.strategy.class.name == \"UserStrategy\" \n end", "def provider_name\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller2_debug_verbose\n rv = params[:provider] || provider_name_from_state || browser.providers.each_key.to_a.first\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_name rv=#{rv}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n rv\n end", "def name\n authentications.first.name\n end", "def name\n @config.name\n end", "def config\n name.split('_')[2] || 'default'\n end", "def name\n auth[:info][:name] || auth[:info][:display_name] rescue nil\n end", "def strategies\n Warden::Strategies\n end", "def label\r\n @label ? @label : \"#{super}_#{strategy_name}\"\r\n end", "def username\n @username ||= config_value.split('-')[0]\n end", "def account_name\n return @account_name\n end", "def account_name\n return @account_name\n end", "def set_oauth_service_info(strategy_class, config)\n strategy_class.const_set(\"CONFIG\", config) unless strategy_class.const_defined?(\"CONFIG\")\n end", "def conf_name\n name\n end", "def name\n if facebook_authentication && facebook_authentication.display_name\n return facebook_authentication.display_name\n end\n return username\n end", "def provider\n authorization.provider\n end", "def config_name\n self.class.config_name\n end", "def profile_name\n return self.profile.name\n end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def name\n name = self[:name]\n name.blank? ? login : name\n end", "def auth_oauth_custom\n @attributes[:auth_oauth_custom]\n end", "def provider_name=(provider)\n unless provider.nil?\n @provider_name = provider.downcase\n end\n end", "def authenticatable_name\n @authenticatable_name ||=\n self.class.name.split(\"::\").last.underscore.sub(\"_authenticatable\", \"\").to_sym\n end", "def hubssolib_get_user_name\n user = self.hubssolib_current_user\n user ? user.user_real_name : nil\n end", "def method_auth_name\r\n method_info[:method_auth_name]\r\n end", "def [](label)\n strategies[label]\n end", "def person_omniauth_authorize_path_or_url(provider)\n SecureUrlHelper.https? ? person_omniauth_authorize_url(provider, :protocol => 'https') : person_omniauth_authorize_path(provider)\n end", "def provider_name=(value)\n @provider_name = value\n end", "def social_identity\n auth = request.env['omniauth.auth']\n end", "def config_name\n self.class.name.demodulize.underscore\n end", "def provider\n conf['provider'] || 'defaults'\n end", "def accessor_strategy\n @accessor_strategy_klass\n end", "def human_auth_method\n self[:auth_method].to_human\n end", "def name\n\t\tif name_source.present?\n\t\t\tproviders = [\"twitter\",\"facebook\",\"google_oauth2\",\"lastfm\",\"vimeo\"]\n\t\t\tp,v = name_source.split(\"::\",2)\n\t\t\treturn name_source unless p.in? providers\n\t\t\tl = self.links.find_by(provider: p)\n\t\t\tif l\n\t\t\t\tnames = l.names\n\t\t\t\treturn names[v.to_sym] if names.is_a? Hash and v and names[v.to_sym]\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn custom_name if custom_name.present?\n\t\treturn email.split('@')[0].titleize if email.present?\n\t\tUser.default_name\n\tend", "def name\n @name ||= (@config[:name] || self.class.name.split(/::/).last.titleize)\n end", "def authenticatable_name; end", "def name\n @name ||= config(\"name\", \"WorkshopDash\")\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def omniauth\n request.env['omniauth.auth']\n end", "def login_name\n return @login_name\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def get_screen_name\n @screen_name ||= self.verify_credentials.screen_name\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def rename_provider\n attributes.fetch(:renameProvider)\n end", "def strategy_class\n return unless auth?\n case @image\n when /\\.amazonaws\\.com/ # IE: 112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra\n Ecr\n when /gcr\\.io/\n Gcr\n end\n end", "def pedant_orgname\n Pedant::Config.use_default_org ? Pedant::Config.default_orgname : Pedant::Config[:org][:name]\n end", "def omniauth\n request.env[\"omniauth.auth\"]\n end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "def configuration\n Rally.provider_configuration[name]\n end", "def name_unless_default\n name == Rack::OAuth.default_instance_name ? nil : name\n end", "def profile_name\n name.present? ? name : identifier\n end", "def adapter_name_by_features\n self.class.instance_methods(false).each do |m|\n if (m =~ /^features_of_([\\w]+[_\\w]+)_adapter$/)\n return self.send(m.to_sym)\n end\n end\n nil\n end", "def scheme_name\n svc = minter\n return nil unless svc.present?\n\n scheme(svc: svc)&.name&.downcase\n end", "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end", "def [](label)\n _strategies[label]\n end", "def fallback_secret_strategy\n ::Doorkeeper.config.token_secret_fallback_strategy\n end", "def fallback_secret_strategy\n ::Doorkeeper.config.token_secret_fallback_strategy\n end", "def user_name\n self.user.login\n end", "def user_name\n self.user.login\n end", "def authenticatable_name\n @authenticatable_name ||=\n ActiveSupport::Inflector.underscore(self.class.name.split(\"::\").last).\n sub(\"_authenticatable\", \"\").to_sym\n end", "def profileName \n \"profileName\" \n end", "def username\n @config['username']\n end", "def acct_name\n @name\n end", "def username\n @config[\"username\"]\n end", "def auth_google\n @attributes[:auth_google]\n end", "def user_name\n read_attribute('user_name') || \"anonymous\"\n end", "def account_name\n self.current_account.try :name\n end", "def set_strategy\n @strategy = Strategy.find(params[:id])\n end", "def _fetch_strategy(name, scope)\n @strategies[scope][name] ||= if klass = Watchman::Strategies[name]\n klass.new(@env, scope)\n elsif @config.silence_missing_strategies?\n nil\n else\n raise \"Invalid strategy #{name}\"\n end\n end", "def custom_http_auth_scheme\n @custom_http_auth_scheme.to_s\n end", "def implementation_provider\n attributes.fetch(:implementationProvider)\n end", "def user_provider; end", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def creds\n\t\tRails.application.secrets.oa_cred[provider]\n\tend", "def get_account_name(current_value)\n name = sid_to_name(get_account_id(current_value))\n\n name || current_value\n end" ]
[ "0.7575968", "0.6587255", "0.6038663", "0.6008722", "0.5893972", "0.5840141", "0.5754211", "0.5739182", "0.57225186", "0.57202244", "0.5698709", "0.5479227", "0.54684186", "0.54684186", "0.5435582", "0.5426755", "0.5395208", "0.536803", "0.536803", "0.5362217", "0.53463876", "0.5330457", "0.5314768", "0.5294445", "0.52596366", "0.52487624", "0.5246157", "0.5235728", "0.52254033", "0.5207891", "0.518676", "0.5176236", "0.5176236", "0.5174224", "0.51697874", "0.5165532", "0.51648146", "0.51616955", "0.51589626", "0.5155133", "0.51517177", "0.5146497", "0.5145505", "0.51192343", "0.5118922", "0.5110669", "0.5109109", "0.51031965", "0.50930136", "0.5090797", "0.5085263", "0.5083814", "0.50832075", "0.5079247", "0.5058988", "0.5056398", "0.50371957", "0.5021703", "0.50160277", "0.50151086", "0.50151086", "0.5011102", "0.499497", "0.499497", "0.49867332", "0.49867234", "0.49867234", "0.49802545", "0.49565446", "0.4943433", "0.4939595", "0.4929604", "0.4929604", "0.49272385", "0.4924309", "0.4921781", "0.4912839", "0.4909755", "0.49088016", "0.49076226", "0.49057132", "0.49057132", "0.49022293", "0.49022293", "0.4895938", "0.48879832", "0.48876673", "0.48834747", "0.4881861", "0.48754108", "0.48737428", "0.4873734", "0.48725578", "0.48684812", "0.48615673", "0.48598075", "0.48560926", "0.48526907", "0.48522288", "0.4848239" ]
0.69640374
1
Force keys to be string to avoid injection on mongoid related database. source://devise//lib/devise/parameter_filter.rb31
def stringify_params(conditions); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringified_keys; end", "def permitted_keys\n @permitted_keys ||= properties.map(&:to_sym)\n end", "def strong_params_keys\n [key]\n end", "def devise_parameter_sanitizer; end", "def primary_key_string\n key_attributes.join(' ').parameterize\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: authentication_params(type: :sign_in))\n end", "def key_types=(_arg0); end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def stringify_keys!\n replace stringify_keys\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [])\n end", "def transform_param_keys_casing\n params.transform_keys!(&:underscore)\n end", "def stringify_keys; end", "def stringify_keys; end", "def stringify_keys; end", "def params_keys\n default_keys + advanced_keys\nend", "def permitted_keys\n self.class.instance_variable_get(:@permitted_keys) || []\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def stringify_keys\n transform_keys { |key| key.to_s rescue key }\n end", "def key(*args)\n key = super \n if converter_name = key.options[:as_string]\n key_name = key.name.to_sym \n available_as_string key_name, converter_name\n attr_protected \"#{key_name}_as_string\".to_sym if key.options[:protected] \n end\n key\n end", "def prepare_key(val)\n val.nil? ? val : val.to_s.downcase\n end", "def key_field\n 'key'\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n end", "def keys\n [:name, :username, :email, ]\n end", "def flexible_key; end", "def encode_parameter(key)\n IGNORED_PARAMETERS.include?(key) ? \"_#{key}\".to_sym : key\n end", "def configure_sign_in_params\n # devise_parameter_sanitizer.for(:sign_in) << :attribute\n devise_parameter_sanitizer.permit(:sign_in, keys: [:user, :password])\n end", "def stringify_keys!\n transform_keys!{ |key| key.to_s }\n end", "def key_coercion(key); end", "def coerce_keys(*attrs); end", "def stringify_keys!\n\t\t\tself.each do |k,v|\n\t\t\t\tnext if k.kind_of? String\n\t\t\t\tself[k.to_s] = v\n\t\t\t\tself.delete k\n\t\t\tend\n\t\tend", "def key_types; end", "def key_types; end", "def stringify_keys\n inject({}) do |options, (key, value)|\n options[(key.to_s rescue key) || key] = value\n options\n end\n end", "def sanitize(p, keys)\n new_params = {}\n keys.each { |k| new_params[k] = p[k] if p.include?(k) }\n return new_params.symbolize_keys\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:workshop_key])\n end", "def configure_sign_in_params\n # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])\n devise_parameter_sanitizer.permit(:sign_in) do |params|\n params.permit(:username, :password, :password_confirmation)\n end\n end", "def string_enforcer_params\n params.fetch(:string_enforcer, {})\n end", "def [](key)\n if key.is_a?(Hash) || key.is_a?(Array)\n filter(key)\n else\n super key.to_s\n end\n end", "def params_key(k)\n key = k.to_s.camelize\n key.gsub('Id', 'ID')\n end", "def key?(key)\n case key\n when String then super(key.intern)\n when Symbol then super(key)\n else super(key.to_s.intern)\n end\n end", "def key_coercions; end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:email, :password])\n end", "def coerce_key(*attrs); end", "def user_param_keys(include_virtual_attributes = true)\n include_virtual_attributes ? [:first_name, :last_name, :email, :password, :role] : [:first_name, :last_name, :email, :role]\n end", "def transform_params\n params.transform_keys! { |key| key.underscore }\n end", "def normalize_keys\n transform_keys { |key| key.downcase.to_sym rescue key }\n end", "def key_params\n params.require(:key).permit(:name, :value)\n end", "def allow_keys(keys)\n @allow_keys = keys\n end", "def safe_params\n safe_attributes = %i[name key]\n params.require(:role).permit(safe_attributes)\n end", "def sanitize_parameters(param)\n return param.map { |p| String(p) } if param.is_a?(Array)\n return param.map { |k, v| [String(k), String(v)] }.to_h if param.is_a?(Hash)\n return String(param)\n end", "def permitted_filter(params, key)\n params[key] = self[key] if has_key? key\n end", "def key(key)\n raise \"key must be a boolean.\" unless is_bool? key\n raise \"Only Edm.String fields can be keys.\" unless @type == \"Edm.String\"\n @key = key\n self\n end", "def key_for(key)\n key.is_a?(String) ? key : serialize(key)\n end", "def key_for(key)\n key.is_a?(String) ? key : serialize(key)\n end", "def sanitize_key key\n key.gsub! '-', '_'\n key.gsub! ' ', ''\n key.gsub! ',', ''\n key.downcase!\n return key\n end", "def stringify_keys!; self end", "def stringify_keys!; self end", "def configure_permitted_parameters\n \tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name username technology_id secondary_technology])\n end", "def configure_permitted_parameters\n # Devise implementation of Strong Params\n # keys is an array of symbols\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[nickname])\n end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name])\n end", "def convert_key(key); end", "def convert_key(key); end", "def convert_key(key); end", "def strip_string_fields\n all_fields = self.get_array_of_symbolic_keys\n # stripping\n all_fields.each do |field|\n unless self[field].nil?\n if self[field].class == String\n self[field] = self[field].strip\n end\n end\n end\n end", "def attributes_protected_by_default\n [\"key\"]\n end", "def id_param_keys\n [*super, :email].uniq\n end", "def valid_keys_to_query_string(o)\n str = ''\n o.each { |k,v| str << \"#{k}=#{v}&\" if VALID_KEYS.include?(k) }\n str\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def allowed_keys\n field_names - [id_column]\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in).push(:username, :login, :domain)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname, :family_name, :first_name, :kana_family_name, :kana_first_name, :birthday, :postal_code, :prefecture_id, :city, :street_address, :building, :phone_number, :shoe_size])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_in, keys: [:preferred_party_id, :willing_party_id, :consent_news_email])\n end", "def key_params\n params.require(:key).permit(:key, :note, :data_type)\n end", "def filter_users\n allowed_keys=[\"email\", \"admin\"]\n filtering_keys=allowed_keys & params.keys\n filtering_keys.each {|key| filter_by_key(key)}\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def sanitized_params\n document = resource_params[:document]\n\n if document.present?\n document = document.gsub(/\\D/,'')\n old_params = resource_params\n resource_params = ActionController::Parameters.new(document: document, email: old_params[:email])\n #resource.document = document if resource\n end\n end", "def admin_update_user_key_params\n params.require(:user_key).permit(:time_expired, :active, :reason, :requester_type, :requester_additional_info, column_ids: [],\n organization_ids: [],\n whitelists_attributes: [:id, :resource, :_destroy, filter_ids: []])\n end", "def sanitize_keys(hash, keys_to_sanitize)\n hash.each_with_object({}) do |(k, v), h|\n k = k.to_s.downcase\n if keys_to_sanitize.include?(k)\n h[k] = SANITIZED_VALUE\n else\n h[k] = v\n end\n end\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[email password username name lastname birth_date\n address type document_number document_type_id\n avatar document_face_pic document_back_pic phone_number])\n end", "def fill_key_name\n self.key_name = key_name&.parameterize(separator: '_')\n end", "def from_keys\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:user, keys: [:longitude, :latitude])\n #devise_parameter_sanitizer.permit(:sign_in, keys: [:longitude, :latitude])\n end", "def configure_sign_in_params\n devise_parameter_sanitizer.for(:sign_in) << :username\n end", "def strong_params_keys\n [polymorphic_id_param, polymorphic_type_param]\n end" ]
[ "0.65373737", "0.6533904", "0.65003043", "0.64026654", "0.63437545", "0.63065815", "0.61606944", "0.6151123", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61298424", "0.61295253", "0.6129054", "0.6121953", "0.6096948", "0.6082165", "0.6061906", "0.6061906", "0.6061906", "0.6051244", "0.6021282", "0.59981143", "0.59957564", "0.5989729", "0.5974085", "0.5963946", "0.5935247", "0.5930549", "0.5918366", "0.5915106", "0.5906394", "0.59018403", "0.58988875", "0.5896038", "0.58822364", "0.587857", "0.587857", "0.5876567", "0.58684796", "0.5868207", "0.58365756", "0.58189464", "0.581739", "0.58097816", "0.5809577", "0.58040315", "0.58007026", "0.57943785", "0.57943785", "0.57894564", "0.577433", "0.57696366", "0.57504153", "0.57478625", "0.5744203", "0.57433885", "0.5743269", "0.5718387", "0.57114756", "0.5704153", "0.5704153", "0.56969154", "0.5680589", "0.5680589", "0.56565714", "0.56514573", "0.5648868", "0.5646341", "0.56461966", "0.56461966", "0.56461966", "0.5646142", "0.5645678", "0.5645273", "0.56429327", "0.5641316", "0.5640415", "0.56376964", "0.56346494", "0.5633015", "0.5627267", "0.5615465", "0.56127065", "0.5606975", "0.56036234", "0.5595084", "0.55894804", "0.55894804", "0.55894804", "0.55855894", "0.5566218", "0.5565029", "0.55622184", "0.5553911", "0.55489993" ]
0.0
-1
Add or remove new parameters to the permitted list of an +action+. === Arguments +action+ A +Symbol+ with the action that the controller is performing, like +sign_up+, +sign_in+, etc. +keys:+ An +Array+ of keys that also should be permitted. +except:+ An +Array+ of keys that shouldn't be permitted. +block+ A block that should be used to permit the action parameters instead of the +Array+ based approach. The block will be called with an +ActionController::Parameters+ instance. === Examples Adding new parameters to be permitted in the `sign_up` action. devise_parameter_sanitizer.permit(:sign_up, keys: [:subscribe_newsletter]) Removing the `password` parameter from the `account_update` action. devise_parameter_sanitizer.permit(:account_update, except: [:password]) Using the block form to completely override how we permit the parameters for the `sign_up` action. devise_parameter_sanitizer.permit(:sign_up) do |user| user.permit(:email, :password, :password_confirmation) end Returns nothing. source://devise//lib/devise/parameter_sanitizer.rb110
def permit(action, keys: T.unsafe(nil), except: T.unsafe(nil), &block); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def permit_params_on_update *keys\n filter_strong_params :permit, [:update], keys\n end", "def permit_params_on_create *keys\n filter_strong_params :permit, [:create], keys\n end", "def configure_permitted_parameters\n\t\t[:sign_up, :account_update].each do |action|\n\t\tdevise_parameter_sanitizer.for(action).push(:admin)\n\t\tend\n\tend", "def permitted_params_for(action)\n send(\"permitted_#{action}_params\")\n end", "def configure_permitted_parameters\n user_attributes = %i[name]\n devise_parameter_sanitizer.permit(:sign_up, keys: user_attributes)\n devise_parameter_sanitizer.permit(:account_update, keys: user_attributes)\n devise_parameter_sanitizer.permit(:accept_invitation, keys: user_attributes)\n end", "def configure_permitted_parameters\n extra_keys = [:avatar, :name, :time_zone]\n signup_keys = extra_keys + [:terms_of_service]\n devise_parameter_sanitizer.permit(:sign_up, keys: signup_keys)\n devise_parameter_sanitizer.permit(:account_update, keys: extra_keys)\n devise_parameter_sanitizer.permit(:accept_invitation, keys: extra_keys)\n end", "def permit(keys, key=nil, options={})\n filter! keys, (key.nil? ? params : params[key]), options if keys.any?\n self\n end", "def configure_permitted_parameters\n registration_params = [:password , :email, :username, :first_name, :last_name]\n\n if params[:action] == 'create'\n devise_parameter_sanitizer.permit(:sign_up) do\n |u| u.permit(registration_params)\n end\n end\n end", "def configure_permitted_parameters\n\t \tattributes = [:name, :email, :password, :password_confirmation, :remember_me]\n \tdevise_parameter_sanitizer.permit(:sign_up, keys: attributes)\n \tdevise_parameter_sanitizer.permit(:account_update, keys: attributes)\n\t end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:user_name])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:mobile])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:avatar])\n devise_parameter_sanitizer.permit(:account_update, keys: [:user_name])\n end", "def configure_permitted_parameters\n extra_keys = [:avatar, :name, :time_zone, :preferred_language]\n signup_keys = extra_keys + [:terms_of_service, :invite, owned_accounts_attributes: [:name]]\n devise_parameter_sanitizer.permit(:sign_up, keys: signup_keys)\n devise_parameter_sanitizer.permit(:account_update, keys: extra_keys)\n devise_parameter_sanitizer.permit(:accept_invitation, keys: extra_keys)\n end", "def permit_params(*args, &block)\n param_key = config.param_key.to_sym\n\n controller do\n define_method :permitted_params do\n belongs_to_param = active_admin_config.belongs_to_param\n create_another_param = :create_another if active_admin_config.create_another\n\n permitted_params =\n active_admin_namespace.permitted_params +\n Array.wrap(belongs_to_param) +\n Array.wrap(create_another_param)\n\n params.permit(*permitted_params, param_key => block ? instance_exec(&block) : args)\n end\n\n private :permitted_params\n end\n end", "def configure_permitted_parameters\n added_attrs = [:email, :first_name, :last_name]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n #allows name to be passed to \"sign_up\" page aka /register\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n #allows name to be passed to \"account_update\" page aka /edit\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def configure_permitted_parameters\n added_attrs = [ :username, :email, :password, :password_confirmation ]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n devise_parameter_sanitizer.permit :sign_in, keys: added_attrs\n end", "def require_params *keys\n filter_strong_params :require, [:create, :update], keys\n end", "def account_params\n return ActionController::Parameters.new unless params.key?(account_params_key)\n permitted = send(\"account_params_for_#{action}\")\n params.require(account_params_key).permit(*permitted)\n end", "def configure_permitted_parameters\n #allows name to be passed to \"sign_up\" page aka /register\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n #allows name to be passed to \"account_update\" page aka /edit\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def user_action_params\n Rails.logger.info(\"params: #{params}\")\n params.require(:user_action).permit([:description,:action_type,:action_subtype,:flyer_id,:user_id,:data])\n end", "def configure_perimitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys:[:fname, :lname, :username, :seller])\n devise_parameter_sanitizer.permit(:account_update, keys:[:fname, :lname, :username, :seller])\n end", "def configure_permitted_parameters\n added_attrs = %i[username email password password_confirmation]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def require_params_on_update *keys\n filter_strong_params :require, [:update], keys\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:sign_in, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def configure_permitted_parameters\n added_attrs = %i[username email password password_confirmation remember_me]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(\n :account_update, keys: authentication_params(type: :sign_up)\n )\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: UPDATE_KEYS)\n end", "def configure_devise_permitted_parameters\n\t\tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[name username email password password_confirmation])\n\t\tdevise_parameter_sanitizer.permit(:sign_in, keys: %i[login password remember_me])\n\t\tdevise_parameter_sanitizer.permit(:account_update, keys: %i[name username email current_password password password_confirmation])\n\tend", "def permitted_params(action, kind=nil)\n params.require(model_name).permit!\n end", "def permit(*permitted)\n hardened_params = params.dup\n\n hardened_params.keep_if { |k, _v| permitted.flatten.include?(k.to_sym) }\n\n hardened_params.symbolize_keys\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: custom_parameters)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :first_name, :last_name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:username, :first_name, :last_name])\n end", "def configure_permitted_marameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in, keys: %i[login username password])\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[username email password password_confirmation])\n devise_parameter_sanitizer.permit(:account_update, keys: %i[username email password password_confirmation])\n end", "def admin_update_user_key_params\n params.require(:user_key).permit(:time_expired, :active, :reason, :requester_type, :requester_additional_info, column_ids: [],\n organization_ids: [],\n whitelists_attributes: [:id, :resource, :_destroy, filter_ids: []])\n end", "def configure_permitted_parameters\n added_attrs = [:email, :password, :password_confirmation, :remember_me, :name]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n added_attrs = [:username, :email, :password, :password_confirmation]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n added_attrs = [:username, :email, :password, :password_confirmation, :remember_me]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[firstname lastname])\n devise_parameter_sanitizer.permit(:account_update, keys: %i[firstname lastname])\n end", "def configure_permitted_parameters\n registration_params = [:email, :username, :password, :password_confirmation, :remember_me]\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(registration_params) }\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(registration_params << :current_password) }\n end", "def configure_permitted_params\n\t\tdevise_parameter_sanitizer.for(:sign_up) do |u|\n\t\t\tu.permit(:first_name, :last_name, :company_name, :email, :password, :password_confirmation)\n\t\tend\n\t\tdevise_parameter_sanitizer.for(:sign_in) do |u|\n\t\t\tu.permit(:email, :password, :remember_me)\n\t\tend\n\t\tdevise_parameter_sanitizer.for(:account_update) do |u|\n\t\t\tu.permit(:first_name, :last_name, :company_name, :email, :password, :password_confirmation, :current_password)\n\t\tend\n\tend", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname, :lastname, :username ])\n devise_parameter_sanitizer.permit(:account_update, keys: [:firstname, :lastname, :username])\n end", "def configure_permitted_parameters\n added_attrs = [:email, :first_name, :last_name]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n added_attrs = [:email, :first_name, :last_name]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n added_attrs = [:email, :first_name, :last_name]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :membership_number, :authorized_for_app])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :membership_number, :authorized_for_app])\n end", "def configure_permitted_parameters\n added_attrs = %i[phone email password_confirmation remember_me]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_sign_up_params\n # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])\n # devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n # user_params.permit(:email, :password, :password_confirmation)\n # end\n params.require(:user).permit(:email, :password, :password_confirmation)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n end", "def update_sanitized_params\n\t\t\tdevise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :password, :password_confirmation)}\n\t\tend", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :age])\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :age])\n end", "def wallet_action_params\n params.require(:wallet_action).permit(:wallet_id, :action_type, :amount)\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:locale, :name, :email])\n # devise_parameter_sanitizer.permit(:sign_in, keys: [:locale]) n/n\n devise_parameter_sanitizer.permit(:account_update, keys: [:locale, :name, :email])\n # logger.info \"INFO: did > configure_permitted_parameters\"\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:account_update) << :username\n devise_parameter_sanitizer.for(:account_update) << :name\n devise_parameter_sanitizer.for(:sign_up) << :username\n devise_parameter_sanitizer.for(:sign_up) << :name\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update,\n keys: [:name, :surname, :sex_id, :middle_name, :birthday,\n :identification_number, :kurs, :address, :phone, :course_id, :student, :email,\n :specialty_id, :traning_id,\n passports_attributes: %i[id number type_passport_id _destroy],\n certificates_attributes: %i[id number type_certificate_id _destroy]])\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def update_sanitized_params\n\t\tdevise_parameter_sanitizer.for(:sign_up) \t\t\t\t{ |u| u.permit(:name, :email, :password, :password_confirmation, :company, :role_type, :celp_no, :approval, :authorize) }\n\t\tdevise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :password, :password_confirmation, :current_password, :company, :role_type, :celp_no, :approval, :authorize) }\n\tend", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [\n :first_name,\n :last_name,\n :street,\n :apartment_number,\n :city,\n :state,\n :zip_code,\n :phone,\n :email,\n :password])\n devise_parameter_sanitizer.permit(:account_update, keys: [\n :first_name,\n :last_name,\n :street,\n :apartment_number,\n :city,\n :state,\n :zip_code,\n :phone,\n :email,\n :password,\n :current_password])\n end", "def configure_permitted_parameters\n # added all the user parameters with email, password and password_confirmation, because this method overrides devise's controller\n \t\tdevise_parameter_sanitizer.permit(:sign_up) {|u| u.permit(:name,:user_name,:email,:password,:password_confirmation, :country, :city,:remote_avatar_url) }\n devise_parameter_sanitizer.permit(:account_update) {|u| u.permit(:remote_avatar_url,:remove_avatar,:avatar, :name,:user_name,:email,:password,:password_confirmation,:current_password, :country, :city) }\n #devise_parameter_sanitizer.for(:sign_up) << :name\n #devise_parameter_sanitizer.for(:sign_up) << :user_name\n #devise_parameter_sanitizer.for(:sign_up) << :country\n #devise_parameter_sanitizer.for(:sign_up) << :city\n\n\n #devise_parameter_sanitizer.for(:account_update) << :name\n\n #devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:user_name, :name, :email, :country, :city)}\n\tend", "def configure_permitted_parameters\n\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:name, :email, :phone_number, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:name, :email, :password, :remember_me)}\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:name, :email, :password, :remember_me)}\n end", "def configure_permitted_parameters\n\t\tadded_attrs = [:first_name, :last_name, :description, :skills, :email, :password, :password_confirmation, :remember_me]\n\t\tdevise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n\t\tdevise_parameter_sanitizer.permit :account_update, keys: added_attrs\n\t\tdevise_parameter_sanitizer.permit :login, keys: added_attrs\n\tend", "def action_options(options)\n { except: options.delete(:except), only: options.delete(:only), prepend: options.delete(:prepend) }\n end", "def configure_permitted_parameters\n \tdevise_parameter_sanitizer.permit(:sign_up, keys: [:name,:email, :password, :image,:password_confirmation,:user_id,:terms_and_conditions,:privacy_policy])\n \tdevise_parameter_sanitizer.permit(:account_update, keys: [:name,:email, :password, :password_confirmation, :current_password,:image,:user_id])\n\tend", "def configure_permitted_parameters\n update_attrs = [:name, :admin, :email, :password, :password_confirmation,\n :schedule, :avatar, :avatar_cache, local_attributes: [:id, :name, :city, :state, :country]]\n devise_parameter_sanitizer.permit :sign_up, keys: update_attrs\n devise_parameter_sanitizer.permit :account_update, keys: update_attrs\n devise_parameter_sanitizer.permit :sign_up, keys: [:usernamegit]\n devise_parameter_sanitizer.permit :sign_up, keys: [:passwordgit]\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: %i[first_name last_name organization admin])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_in, keys: [:name, :password, :images])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :password, :password_confirmation, :isHost, :isCandidate, :images]) \n devise_parameter_sanitizer.permit(:account_update, keys: [:name, :email, :password, :password_confirmation, :current_password, :isHost, :isCandidate, :images])\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])\n end", "def my_action_params\n params.require(:my_action).permit(:name, :url, :active, :provider_id)\n end", "def configure_permitted_params\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:username, :email, :password, :password_confirmation)}\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:username, :email, :password, :password_confirmation, :current_password) }\n end", "def configure_account_update_params\n\n devise_parameter_sanitizer.permit(:update_user, keys: [:email, :password, :password_confirmation, :current_password, :prenom, :nom])\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: custom_parameters)\n end", "def configure_params_update\n devise_parameter_sanitizer.permit(:account_update, keys: [:name, :email])\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name])#Permits first & last name for sign_up.\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name])#Permits first & last name for account_update(user profile edit).\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:email,\n :password, :username, :first_name, :last_name])\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name])\n devise_parameter_sanitizer.permit(:account_update, keys: [:name])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:club_id])\n devise_parameter_sanitizer.permit(:account_update, keys: [:club_id])\n devise_parameter_sanitizer.permit(:sign_up, keys: [:author])\n devise_parameter_sanitizer.permit(:account_update, keys: [:author])\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:username, :address, :first_name, :last_name, :email, :password)}\n\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:username, :address, :email, :password, :current_password)}\n end", "def configure_account_update_params\n # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])\n params.require(:user).permit(:firstname,:lastname ,:email, :gender, :phone,:address)\nend", "def configure_permitted_parameters\n added_attrs = [:email, :first_name, :last_name, :account_type]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update,\n keys: policy(resource).permitted_attributes)\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:firstname,:middlename,:lastname,:contact,:birthday,:gender, :bio, :username])\n end", "def configure_permitted_parameters\n added_attrs = %i[name username email password password_confirmation remember_me photo cover_image]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [\n profile_attributes: [:id, :name, :last_name, :male,\n image_attributes: [:id, :picture, :name]],\n phones_attributes: [:id, :number, :phone_type_id, :_destroy]\n ])\n end", "def configure_account_update_params\n # devise_parameter_sanitizer.permit(:account_update, :keys => [:username])\n devise_parameter_sanitizer.for(:account_update) << :username\n end", "def register(action, valid_params)\n PARAMS[action.to_sym] = valid_params\n end", "def action_params\n params.permit(:type_of_entity, :type_of_action, :entity_id, :user_id, :content)\n end", "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])\n end", "def configure_permitted_parameters\n # For additional fields in app/views/devise/registrations/new.html.erb\n # devise_parameter_sanitizer.permit(:sign_up, keys: [])\n\n # For additional in app/views/devise/registrations/edit.html.erb\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :level, :address])\n end", "def configure_account_update_params\n devise_parameter_sanitizer\n .permit(:account_update,\n keys:\n %i[first_name\n last_name\n affiliation\n training_status_id\n timezone])\n end", "def bulk_action_params\n params.require(:bulk_action).permit(\n :action_type,\n :description,\n :pids,\n manage_release: [:tag, :what, :who, :to],\n set_governing_apo: [:new_apo_id],\n manage_catkeys: [:catkeys]\n )\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:password_confirmation ,:password ,:email, :role, :avatar, :avatar_cache, :remove_avatar, :invite_code, :firstname, :lastname)}\n end", "def configure_permitted_params\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:first_name, :last_name, :role_id, :is_validated_by_admin, :email, :password, :password_confirmation)}\n devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:first_name, :last_name, :role_id, :is_validated_by_admin,:email, :password, :password_confirmation, :current_password) }\n end", "def configure_permitted_parameters\n devise_parameter_sanitizer.permit(:sign_up, keys: [:username]) \n devise_parameter_sanitizer.permit(:account_update, keys: [:username])\nend", "def action_params\n params.require(:action).permit(:name, :status, :user_id)\n end", "def configure_permitted_parameters\n extra_params = [:full_name, :programme, :student_number]\n devise_parameter_sanitizer.for(:sign_up).push(*extra_params)\n devise_parameter_sanitizer.for(:account_update).push(*extra_params)\n end", "def configure_sign_up_params\n devise_parameter_sanitizer.permit(\n :sign_up, keys: authentication_params(type: :sign_up)\n )\n end" ]
[ "0.77037805", "0.62721175", "0.61170036", "0.5954552", "0.5929765", "0.5908245", "0.5855725", "0.5844603", "0.5712306", "0.5703154", "0.5681425", "0.567347", "0.5660598", "0.56027097", "0.5601449", "0.5590846", "0.55856615", "0.5569656", "0.55671376", "0.5555704", "0.55543095", "0.55540913", "0.5545479", "0.5535583", "0.5527581", "0.5526801", "0.5523749", "0.55235106", "0.55207586", "0.55144554", "0.55140525", "0.5509607", "0.5502915", "0.5498784", "0.54873705", "0.54748726", "0.54729974", "0.5471197", "0.54686135", "0.54655725", "0.54649216", "0.5464374", "0.5463065", "0.5463065", "0.5463065", "0.54517365", "0.5448948", "0.5431362", "0.542877", "0.542877", "0.542877", "0.5423115", "0.5421936", "0.5420415", "0.5413506", "0.541141", "0.5409321", "0.5404243", "0.5402668", "0.5400031", "0.5398535", "0.53909385", "0.5390466", "0.5389932", "0.53886235", "0.53869", "0.53792435", "0.5378843", "0.5377659", "0.5377252", "0.5377112", "0.53726995", "0.5371403", "0.53684753", "0.5366211", "0.5360664", "0.53541535", "0.5353237", "0.5353223", "0.535176", "0.5341966", "0.53407216", "0.5337787", "0.5331803", "0.53298736", "0.5323379", "0.5321449", "0.53204817", "0.53197664", "0.5317757", "0.53098506", "0.53095233", "0.5309065", "0.5305088", "0.5304783", "0.5301446", "0.5295354", "0.5295096", "0.52929276", "0.5291433" ]
0.65549845
1
Sanitize the parameters for a specific +action+. === Arguments +action+ A +Symbol+ with the action that the controller is performing, like +sign_up+, +sign_in+, etc. === Examples Inside the `RegistrationsControllercreate` action. resource = build_resource(devise_parameter_sanitizer.sanitize(:sign_up)) resource.save Returns an +ActiveSupport::HashWithIndifferentAccess+ with the permitted attributes. source://devise//lib/devise/parameter_sanitizer.rb70
def sanitize(action); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize(action)\n permissions = @permitted[action]\n\n if permissions.respond_to?(:call)\n cast_to_hash permissions.call(default_params)\n elsif permissions.present?\n cast_to_hash permit_keys(default_params, permissions)\n else\n unknown_action!(action)\n end\n end", "def _normalize_args(action = nil, options = {}) # :doc:\n if action.respond_to?(:permitted?)\n if action.permitted?\n action\n else\n raise ArgumentError, \"render parameters are not permitted\"\n end\n elsif action.is_a?(Hash)\n action\n else\n options\n end\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def sign_up_params\n devise_parameter_sanitizer.sanitize(:sign_up)\n end", "def params_check_action(action)\n case action\n when :list\n p = params.reject do |k, v|\n [FILTER_KEY, SEARCH_KEY].include?(k)\n end\n unless p.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n when :read\n p = params.reject { |k, v| k == SHOW_KEY }\n unless [nil, \"all\"].include?(params[SHOW_KEY])\n error 400, convert(body_for(:invalid_params,\n { SHOW_KEY => params[SHOW_KEY] }))\n end\n unless p.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n when :create\n # No need to complain. If there are problems,\n # params_check_action_and_role will catch them.\n when :update\n if params.empty?\n error 400, convert(body_for(:no_params))\n end\n when :delete\n unless params.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n else\n raise Error, \"Unexpected: #{action.inspect}\"\n end\n end", "def scaffold_filter_attributes(action, attributes)\n allowed_attributes = scaffold_attributes(action).collect{|x| x.to_s}\n attributes.reject{|k,v| !allowed_attributes.include?(k.to_s.split('(')[0])}\n end", "def _normalize_args(action=nil, options={})\n\t if action.is_a? Hash\n\t action\n\t else\n\t options\n\t end\n\t end", "def user_action_params\n Rails.logger.info(\"params: #{params}\")\n params.require(:user_action).permit([:description,:action_type,:action_subtype,:flyer_id,:user_id,:data])\n end", "def update_sanitized_params\n\t\t\tdevise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :password, :password_confirmation)}\n\t\tend", "def action_params\n params.require(:action).permit(:name, :status, :user_id)\n end", "def permitted_params_for(action)\n send(\"permitted_#{action}_params\")\n end", "def register(action, valid_params)\n PARAMS[action.to_sym] = valid_params\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def sanitize_path_parts(options = {})\n if (options[:action] && options[:action].match(/^\\d*$/))\n id = options[:action]\n action = options[:id]\n options[:action] = action\n options[:id] = id\n end\n options[:action] ||= (options[:id] ? \"show\" : \"index\")\n options\n end", "def my_action_params\n params.require(:my_action).permit(:name, :url, :active, :provider_id)\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n end", "def action_params\n params.permit(:type_of_entity, :type_of_action, :entity_id, :user_id, :content)\n end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:password_confirmation ,:password ,:email, :role, :avatar, :avatar_cache, :remove_avatar, :invite_code, :firstname, :lastname)}\n end", "def configure_permitted_parameters\n registration_params = [:password , :email, :username, :first_name, :last_name]\n\n if params[:action] == 'create'\n devise_parameter_sanitizer.permit(:sign_up) do\n |u| u.permit(registration_params)\n end\n end\n end", "def devise_parameter_sanitizer; end", "def clean_action(action)\n return unless action\n case action[:type]\n when :switch\n action[:who].switching = false\n action[:with].switching = false\n end\n end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "def action_params\n params.require(:new_action).permit(:action_type, :ship_id)\n end", "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "def update_sanitized_params\n\t\tdevise_parameter_sanitizer.for(:sign_up) \t\t\t\t{ |u| u.permit(:name, :email, :password, :password_confirmation, :company, :role_type, :celp_no, :approval, :authorize) }\n\t\tdevise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :password, :password_confirmation, :current_password, :company, :role_type, :celp_no, :approval, :authorize) }\n\tend", "def sanitize!(request)\n [ :path, :query, :body ].each do |name|\n send(\"#{name}_parameters\").sanitize_object!(request.params)\n end\n end", "def update_sanitized_params\n\t\t\tif \"#{resource_name}\" == \"lecturer\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|lecturer| lecturer.permit(:name, :email,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :department)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|lecturer| lecturer.permit(:name, :current_password,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :department,\n\t\t\t\t\t\t:profile_image, :profile_image_cache)\n\t\t\t\t}\n\t\t\telsif \"#{resource_name}\" == \"student\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|student| student.permit(:name, :email,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :faculty, :major, :semester,\n\t\t\t\t\t\t:advising, :probation)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|student| student.permit(:name, :current_password,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :faculty, :major, :semester,\n\t\t\t\t\t\t:advising, :probation, :profile_image,\n\t\t\t\t\t\t:profile_image_cache)\n\t\t\t\t}\n\t\t\telsif \"#{resource_name}\" == \"teaching_assistant\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|teaching_assistant| teaching_assistant.permit(:name,\n\t\t\t\t\t\t:email, :password, :password_confirmation,\n\t\t\t\t\t\t:graduated_from, :graduated_year, :degree,\n\t\t\t\t\t\t:university, :department)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|teaching_assistant| teaching_assistant.permit(:name,\n\t\t\t\t\t\t:current_password, :password, :password_confirmation,\n\t\t\t\t\t\t:graduated_from, :graduated_year, :degree,\n\t\t\t\t\t\t:university, :department, :profile_image,\n\t\t\t\t\t\t:profile_image_cache)\n\t\t\t\t}\n\t\t\tend\n\t\tend", "def sensor_event_action_params\n params.require(:sensor_event_action).permit(:name, :description, :details)\n end", "def student_action_params\n params.require(:student_action).permit(:action_type_id, :student_id)\n end", "def validate_and_coerce_params(action, params)\n actions[action].validate_and_coerce(params)\n end", "def emergency_params(action = :update)\n permitted = [:fire_severity, :police_severity, :medical_severity]\n permitted << :resolved_at if action == :update\n permitted << :code if action == :create\n params.require(:emergency).permit(permitted)\n end", "def action_arguments action\n raise Gin::NotFound,\n \"No action exists for: #{env[REQ_METHOD]} #{env[PATH_INFO]}\" unless action\n\n raise Gin::NotFound, \"No action #{self.class}##{action}\" unless\n self.class.actions.include?(action.to_sym)\n\n args = []\n temp = []\n prev_type = nil\n\n method(action).parameters.each do |(type, name)|\n val = params[name.to_s]\n\n raise Gin::BadRequest, BAD_REQ_MSG % name if type == :req && !val\n break if type == :rest || type == :block || name.nil?\n\n if type == :key\n # Ruby 2.0 hash keys arguments\n args.concat temp\n args << {} if prev_type != :key\n args.last[name] = val unless val.nil?\n\n elsif val.nil?\n temp << val\n\n else\n args.concat temp\n temp.clear\n args << val\n end\n\n prev_type = type\n end\n\n args\n end", "def permitted_params(action, kind=nil)\n params.require(model_name).permit!\n end", "def user_action_params\n params.require(:user_action).permit(:attachment, :note, :proof, :challenge_step_id)\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def sa_action_type_params\n params.require(:sa_action_type).permit(:name)\n end", "def clean_picture_params(params)\n if params[:crop] == true\n params[:crop] = 'crop'\n end\n if params[:image_size]\n params[:size] = params.delete(:image_size)\n end\n secure_attributes = PictureAttributes::SECURE_ATTRIBUTES.dup\n secure_attributes += %w(name format sh)\n params.delete_if { |k, v| !secure_attributes.include?(k.to_s) || v.blank? }\n end", "def action_parameters action\n method = self.instance_method(action)\n [method.parameters.freeze, EUtils.method_arity(method).freeze]\n end", "def get_formatted_action_name\n params[:action].gsub('_','-')\n end", "def sanitize_search_params source_params\n\n my_params = source_params.reject { |k,v| v.nil? }\n\n my_params.except(:action, :controller, :id, :commit, :utf8)\n end", "def action_padding(action)\n ' ' * [(max_action_length - action.to_s.length), 0].max\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def configure_devise_permitted_parameters\n registration_params = [:userid]\n\n if params[:action] == 'create'\n devise_parameter_sanitizer.for(:sign_up) do\n |u| u.permit(registration_params)\n end\n end\nend", "def action_padding(action)\n ' ' * [(max_action_length - action.to_s.length), 0].max\n end", "def action_padding(action)\n ' ' * [(max_action_length - action.to_s.length), 0].max\n end", "def sanitize(options={})\n ActionController::Base.helpers.sanitize(self, options)\n end", "def attributes_for_api(action)\n ret = {}\n\n return ret if action.input_layout != :object\n\n action.input_params.each do |name, param|\n case param[:type]\n when 'Resource'\n ret[name] = @params[name][ param[:value_id].to_sym ]\n\n else\n ret[name] = @params[name]\n end\n end\n\n ret\n end", "def formula_action_params\n params.require(:formula_action).permit(:formula_id, :formula_named_action_id)\n end", "def permitted_params\n policy(resource || resource_class.new).send(\"permitted_#{action_name}_attributes\")\n end", "def action=(action)\n if !VALID_ACTIONS.include?(action.to_s.upcase)\n raise ArgumentError, \"Action must be one of #{VALID_ACTIONS.join(', ')}\"\n end\n @action = action.downcase.to_sym\n end", "def save_or_update_action(action)\n \n if @user #uploaded has logged in \n action[:created_by] = @user.wedgetail\n if action[:localID]\n @localID=action[:localID]\n action.delete(\"localID\")\n if @localmap=Localmap.get(@user,@localID)\n action[:wedgetail][email protected]\n end\n end\n # see if user authorised to access that record\n if action[:wedgetail] and action[:wedgetail]!=\"\"\n patient = User.find_by_wedgetail(action[:wedgetail],:order=>\"created_at DESC\")\n if patient and patient.firewall(@user)\n @notifiees<< action[:wedgetail] if action[:wedgetail]\n else\n #user not authorised or patient doesn't exist - send anonymously only\n action[:wedgetail]=\"\"\n end\n end\n end\n \n @new_action = Action.new(action)\n if @new_action.identifier!=''\n @check=Action.find(:first,:conditions=>[\"request_set=? and identifier=?\",@new_action.request_set,@new_action.identifier])\n if @check\n unless @check.update_attributes(action)\n @errors<< @check.errors\n end\n else\n unless @new_action.save\n @errors<< @new_action.errors\n end\n end\n end\n \n end", "def event_action_params\n params.require(:event_action).permit(:channel, :event_id, :template_id, :pause, :pause_time, :timetable, :timetable_time, :operation)\n end", "def sanitize_params\n if params[:transaction].present?\n %w[user_id year].each { |atr| params[:transaction].delete(atr) }\n end\n end", "def remedy_action_params\n params.fetch(:remedy_action, {}).permit(:status, :assigned_to, :remarks)\n end", "def bulk_action_params\n params.require(:bulk_action).permit(\n :action_type,\n :description,\n :pids,\n manage_release: [:tag, :what, :who, :to],\n set_governing_apo: [:new_apo_id],\n manage_catkeys: [:catkeys]\n )\n end", "def sanitize_params\n params.require(:sanitize).permit(:match, :result, :description, :status)\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def configure_permitted_parameters\n\t\t[:sign_up, :account_update].each do |action|\n\t\tdevise_parameter_sanitizer.for(action).push(:admin)\n\t\tend\n\tend", "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end", "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil)); end", "def calendar_action_params\n params.require(:calendar_action).permit(:holder, :title, :icon, :description, :responsible, :text_color, :color, :action_type)\n end", "def authorize_action!(object, action = nil)\n action ||= params[:action]\n unless action.blank?\n action = action.to_s.to_sym\n end\n authorize!(action, object)\n end", "def unsanitised_user_params\n params.require(:user).permit(\n :name,\n :email,\n :organisation_id,\n :invitation_token,\n :password,\n :password_confirmation,\n :require_2sv,\n :role,\n supported_permission_ids: [],\n ).to_h\n end", "def actiontype_params\n params.require(:actiontype).permit(:name, :usedby)\n end", "def sanitize!(conditions)\n conditions.reject {|key, value| !ALLOWED_KEYS.include?(key) }\n end", "def sanitize_params\n if valid_lease?\n sanitize_lease_params\n elsif valid_embargo?\n sanitize_embargo_params\n elsif !wants_lease? && !wants_embargo?\n sanitize_unrestricted_params\n else\n @attributes\n end\n end", "def modified_attributes_for_action(action)\n case action.to_sym\n when :destroy then modified_attributes_for_destroy\n when :create then modified_attributes_for_create\n else modified_attributes_for_update\n end\n end", "def action_arguments\n\t\t\t\treturn @action_arguments if @action_arguments\n\t\t\t\t## Get all parameters (arguments) from method\n\t\t\t\t## Than collect and sort parameters into hash\n\t\t\t\[email protected]_method(@action).parameters\n\t\t\t\t\t.each_with_object(req: [], opt: []) do |param, hash|\n\t\t\t\t\t\t## Only required parameters must be in `:req`\n\t\t\t\t\t\thash[param[0]] << param[1]\n\t\t\t\t\tend\n\t\t\tend", "def extract_parameters\n params.reject{|key, value| [\"action\", \"controller\"].include?(key) }\n end", "def cleaner\n @@config ||= begin\n {\n :elements => ::ActionView::Base.sanitized_allowed_tags.to_a,\n :attributes => { :all => ::ActionView::Base.sanitized_allowed_attributes.to_a},\n :protocols => { :all => ::ActionView::Base.sanitized_allowed_protocols.to_a }\n }\n rescue\n warn \"ActionView not available, falling back to Sanitize's BASIC config\"\n ::Sanitize::Config::BASIC\n end\n @sanitizer ||= ::Sanitize.new(@@config)\n end", "def modified_attributes_for_action(action)\n case action.to_sym\n when :create then modified_attributes_for_create\n when :destroy then modified_attributes_for_destroy\n else modified_attributes_for_update\n end\n end", "def build_param(action_element,action,key,value)\n\t\tif(action.parameters.nil?)\n\t\t\taction_element[\"#{key}\"] = ((value.is_a? Hash) ? data_to_arr(value) : [value])\n\t\telse\n\t\t\tcurrent_param = action.parameters.select{|p| p.name.upcase == key.to_s.upcase}.first\n\t\t\taction_element[\"#{key}\"] = ((value.is_a? Hash) ? data_to_arr(value) : [value])\n\n\t\t\tif current_param && current_param.namespace\n\t\t\t\taction_element[\"#{key}\"].merge!(\"xmlns:#{@name_space}\" => current_param.namespace)\n\t\t\tend\n\t\tend\n\tend", "def good_action_params\n params.require(:good_action).permit(:description, :score, :sender_id, :receiver_id)\n end", "def post_data(action, parameters = {})\n action == 'auth' ? parameters.to_s : parameters.to_json\n end", "def action=(action)\n allowed_values = [\"Create\", \"View\", \"Update\", \"Delete\", \"Download\", \"MemberAdd\", \"MemberUpdate\", \"MemberRemove\", \"Read\", \"ApplyProtection\", \"RevokeProtection\", \"UpdateRetention\", \"ReadAll\", \"Execute\", \"Publish\", \"Unpublish\", \"Enable\", \"Disable\", \"Authorize\", \"Deauthorize\", \"Authenticate\", \"ChangePassword\"]\n if action && !allowed_values.include?(action)\n fail ArgumentError, \"invalid value for 'action', must be one of #{allowed_values}.\"\n end\n @action = action\n end", "def clean_params(params)\n params.each_with_object({}) do |(param, value), acc|\n next if param.nil? || value.nil?\n next unless param.respond_to?(:to_sym) && value.respond_to?(:to_s)\n acc[param.to_sym] = value.to_s\n end\n end", "def _normalize_args(action = T.unsafe(nil), options = T.unsafe(nil), &blk); end", "def allowed_to?(action)\n if action.is_a? Hash\n allowed_actions.include? \"#{action[:controller]}/#{action[:action]}\"\n else\n allowed_permissions.include? action\n end\n end", "def sanitize(p, keys)\n new_params = {}\n keys.each { |k| new_params[k] = p[k] if p.include?(k) }\n return new_params.symbolize_keys\n end", "def rescue_action_area_rescuer_params\n params.fetch(:rescue_action_area_rescuer, {})\n end", "def create_params\n params = @params.clone\n params[:params] = params[:params].clone\n\n action_keys = params[:params].select {|key, val| key =~ /\\Aaction_.*/ }\n action_keys.each do |key, val|\n new_key = key.gsub(/\\Aaction_/, \"action_survey_\")\n params[:params][new_key] = val\n params[:params].delete(key)\n end\n\n params\n end", "def devise_parameter_sanitizer\n if resource_class == Host\n Host::ParameterSanitizer.new(Host, :host, params)\n else\n ParameterSanitizer.new(User, :user, params)\n # super # Use the default one\n end\n end", "def wallet_action_params\n params.require(:wallet_action).permit(:wallet_id, :action_type, :amount)\n end", "def map_to_valid_action( action )\n\t\tself.log.debug \"trying to map %p to a valid action method\" % [ action ]\n\n\t\tif (( match = @actions_regexp.match(action.to_s) ))\n\t\t\taction = match.captures[0]\n\t\t\taction.untaint\n\t\t\tself.log.debug \"Matched action = #{action}\"\n\t\t\treturn action\n\t\telse\n\t\t\tself.log.debug \" no matching action method in %p\" % [ @actions_regexp ]\n\t\t\treturn nil\n\t\tend\n\tend", "def action_report_params\n params.require(:action_report).permit(:pilot_id, :airframe_id, :tasking_id, :hours, :takeoffs, :landings, :outcome, :aa_kills, :ag_kills, :notes, :status, :position )\n end", "def filter_story_params\n allowed = [\n :title, :description, :estimate, :story_type, :state, :requested_by_id,\n :owned_by_id, :position, :labels\n ]\n filtered = {}\n params[:story].each do |key, value|\n filtered[key.to_sym] = value if allowed.include?(key.to_sym)\n end\n filtered\n end", "def clean_resources_params\n resources_params = params.require(:resources).map { |r| permit_resource_params(r) }\n\n resources_params.each { |r| transform_resource_params!(r) }\n end", "def action_idea_params\n params.require(:action_idea).permit(:user_id, :name, :description, :references, :category, :date_created, :active, :tags)\n end", "def sanitize(args = '')\n args\n end", "def sanitize_parameters(param)\n return param.map { |p| String(p) } if param.is_a?(Array)\n return param.map { |k, v| [String(k), String(v)] }.to_h if param.is_a?(Hash)\n return String(param)\n end", "def dosha_action_params\n params.require(:dosha_action).permit(:Dosha)\n end", "def clean_params_for_save!\n if params[resource_param_name].present?\n params[resource_param_name].delete(:id)\n params[resource_param_name].delete(:user_id)\n end\n end", "def sanitize_params\n begin\n return params = params.slice(:search) if params[:search]\n return params = params.slice(:search_location) if params[:search_location]\n rescue NoMethodError\n return params\n end\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def herb_action_params\n params.require(:herb_action).permit(:herb_id, :herb_action_type_id)\n end", "def sanitized_params\n document = resource_params[:document]\n\n if document.present?\n document = document.gsub(/\\D/,'')\n old_params = resource_params\n resource_params = ActionController::Parameters.new(document: document, email: old_params[:email])\n #resource.document = document if resource\n end\n end", "def user_reward_action_params\n params.fetch(:user_reward_action, {})\n end" ]
[ "0.73914146", "0.63158244", "0.6285043", "0.57119644", "0.56856483", "0.5670714", "0.5593232", "0.55694085", "0.5554571", "0.5549168", "0.5538158", "0.5481808", "0.54507834", "0.5359765", "0.5310846", "0.52888453", "0.52837807", "0.52745456", "0.5271189", "0.52253366", "0.52243745", "0.5207865", "0.5162314", "0.51348394", "0.5127956", "0.51204515", "0.5118939", "0.51173514", "0.5111207", "0.505612", "0.504321", "0.5016732", "0.5009188", "0.49968916", "0.49836063", "0.4982143", "0.49774143", "0.49774143", "0.49656704", "0.49639755", "0.49585092", "0.4955401", "0.49552032", "0.49368736", "0.49353325", "0.4923079", "0.49080768", "0.49080768", "0.49058053", "0.48491257", "0.4835667", "0.48329702", "0.48290738", "0.48262736", "0.48227942", "0.4814188", "0.4812106", "0.48107", "0.48039028", "0.48005113", "0.47964048", "0.4794296", "0.4794296", "0.47843918", "0.47462866", "0.4741328", "0.47370377", "0.47324663", "0.47282022", "0.4728141", "0.47273627", "0.47208118", "0.4714103", "0.47110426", "0.4706415", "0.469664", "0.46962816", "0.46882838", "0.46879238", "0.46789607", "0.46688902", "0.4661118", "0.4656288", "0.46552002", "0.46539757", "0.46456018", "0.46382573", "0.463614", "0.46266568", "0.46231017", "0.46188232", "0.46144918", "0.46027508", "0.4599414", "0.45983532", "0.4582988", "0.458166", "0.45787948", "0.45707113", "0.4565224" ]
0.66257316
1
Cast a sanitized +ActionController::Parameters+ to a +HashWithIndifferentAccess+ that can be used elsewhere. Returns an +ActiveSupport::HashWithIndifferentAccess+. source://devise//lib/devise/parameter_sanitizer.rb132
def cast_to_hash(params); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_params(params)\n if params.is_a?(Hash)\n params.with_indifferent_access\n else\n params\n end\n params\n end", "def params\n original = super\n if original.to_unsafe_h.with_indifferent_access != request.params.with_indifferent_access\n ActionController::Parameters.new(request.params.with_indifferent_access)\n else\n original\n end\n end", "def indifferent_access(params)\n params = indifferent_hash.merge(params)\n params.each do |key, value|\n next unless value.is_a?(Hash)\n params[key] = indifferent_access(value)\n end\n end", "def indifferent_params(params)\n params = indifferent_hash.merge(params)\n params.each do |key, value|\n next unless value.is_a?(Hash)\n params[key] = indifferent_params(value)\n end\n end", "def cast_to_hash(params)\n # TODO: Remove the `with_indifferent_access` method call when we only support Rails 5+.\n params && params.to_h.with_indifferent_access\n end", "def to_h\n @params.dup.with_indifferent_access\n end", "def indifferent_params(object)\n case object\n when Hash\n new_hash = indifferent_hash\n object.each { |key, value| new_hash[key] = indifferent_params(value) }\n new_hash\n when Array\n object.map { |item| indifferent_params(item) }\n else\n object\n end\n end", "def convert_attributes_param_to_safe_hash(attr, param)\n # Get an unsafe hash of the param\n unsafe_hash = param.to_unsafe_h\n\n # The hash of permitted attributes\n safe_hash = {}\n\n # Assume that each key ends with \"attributes\" and corresponds with\n # attributes in the whitelist (addresses_attributes,\n # phone_numbers_attributes, etc.)\n unsafe_hash.each do |(key, value)|\n # Assign the value to a hash using the attribute as a key, instead of\n # index number (\"0\", \"1\", etc.)\n temp_hash = { attr => value }\n # Create a new Parameters object\n temp_param = ActionController::Parameters.new(temp_hash)\n # Pass the Parameters object through the whitelist and get the hash\n temp_param_hash = temp_param.permit(whitelisted_attrs).to_hash\n # Merge into safe_hash result, using the original numeric key as the\n # hash key\n safe_hash.merge!(key => temp_param_hash[attr])\n end\n safe_hash\n end", "def to_params\n ::HashWithIndifferentAccess.new(attributes_hash)\n end", "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "def sanitize_params(inputs)\n out = {}.with_indifferent_access\n self._fields.each_pair do |field, config|\n if inputs.has_key?(field)\n out[field] = type_caster.cast(inputs[field], config[:type])\n end\n end\n\n out\n end", "def to_sanitize\n Sanitize.new(to_hash)\n end", "def normalize_params(data)\n return data unless data.is_a?(Hash)\n\n compacted = {}\n data.each do |key, val|\n case val\n when Numeric, String\n compacted[key] = val\n when Array\n val.compact!\n # handle custom keys\n val = normalize_custom_fields(val) if key == :custom_fields\n unless val.empty?\n compacted[key] = val.map { |el| normalize_params(el) }\n end\n else\n params = normalize_params(val)\n compacted[key] = params unless params.nil?\n end\n end\n compacted.with_indifferent_access\n end", "def sanitize_parameters(parameters)\n flow_name = parameters[:flow_name].to_sym\n msisdn = parameters[:msisdn].to_i.to_s\n session_id = parameters[:session_id].to_s[0..20]\n input = parameters[:input].to_s[0..160]\n\n #remove default proc so that the hash can be serialized using Marshal\n params = parameters[:params].tap do |p|\n p.default = nil\n end\n\n {\n flow_name: flow_name,\n params: params,\n msisdn: msisdn,\n session_id: session_id,\n input: input\n }\n end", "def form_attributes\n sanitized_attributes = {}.with_indifferent_access\n attributes.reject { |attr| attr =~ /_at|version/ }.each do |key, value|\n sanitized_key = key == '_id' ? 'id' : key\n sanitized_attributes[sanitized_key] = value.to_s\n end\n sanitized_attributes\n end", "def sanitize_params(inputs)\n out = {}.with_indifferent_access\n _fields.each_pair do |field, config|\n next unless inputs.key?(field)\n\n begin\n out[field] = ::Subroutine::TypeCaster.cast(inputs[field], config)\n rescue ::Subroutine::TypeCaster::TypeCastError => e\n raise ::Subroutine::TypeCaster::TypeCastError, \"Error for field `#{field}`: #{e}\"\n end\n end\n\n out\n end", "def strip_params\n params\n .values\n .select {|v| [ActionController::Parameters, ActiveSupport::HashWithIndifferentAccess].include? v.class }\n .each do |item_parameters|\n item_parameters.each do |k,v|\n next unless v.class == String\n item_parameters[k] = v.split.join(' ')\n end\n end\n end", "def sanitize_attrs(attrs = {}, permitted = [])\n sanitized = {}\n attrs.each do |key, value|\n sanitized[key.to_s] = value if permitted.include?(key.to_s)\n end\n sanitized\n end", "def product_params_sanitizer(hash)\n\t hash[:typ_subcategory_id] = hash.delete :typ_subcategory\n\t hash[:typ_subcategory_id] = hash[:typ_subcategory_id][:id]\n\t hash[:typ_category_id] = hash.delete :typ_category\n\t hash[:typ_category_id] = hash[:typ_category_id][:id]\n\t return hash\n \tend", "def sanitize_fields_hash\n @sanitize_fields_hash ||= extract_configuration(:sanitize_fields, configuration, [])\n end", "def attributes_indifferent\n ActiveSupport::HashWithIndifferentAccess.new(self.as_json)\n end", "def devise_parameter_sanitizer; end", "def normalize_param_value(key)\n p = params.fetch(key.to_sym, {})\n case p\n when Hash\n ActionController::Parameters.new(p)\n when ActionController::Parameters\n p\n when String\n begin\n ActionController::Parameters.new(normalize_params(JSON.parse(p)))\n rescue\n ActionController::Parameters.new({ })\n end\n else\n ActionController::Parameters.new({ })\n end\n end", "def clean_params(params)\n params.each_with_object({}) do |(param, value), acc|\n next if param.nil? || value.nil?\n next unless param.respond_to?(:to_sym) && value.respond_to?(:to_s)\n acc[param.to_sym] = value.to_s\n end\n end", "def normalize_params(h = nil)\n h = params unless h.is_a?(Hash)\n hn = {}\n re = /.+_id$/i\n \n h.each do |hk, hv|\n case hv\n when ActionController::Parameters\n hv = normalize_params(hv.to_h)\n when Hash\n hv = normalize_params(hv)\n end\n\n hn[hk.to_sym] = hv\n shk = hk.to_s\n hn[\"_#{shk}\".to_sym] = (hv.is_a?(String) ? hv.dup : hv) if (shk == 'id') || (shk =~ re)\n end\n\n hn\n end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def attrs_hash(attrs)\n HashWithIndifferentAccess.new(attrs)\n end", "def serializable_hash(options = {})\n pre_sanitized_hash = super({\n :only => [:id, :name, :email]\n }.merge(options))\n\n # Sanitize\n pre_sanitized_hash.merge({\n \"name\" => Rack::Utils.escape_html(self.name),\n \"email\" => Rack::Utils.escape_html(self.email)\n })\n end", "def params\n\t\t\trequest.params.symbolize_keys(deep: true)\n\t\trescue ArgumentError => e\n\t\t\traise unless e.message.include?('invalid %-encoding')\n\n\t\t\t{}\n\t\tend", "def sanitize_options(opts)\n opts = opts.to_hsh rescue opts.to_h\n \n HashWithIndifferentAccess.new(opts)\n end", "def indifferent_hash\n Hash.new {|hash,key| hash[key.to_s] if Symbol === key }\n end", "def normalize_parameters(parameters={})\n # Convert keys to Strings when appropriate\n if parameters.kind_of?(Hash) || parameters.kind_of?(Array)\n # Returning an array since parameters can be repeated (ie, Adsense Management API)\n parameters = parameters.inject([]) do |accu, (k, v)|\n k = k.to_s if k.kind_of?(Symbol)\n k = k.to_str if k.respond_to?(:to_str)\n unless k.kind_of?(String)\n raise TypeError, \"Expected String, got #{k.class}.\"\n end\n accu << [k, v]\n accu\n end\n else\n raise TypeError,\n \"Expected Hash or Array, got #{parameters.class}.\"\n end\n return parameters\n end", "def sanitize_params\n if valid_lease?\n sanitize_lease_params\n elsif valid_embargo?\n sanitize_embargo_params\n elsif !wants_lease? && !wants_embargo?\n sanitize_unrestricted_params\n else\n @attributes\n end\n end", "def convert_attributes(attributes={})\n attributes.to_hash rescue attributes.to_h\n end", "def params_to_hash\n {}\n end", "def indifferent_hash\n Hash.new {|hash,key| hash[key.to_s] if Symbol === key }\n end", "def indifferent_hash\n Hash.new {|hash,key| hash[key.to_s] if Symbol === key }\n end", "def indifferent_hash\n Hash.new {|hash,key| hash[key.to_s] if Symbol === key }\n end", "def identification_params\n params.require(:identification).permit(Identification.safe_attributes)\n end", "def sanitize_parameters(param)\n return param.map { |p| String(p) } if param.is_a?(Array)\n return param.map { |k, v| [String(k), String(v)] }.to_h if param.is_a?(Hash)\n return String(param)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def model_attributes(params)\n clean_params = super #hydra-editor/app/forms/hydra_editor/form.rb:54\n # model expects these as multi-value; cast them back\n clean_params[:rights] = Array(params[:rights]) if params[:rights]\n clean_params[:title] = Array(params[:title]) if params[:title]\n if params[:description]\n clean_params[:description] = Array(params[:description])\n clean_params[:description].map! do |description|\n ::DescriptionSanitizer.new.sanitize(description)\n end\n end\n # Model expects provenance as single-value.\n if params[:provenance]\n clean_params[:provenance] = ::DescriptionSanitizer.\n new.sanitize(params[:provenance])\n end\n\n # Oops; we're blanking out these values when changing permissions and probably versions, too\n # -- they don't have these fields in the form at all so they don't get repopulated.\n clean_params = encode_physical_container(params, clean_params)\n clean_params = encode_external_id(params, clean_params)\n\n clean_params.keys.each do |key|\n # strip ALL the things!\n if clean_params[key].is_a?(Array)\n clean_params[key].map!(&:strip)\n elsif clean_params[key].is_a?(String)\n clean_params[key] = clean_params[key].strip\n end\n end\n\n clean_params\n end", "def trim_params(params)\n Hash[*(params.select { |k,v| new.attributes.keys.include? k.to_s}.flatten)] \n end", "def sanitize_params\n begin\n return params = params.slice(:search) if params[:search]\n return params = params.slice(:search_location) if params[:search_location]\n rescue NoMethodError\n return params\n end\n end", "def sanitize_hash(hash)\n Hash[hash.collect { |k, v| [k.to_s, v.is_a?(Hash) ? sanitize_hash(v) : v] }]\n end", "def sensitive_inputs\n inputs = {}\n\n if @attributes\n @attributes.values.select { |attr| attr.respond_to?(:has_key?) && attr.has_key?(\"parameters\") }.each do |has_params|\n has_params.each_pair do |_, params|\n sensitive = params.select { |name, _| @sensitive_inputs.include?(name) }\n inputs.merge!(sensitive) { |key, old, new| [old].flatten.push(new) }\n end\n end\n end\n\n inputs\n end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def parse_filter_params(permitted:)\n # Symbolize the keys so the values can be used with keyword arguments in the filter scopes.\n filter_params = params[:filter].try(:permit, permitted).try(:to_h)\n end", "def normalize_encode_params(params)\n if params.is_a?(String)\n return params.force_encoding(Encoding::UTF_8).encode!\n elsif !params.is_a?(Hash)\n return params\n end\n\n new_hash = {}\n params.each do |k, v|\n new_key = k.is_a?(String) ? k.dup.force_encoding(Encoding::UTF_8).encode! : k\n new_hash[new_key] =\n case v\n when Hash\n normalize_encode_params(v)\n when Array\n v.map! {|el| normalize_encode_params(el) }\n else\n normalize_encode_params(v)\n end\n end\n new_hash.with_indifferent_access\n end", "def to_params\n Parameters.new(to_hash)\n end", "def sanitize_for_mass_assignment(attributes)\n return attributes\n end", "def transform_parameters(params)\n Smash.new.tap do |new_hash|\n (params || []).each do |key, value|\n new_hash[snakecase(key)] = value\n end\n end\n end", "def sanitized_params\n document = resource_params[:document]\n\n if document.present?\n document = document.gsub(/\\D/,'')\n old_params = resource_params\n resource_params = ActionController::Parameters.new(document: document, email: old_params[:email])\n #resource.document = document if resource\n end\n end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def permit(*permitted)\n hardened_params = params.dup\n\n hardened_params.keep_if { |k, _v| permitted.flatten.include?(k.to_sym) }\n\n hardened_params.symbolize_keys\n end", "def unsanitised_user_params\n params.require(:user).permit(\n :name,\n :email,\n :organisation_id,\n :invitation_token,\n :password,\n :password_confirmation,\n :require_2sv,\n :role,\n supported_permission_ids: [],\n ).to_h\n end", "def format_info\n attributes.with_indifferent_access\n end", "def operation_params\n params.to_unsafe_h.with_indifferent_access\n end", "def dict_params\n params.fetch(:dict, {}).permit!\n end", "def normalize_parameters(value)\n case value\n when Hash\n h = {}\n value.each { |k, v| h[k] = normalize_parameters(v) }\n h.with_indifferent_access\n when Array\n value.map { |e| normalize_parameters(e) }\n else\n value\n end\n end", "def indifferentiate(object)\n case object\n when Hash\n h = if {}.respond_to?(:with_indifferent_access) # Better support for Rails.\n {}.with_indifferent_access\n else\n Hash.new { |hash, key| hash[key.to_s] if Symbol === key }\n end\n\n object.each { |k, v| h[k] = indifferentiate(v) }\n h\n when Array\n object.map { |v| indifferentiate(v) }\n else\n object\n end\n end", "def coerce_attributes_to_hash(attrs)\n if ::Hash === attrs\n ::Hash[attrs.map {|key, val|\n if val\n [key.end_with?('!') ? '!' + key.chop : key, val]\n else\n key = key.chop if key.end_with?('!')\n key = '!' + key unless key.start_with?('!')\n [key, '']\n end\n }]\n else\n Array(attrs || []).inject({}) do |accum, entry|\n key, val = entry.split('=', 2)\n accum[key.end_with?('!') ? '!' + key.chop : key] = val || ''\n accum\n end\n end\n end", "def attributes_before_type_cast\n @attributes_before_type_cast ||= {}.with_indifferent_access\n end", "def handle_query_param\n if params[:query].is_a? ActionController::Parameters \n params[:query].permit!\n params[:query].to_h\n else\n params[:query]\n end\n end", "def update_sanitized_params\n\t\t\tdevise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :password, :password_confirmation)}\n\t\tend", "def to_h\n @params\n end", "def attributes\n sanitized_values = self.to_h.dup\n sanitized_values[:access_token] = 'REDACTED'\n sanitized_values[:issuer] = self.issuer\n sanitized_values\n end", "def indifferent_hash\n Hash.new {|hash,key| hash[key.to_sym] if String === key }\n end", "def sanitized_allowed_attributes=(attributes); end", "def sanitized_allowed_attributes=(attributes); end", "def filter_params\n @filter_params_cache ||= clean_hash(params[:filter]).with_indifferent_access\n end", "def user_strong_params\n html_safe(params[:user]).strip\n end", "def params\n instance_variables.map do |var|\n normalized_var = var.to_s.gsub(/^@/, '')\n next if BLACKLISTED_INSTANCE_VARIABLES.include?(normalized_var)\n\n [normalized_var, instance_variable_get(var)]\n end.compact.to_h\n end", "def normalize_parameters(params)\n params.delete_if {|k,v| v.nil? || v.to_s.empty? }\n params.update(defaults)\n params\n end", "def normalize_encode_params(params); end", "def with_indifferent_access!\n @hash = @hash.with_indifferent_access \n self\n end", "def sanitize_request_parameters(parameters)\n parameters.reduce({}) do |result, (key, value)|\n # if the parameter is an array that contains non-enumerable values,\n # turn it into a comma-separated list\n # in Ruby 1.8.7, strings are enumerable, but we don't care\n if value.is_a?(Array) && value.none? {|entry| entry.is_a?(Enumerable) && !entry.is_a?(String)}\n value = value.join(\",\")\n end\n value = value.to_time if value.is_a? DateTime\n value = value.to_i if value.is_a? Time\n\n result.merge(key => value)\n end\n end", "def clean_params(params)\n params.slice()\n end", "def sanitize_keys(hash)\n new_hash = Hash.new\n hash.each do |key,value|\n sanitized_key = key.downcase.tr(\" \", \"_\")\n\n if value.is_a? Hash\n new_hash[sanitized_key] = sanitize_keys(value)\n else\n new_hash[sanitized_key] = value\n end\n end\n return new_hash\n end", "def sanitize_params(form_params)\n super.tap do |params|\n params['title'] = Array.wrap(params['title']) if params.key?('title')\n params['description'] = Array.wrap(params['description']) if params.key?('description')\n end\n end", "def correct_hashed_params\n params = {}\n @params.each do |key, value|\n if key.scan(/([a-zA-Z]*)\\[([a-zA-Z]*)\\]/).size > 0\n r = key.scan(/([a-zA-Z]*)\\[([a-zA-Z]*)\\]/).first\n params[r.first] = {} if params[r.first].nil?\n params[r.first][r.last] = value\n else\n params[key] = value\n end\n end\n return params\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "def params_to_hidden(*keys)\n required = params.symbolize_keys\n required = required.slice(*keys) unless keys.empty?\n\n return '' if required.empty?\n\n hash_to_hidden(required)\n end", "def clean_params params_hsh\n clone = params_hsh.clone\n clone.delete 'splat'\n clone.delete 'captures'\n clone\n end", "def extract_permitted_attributes(attributes, *keys)\n permitted_attributes = attributes.slice(*keys)\n permitted_attributes.permit! if permitted_attributes.respond_to?(:permit!)\n permitted_attributes\n end", "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "def sanitize(p, keys)\n new_params = {}\n keys.each { |k| new_params[k] = p[k] if p.include?(k) }\n return new_params.symbolize_keys\n end", "def dup_params\n dup = HashWithIndifferentAccess.new\n\n params.each do |key, value|\n dup[key] = value.is_a?(ActiveRecord::Base) ? value : value.dup\n end\n\n dup\n end", "def valid_attributes\n { \"key\" => \"hello\", \"name\" => \"world\" }\n end", "def sign_up_params\n devise_parameter_sanitizer.sanitize(:sign_up)\n end", "def sanitize_credentials\n if params[:user_session]\n params[:user_session][:login].strip!\n params[:user_session][:password].strip!\n end\n end", "def sanitize_credentials\n if params[:user_session]\n params[:user_session][:login].strip!\n params[:user_session][:password].strip!\n end\n end", "def process_params object\n case object\n when Hash\n new_hash = indifferent_hash\n object.each { |key, value| new_hash[key] = process_params(value) }\n new_hash\n when Array\n object.map { |item| process_params(item) }\n when M_BOOLEAN\n object == \"true\"\n when M_FLOAT\n object.to_f\n when M_INTEGER\n object.to_i\n else\n object\n end\n end", "def param_hash(*keys)\n params.to_unsafe_h\n .deep_symbolize_keys\n .then { |hash| keys.empty? ? hash : hash.slice(*keys) }\n .compact\n end", "def to_params\n attrs = Hash.new\n instance_variables.each do |ivar|\n name = ivar[1..-1]\n attrs[name.to_sym] = instance_variable_get(ivar) if respond_to? \"#{name}=\"\n end\n attrs\n end", "def to_h\n hash = {}\n attributes.each_pair do |key, value|\n hash[key] = deep_unwrap(value)\n end\n\n return hash\n end" ]
[ "0.697306", "0.68479335", "0.6804445", "0.6794041", "0.67933774", "0.6744555", "0.64593244", "0.6421377", "0.6360591", "0.62670535", "0.6244449", "0.62075704", "0.61960655", "0.61284506", "0.61280435", "0.6112098", "0.60886705", "0.60674906", "0.60419524", "0.59794", "0.593343", "0.58893806", "0.5855311", "0.5849954", "0.58245134", "0.5756302", "0.57266617", "0.57226753", "0.5719224", "0.56996495", "0.56945795", "0.5678592", "0.566821", "0.5665424", "0.56627095", "0.5649584", "0.56474453", "0.56474453", "0.56474453", "0.56403637", "0.56262743", "0.56190366", "0.5610823", "0.5608654", "0.56050664", "0.55966413", "0.55833405", "0.555519", "0.5551104", "0.5543317", "0.55282795", "0.55260366", "0.55244", "0.5520376", "0.55141383", "0.5494059", "0.5481315", "0.54689497", "0.5445296", "0.5439302", "0.5439218", "0.5438029", "0.5431894", "0.542918", "0.54252255", "0.5391745", "0.5389027", "0.5384887", "0.53635806", "0.5356082", "0.5356082", "0.53501904", "0.53434163", "0.5343279", "0.53383976", "0.53381324", "0.5337129", "0.5336223", "0.533568", "0.53231514", "0.5315542", "0.53153133", "0.53082126", "0.5307575", "0.52958053", "0.52909935", "0.5286489", "0.5283384", "0.52590245", "0.52590245", "0.52588594", "0.5258558", "0.5251746", "0.52443856", "0.5229588", "0.5229588", "0.52276886", "0.52193016", "0.5218819", "0.5218721" ]
0.55229634
53
Sets the attribute authentication_hash
def authentication_hash=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_authentication_hash(hash)\n self.authentication_hash = {:email => hash[:username]}\n self.password = hash[:password]\n end", "def auth=(auth_hash)\n # symbolize the keys\n new_auth_hash = {}\n auth_hash.each {|k, v| new_auth_hash[k.to_sym] = v}\n auth_hash = new_auth_hash\n\n if auth_hash.has_key? :access_token\n # clear the basic_auth, if it's set\n self.class.default_options.reject!{ |k| k == :basic_auth }\n\n # set the Authorization headers\n self.class.headers.merge!(\"Authorization\" => \"Bearer #{auth_hash[:access_token]}\")\n elsif auth_hash.has_key?(:username) && auth_hash.has_key?(:password)\n self.class.basic_auth auth_hash[:username], auth_hash[:password]\n\n # remove the access_token from the headers, if it exists\n self.class.headers.reject!{ |k, v| k == \"Authorization\" }\n else\n raise \"\"\"\n Incomplete authorization information passed in authorization hash.\n You must have either an :access_token or a username password combination (:username, :password).\n \"\"\"\n end\n end", "def set_authentication_authority\n value = ';ShadowHash;HASHLIST:'\n authority = NSMutableArray.new\n if @kernel_version_major >= 12\n value << '<SALTED-SHA512-PBKDF2>'\n elsif @kernel_version_major == 11\n value << '<SALTED-SHA512>'\n else\n value << '<SALTED-SHA1>'\n end\n authority << value\n @user['authentication_authority'] = authority\n end", "def password=( new_password )\n\t\tself.authentication_token = generate_authentication_token\n\t\tsuper\n\tend", "def with_authentication_hash(auth_type, auth_values)\n self.authentication_hash, self.authentication_type = {}, auth_type\n self.password = auth_values[:password]\n\n parse_authentication_key_values(auth_values, authentication_keys) &&\n parse_authentication_key_values(request_values, request_keys)\n end", "def set_password_digest()\n\t\tself.password_digest = Password.create(self.password)\n\tend", "def password_hash=(password_hash)\n super(BCrypt::Password.new(password_hash))\n end", "def password=(passwd)\n @password_hashed = Digest::SHA256.hexdigest(passwd)\n end", "def setHttpAuthPassword(password)\n @fields['http_auth_password'] = password\n self\n end", "def setHttpAuthPassword(password)\n @fields['http_auth_password'] = password\n self\n end", "def set_token_from_hash(auth_hash, user_hash)\n self.update_attribute(:name, user_hash[:name]) if self.name.blank?\n self.update_attribute(:email, user_hash[:email]) if self.email.blank?\n token = self.authentications.find_or_initialize_by_provider_and_uid(auth_hash[:provider], auth_hash[:uid])\n token.update_attributes(\n :name => auth_hash[:name],\n :link => auth_hash[:link],\n :access_token => auth_hash[:token],\n :secret => auth_hash[:secret]\n )\n end", "def set_hash(hash, hash_type = 'SHA256')\n @hash = hash\n @hash_type = hash_type\n end", "def hash_password\n self.hashed_password = BCrypt::Password.create(self.hashed_password)\n end", "def http_auth_hash; end", "def set_password_lion(hash)\n salted_hash_hex = hash\n string = convert_hex_to_ascii(salted_hash_hex)\n data = NSData.alloc.initWithBytes_length_(string, string.length)\n @user['ShadowHashData'] = NSMutableArray.new\n @user['ShadowHashData'][0] = create_shadowhashdata('SALTED-SHA512', data)\n end", "def set_authentication\n\t\t\t@authentication = Authentication.find(params[:id])\n\t\tend", "def set_auth(user, password)\n @user = user\n @password = password\n end", "def update_hash!(password)\n self.password = password\n hash_password\n save\n end", "def with_authentication_hash(auth_type, auth_values); end", "def _hash=(_hash)\n if !_hash.nil? && _hash.to_s.length > 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be smaller than or equal to 40.'\n end\n if !_hash.nil? && _hash.to_s.length < 40\n fail ArgumentError, 'invalid value for \"_hash\", the character length must be great than or equal to 40.'\n end\n @_hash = _hash\n end", "def password=(password) \n #sets password_digest to hashed value.\n self.password_digest = BCrypt::Password.create(password)\n @password = password\n end", "def authentication_password\n BCrypt::Password.new(hashed_password)\n end", "def make_auth_hash\n self.auth_hash = Digest::SHA1.hexdigest(self.object_id.to_s + Time.now.to_i.to_s + self.name.to_s)\n end", "def assign_authentication_token\n self.authentication_token = generate_authentication_token\n end", "def hash_password\n self.password = Digest::MD5.hexdigest(self.password)\n end", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end", "def authentication=(authentication)\n validator = EnumAttributeValidator.new('String', ['N', 'S', 'M'])\n unless validator.valid?(authentication)\n fail ArgumentError, 'invalid value for \"authentication\", must be one of #{validator.allowable_values}.'\n end\n @authentication = authentication\n end", "def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end", "def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end", "def password=(new_password)\n @password = Password.create(new_password)\n self.digest_password = @password\n end", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end", "def password=(str)\n @password = str\n self.password_digest = User.digest(str)\n end", "def password=(new_password)\n @raw_password = new_password\n @password = Password.create(new_password)\n self.password_hash = @password\n end", "def authentication_configuration=(value)\n @authentication_configuration = value\n end", "def password=(new_password)\n @passowrd = Password.create(new_password)\n self.password_hash = @password\n end", "def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end", "def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end", "def password=(password)\n \t\tself.salt = Random.rand.to_s\n \t\tself.password_digest = Digest::SHA1.hexdigest(password + self.salt)\n \n self.password_virtual_attr = password\n end", "def set_auth(username, password)\r\n @http_client.http_adapter.set_auth(username, password)\r\n end", "def set_initial_password(hash_key, new_password)\n\t\t\tkparams = {}\n\t\t\t# The hash key used to identify the user (retrieved by email)\n\t\t\tclient.add_param(kparams, 'hashKey', hash_key);\n\t\t\t# The new password to set for the user\n\t\t\tclient.add_param(kparams, 'newPassword', new_password);\n\t\t\tclient.queue_service_action_call('user', 'setInitialPassword', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def password=(new_password)\r\n\t\t@password_hash = User.calculate_hash(new_password)\r\n\tend", "def password=(password)\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "def password=(password)\n salt, hash = PasswordEncryptor.encrypt(password)\n self.password_salt = salt\n self.password_hash = hash\n @password = password\n end", "def set_password_mtnlion(hash)\n data = NSMutableDictionary.new\n data['entropy'] = encode_hex_to_nsdata(hash['entropy'])\n data['salt'] = encode_hex_to_nsdata(hash['salt'])\n data['iterations'] = hash['iterations'].to_i\n @user['ShadowHashData'] = NSMutableArray.new\n @user['ShadowHashData'][0] = create_shadowhashdata('SALTED-SHA512-PBKDF2', data)\n end", "def set_user_attributes(user_hash)\n self.name = user_hash[:name]\n self.email = user_hash[:email]\n self.password = user_hash[:password]\n self.password_confirmation = user_hash[:password_confirmation]\n self.admin = false\n self.confirmed = false\n end", "def setHttpAuth(user_name, password)\n setHttpAuthUserName(user_name)\n setHttpAuthPassword(password)\n self\n end", "def setHttpAuth(user_name, password)\n setHttpAuthUserName(user_name)\n setHttpAuthPassword(password)\n self\n end", "def password=(new_password)\n @password = BCrypt::Password.create(new_password)\n self.password_hash = @password\n end", "def password_credentials=(value)\n @password_credentials = value\n end", "def password=(new_password)\n if algorithm.kind_of?(HTAuth::Plaintext) then\n @algorithm = Algorithm.algorithm_from_name(Algorithm::CRYPT)\n end\n @digest = calc_digest(new_password)\n end", "def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end", "def auth_hash=(auth)\n # By default, omniauth-saml's auth hash is not serializable--it will raise\n # a StackLevelTooDeep error which is probably a bug. So we will discard the\n # parts that are causing problems (which are fortunately irrelevant).\n if auth[:provider] == \"saml\" && auth.dig(:extra, :raw_info)\n auth = auth.deep_symbolize_keys\n auth[:extra][:raw_info] = auth[:extra][:raw_info].attributes\n auth[:extra][:response_object] = nil\n end\n\n case auth[:provider]\n when \"shibboleth\", \"developer\"\n self.provider = Provider::SHIBBOLETH\n when \"saml\"\n self.provider = Provider::SAML\n when \"identity\"\n self.provider = Provider::LOCAL\n end\n\n super(auth)\n end", "def credentials=(auth)\n if auth.is_a?(OAuth::AccessToken)\n @credentials = auth\n else\n @credentials = {:username => auth[:username], :password => auth[:password]}\n end\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n @password = password \n end", "def password=(new_pass)\n validate_password new_pass\n self.password_salt = User.random_string\n self.password_hash = digest(new_pass)\n end", "def password=(password)\n \t@password = password\n \tif password.present?\n \t genaerate_salt\n \t self.hash_password = self.class.encrypt_password(password,salt)\n \tend\n end", "def password=(pwd)\n @password = pwd\n create_new_salt\n self.password_hash = User.encrypted_password(self.password, self.password_salt) \n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n @password = password\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n @password = password\n end", "def hash_password(password)\r\n\t\tUser.hash_password(password, self.hash_algorithm)\r\n\tend", "def password=(new_password)\n self.encrypted_password = password_digest(new_password)\n end", "def authentication_params\n params.require(:authentication).permit(:user_id, :token, :password_digest)\n end", "def remote_authentication(authentication_hash)\n params = {\n 'username' => authentication_hash[:email],\n 'password' => authentication_hash[:password]\n }\n\n endorsement = Shacip::Client::Endorsement.create(params)\n return false unless endorsement.recognized\n\n self.email = authentication_hash[:email]\n self\n end", "def password= password\n @password = password\n\n self.password_digest = BCrypt::Password.create password\n end", "def password=(password)\n \t@password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def credentials=(value)\n super\n values = value.is_a?(Array) ? value : [value]\n if values.first.is_a?(Hash)\n hash = values.first.with_indifferent_access\n self.facebook_name = hash[:facebook_name]\n self.facebook_username = hash[:facebook_username]\n\n hash\n end\n end", "def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n \tend", "def stub_password_digest\n self.password_digest = \"0\"\n end", "def credentials(username, password, digest = false)\n self.username = username\n self.password = password\n self.digest = digest\n end", "def credentials(username, password, digest = false)\n self.username = username\n self.password = password\n self.digest = digest\n end", "def password=(password)\r\n encryption = PasswordEncryptor.encrypt(password)\r\n\r\n self.password_salt = encryption[:salt]\r\n self.password_hash = encryption[:hash]\r\n\r\n @password = password\r\n end", "def password=(password) \n self.salt = User.random_string( 10 ) if self.salt.nil?\n self.hashed_password = User.encrypt( password, self.salt )\n end", "def password=(new_password)\n @password = new_password\n self.encrypted_password = password_digest(@password) if @password.present?\n end", "def password=(new_password)\n\t\tself.password_digest = BCrypt::Password.create(new_password)\n\tend", "def password=(pwd)\n self.password_digest = BCrypt::Password.create(pwd)\n end", "def params_auth_hash; end", "def setDigest(username, password, url_base)\n class_httparty = self.class\n #set url\n class_httparty.base_uri url_base\n class_httparty.default_options.delete(:basic_auth)\n @auth_digest = {:username => username, :password => password}\n class_httparty.digest_auth username, password\n #puts \"auth_digest:#{@auth_digest}\"\n end", "def authorization=(auth)\n write_attribute(column_for_attribute('authorization').name, auth)\n end", "def set_initial_password(hash_key, new_password)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'hashKey', hash_key);\n\t\t\t# new password to set\n\t\t\tclient.add_param(kparams, 'newPassword', new_password);\n\t\t\tclient.queue_service_action_call('adminuser', 'setInitialPassword', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def after_hash_token_authentication\n end", "def password=(password)\n\t\t@password = password\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "def password=(password)\n\t\t@password = password\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "def password=(password)\n\t\t@password = password\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "def password=(password)\n\t\t@password = password\n\t\tself.password_digest = BCrypt::Password.create(password)\n\tend", "def auth_hash\n @auth_hash ||= request.env['omniauth.auth']\n end", "def userpassauthsession=(value)\n @children['userpassauthsession'][:value] = value\n end", "def set_password pass\n self.pass_salt = SHA256Salt.generate_random\n self.pass_hash = WodaHash.digest(self.pass_salt + pass).to_hex\n end", "def password=(pwd)\n @password = pwd\n return if pwd.blank?\n create_new_salt\n self.hashed_password = Agent.encrypted_password(self.password, self.salt)\n end", "def setUserPassword(password)\n @fields['user_password'] = password\n self\n end", "def setUserPassword(password)\n @fields['user_password'] = password\n self\n end", "def setUserPassword(password)\n @fields['user_password'] = password\n self\n end", "def update_from_auth_hash(auth_hash)\n update_account_info auth_hash['info']\n update_oauth_credentials auth_hash['credentials']\n self\n end", "def authenticate_bb_password(bb_password_hash)\n bb_password_hash == bb_password ? self : false\n end", "def hash_password\n return if password.blank?\n self.password_hash = Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end", "def password=(password)\n @password = password\n self.password_digest = BCrypt::Password.create(password)\n end" ]
[ "0.7907929", "0.6696419", "0.66191083", "0.65039194", "0.6494985", "0.64769304", "0.6455573", "0.64531523", "0.6370157", "0.6370157", "0.6349561", "0.630067", "0.6235009", "0.6222108", "0.62221074", "0.6189994", "0.6182935", "0.618111", "0.61790764", "0.6173831", "0.61710995", "0.61625636", "0.61334056", "0.6130171", "0.61090595", "0.61089694", "0.61021346", "0.6099449", "0.6099449", "0.60725594", "0.6052726", "0.60524285", "0.6051188", "0.60367113", "0.6034655", "0.603354", "0.60327554", "0.60327554", "0.6017855", "0.6002247", "0.5978464", "0.59767157", "0.59740984", "0.59527713", "0.595252", "0.5950679", "0.59498054", "0.59498054", "0.5937849", "0.5932561", "0.5930976", "0.5930041", "0.5928136", "0.59191453", "0.59155256", "0.59155256", "0.5912123", "0.5907848", "0.59043735", "0.5902453", "0.58970535", "0.58970535", "0.58960414", "0.5890689", "0.5885259", "0.58820474", "0.5871053", "0.5865439", "0.5864628", "0.5859822", "0.5855777", "0.5841919", "0.5841919", "0.5835453", "0.5831988", "0.582775", "0.5826753", "0.58256793", "0.58239865", "0.5823622", "0.58173186", "0.5809494", "0.57960325", "0.5776575", "0.5776575", "0.5776575", "0.5776575", "0.57732946", "0.5767996", "0.5761049", "0.576076", "0.57595074", "0.57595074", "0.57595074", "0.5758737", "0.5747621", "0.5741253", "0.57406324", "0.57406324", "0.57406324" ]
0.7117498
1
Returns the value of attribute authentication_type. source://devise//lib/devise/strategies/authenticatable.rb11
def authentication_type; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def scim_authentication_method\n @attributes[:scim_authentication_method]\n end", "def authentication_type=(_arg0); end", "def type_authentication!()\n @type = TAC_PLUS_AUTHEN\n end", "def type\n self.class.type_enum_map.key(@cred_struct[:type])\n end", "def human_auth_method\n self[:auth_method].to_human\n end", "def type_authentication?()\n return(true) if(@type == TAC_PLUS_AUTHEN)\n return(false)\n end", "def capable_auth_types; end", "def password_required_type\n return @password_required_type\n end", "def password_required_type\n return @password_required_type\n end", "def password_required_type\n return @password_required_type\n end", "def password_required_type\n return @password_required_type\n end", "def user_type\n return session[:user_type] if session[:user_type]\n # return logged_user.class.name if logged_user\n end", "def authentication_methods\n return @authentication_methods\n end", "def account_type\n User.account_type(current_user)\n end", "def user_type\n @user_type || NORMAL_USER\n end", "def user_type\n if self.class.name == \"PubcookieUser\"\n type = self.identity_type == \"Student\" ? self.identity_type : \"UW Standard user\"\n else\n type = \"External user\"\n end\n type\n end", "def xlate_authen_type()\n return AUTHEN_TYPE_XLATES[@authen_type] if (AUTHEN_TYPE_XLATES.has_key?(@authen_type))\n return(@authen_type.to_s) \n end", "def authenticatable_name; end", "def authenticatable_name\n @authenticatable_name ||=\n self.class.name.split(\"::\").last.underscore.sub(\"_authenticatable\", \"\").to_sym\n end", "def user_type; end", "def authentication\n if @property_hash[:authentication] == 'SERVER' and @resource[:authentication].upcase == 'DCS'\n return @resource[:authentication]\n else\n return @property_hash[:authentication]\n end\n end", "def model_class\n AuthenticationToken\n end", "def user_type\n return Sessions.type(session[:session_id])\nend", "def access_type\n @access_type\n end", "def authentication_params(type:)\n case type&.to_sym\n when :sign_up\n [:accept_terms, :email, :firstname, :language_id, :org_id, :password, :surname,\n { org_attributes: %i[abbreviation contact_email contact_name is_other\n managed name org_type target_url links] }]\n when :sign_in\n %i[email org_id password]\n else\n %i[email]\n end\n end", "def authen_type=(val)\n if (val.kind_of?(Integer))\n @authen_type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @authen_type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end", "def user_type\n return Sessions.type(session[:session_id])\nend", "def auth_types\n @auth_types ||= hardcoded_auth_types #HTTParty.get(\"#{ENV['PRIVILEGES_BASE_URL']}/patrons.json?sublibrary_code=#{ENV['PRIVILEGES_SUBLIBRARY_CODE']}\").parsed_response\n end", "def authentication_strength\n return @authentication_strength\n end", "def auth_types\n @auth_types ||= [\"CB\"]\n end", "def current_user_type\n User::TYPES.each do |mapping|\n user = send(\"current_#{mapping.to_s.downcase}\")\n return mapping unless user.nil?\n end\n :guest\n end", "def auth_provider=( type )\n\t\t\t@auth_provider = Strelka::AuthProvider.get_subclass( type )\n\t\t\tself.log.debug \"Auth provider set to %p\" % [ @auth_provider ]\n\t\t\treturn @auth_provider\n\t\tend", "def passcode_required_type\n return @passcode_required_type\n end", "def authentication_service_type=(authentication_service_type)\n validator = EnumAttributeValidator.new('String', [\"AuthAnvil\", \"GoogleAuthenticator\"])\n unless validator.valid?(authentication_service_type)\n fail ArgumentError, \"invalid value for 'authentication_service_type', must be one of #{validator.allowable_values}.\"\n end\n @authentication_service_type = authentication_service_type\n end", "def authenticatable_name\n @authenticatable_name ||=\n ActiveSupport::Inflector.underscore(self.class.name.split(\"::\").last).\n sub(\"_authenticatable\", \"\").to_sym\n end", "def current_usertype\n current_account.user_type\n end", "def user_type\n\t\tif (current_user.type == 'Trainer')\n\t\t\ttrainer\n\t\telsif (current_user.type == 'Client')\n\t\t\tclient\n\t\t\t\n\t\tend\n\t\t\n\tend", "def security_type\n SecurityType.find_by_type self[:type]\n end", "def auth_type=(type=:basic)\n @auth_type = case type\n when :basic, \"basic\"\n Request::AuthBasic\n when :digest, \"digest\"\n Request::AuthDigest\n when :any, \"any\"\n Request::AuthAny\n else\n raise \"#{type.inspect} is an unknown authentication type\"\n end\n end", "def account_type\n self.class.account_type\n end", "def user_class\n Merb::Authentication.user_class\n end", "def user_type\n params[:user_type].downcase\n end", "def role_type\n return User.role_type_from_string(self.role)\n end", "def type\n read_attr :type, :to_sym\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_type\n @user_type ||= self.class.user_type_from_groups(@groups)\n end", "def authentication_methods=(value)\n @authentication_methods = value\n end", "def account_type\n self.role.name\n end", "def account_type\n self.role.name\n end", "def authentication_method\n @authentication_method ||= begin\n method = nil\n send_line('PROTOCOLINFO')\n loop do\n # TODO: support for reading multiple authentication methods\n case reply = read_reply\n when /^250-AUTH METHODS=(\\w*)/\n method = $1.strip.downcase.to_sym\n method = method.eql?(:null) ? nil : method\n when /^250-/ then next\n when '250 OK' then break\n end\n end\n method\n end\n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def get_user_type\n uri = URI.parse(\"#{BASE_URL}/users/info\")\n response = JSON.parse(@client.get(uri).body)\n return response['type'] if response['success']\n\n throw_error(response)\n end", "def user_type\n # The user type can't be handled by the method_missing magic\n # from OctocatHerder::Base, since 'type' is the deprecated form\n # of the method 'class'.\n @raw['type']\n end", "def authentication provider=:identity\n Authentication.where(user_id: id, provider: provider).all.first\n end", "def type\n return attributes['type'] if attributes['type']\n \n # Lookups are in order of preference so if, for example, you set the uri but display_name and id are also\n # set, we'd rather go with the canonical representation.\n if display_name && id\n 'CanonicalUser'\n elsif email_address\n 'AmazonCustomerByEmail'\n elsif uri\n 'Group'\n end\n end", "def get_identification_type\n if user_signed_in?\n @identification_type = current_user.cvs.find_by(params[:identification_type])\n end\n end", "def is_authorized\n (!current_user.nil? and auth_types.include? current_user.user_attributes[:bor_type])\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def get_authenticator_token\n self.request('AuthenticateUser',\n Stamps::Mapping::AuthenticateUser.new(\n :credentials => {\n :integration_id => self.integration_id,\n :username => self.username,\n :password => self.password\n })\n )[:authenticate_user_response][:authenticator]\n end", "def user_type\n user_types = []\n if admin\n user_types << \"Admin\"\n end\n if agent\n user_types << \"Agent\"\n end\n if customer\n user_types << \"Customer\"\n end\n user_types.join(\" / \")\n end", "def type\n @attributes[:type]\n end", "def type\n @attributes[:type]\n end", "def type\n @attributes[:type]\n end", "def authentication_handler\n Metaforce.configuration.authentication_handler\n end", "def type\n TYPES[roletype_id]\n end", "def protection_type\n @descriptive_detail.protection_type\n end", "def type\n self.attributes[:type]\n end", "def work_profile_password_required_type\n return @work_profile_password_required_type\n end", "def get_auth\n case @auth_method\n when 'private_key'\n get_auth_from_private_key\n when 'compute_engine'\n get_auth_from_compute_engine\n when 'json_key'\n get_auth_from_json_key\n when 'application_default'\n get_auth_from_application_default\n else\n raise ConfigError, \"Unknown auth method: #{@auth_method}\"\n end\n end", "def type\n @attributes[:type]\n end", "def identity_type\n return @identity_type\n end", "def get_tipo()\r\n\t\tif @l_identificadores != nil\r\n\t\t\t@l_identificadores.get_tipo()\r\n\t\telse\r\n\t\t\treturn @tipo\r\n\t\tend\t\r\n\tend", "def auth_level\n GlobalConstant::Cookie.password_auth_prefix\n end", "def method_auth_name\r\n method_info[:method_auth_name]\r\n end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def user_class\n \"#{params[:user_type]}\".classify.constantize\n end", "def type\n attr_val('./@typeCode')\n end", "def type\n self[:type]\n end", "def authentication_method\n super\n end", "def base_credential_type; end", "def secret_type\n return @secret_type\n end", "def session_authentication_method(sym=nil)\n @session_authentication_method = sym if sym\n @session_authentication_method\n end", "def account_type\n realm_discovery_response['account_type']\n end", "def isAccusation\n return @type\n end", "def type\n self['type']\n end", "def authorization_mode; end", "def auth_oauth\n @attributes[:auth_oauth]\n end", "def attribute_type\n (float? || integer? || text? || boolean? ? field_type : 'string').to_sym\n end", "def type\n self[:type]\n end", "def type\n read_attribute(:type) || Figaro.env.meal_types.split.first\n end", "def type\n self['TYPE'].to_i\n end", "def credentials\n return unless type\n send type\n end", "def authentication=(authentication)\n validator = EnumAttributeValidator.new('String', ['N', 'S', 'M'])\n unless validator.valid?(authentication)\n fail ArgumentError, 'invalid value for \"authentication\", must be one of #{validator.allowable_values}.'\n end\n @authentication = authentication\n end" ]
[ "0.77254635", "0.77254635", "0.6519027", "0.64810693", "0.64575577", "0.6454832", "0.641108", "0.6376407", "0.63334477", "0.63325673", "0.63325673", "0.63325673", "0.63325673", "0.6200412", "0.6185094", "0.60740185", "0.6020455", "0.60103816", "0.6004265", "0.6001647", "0.59917283", "0.5940351", "0.5926434", "0.59085685", "0.588297", "0.5879501", "0.5873461", "0.5872269", "0.5862823", "0.58558524", "0.5835252", "0.5828562", "0.5809708", "0.57981557", "0.57929665", "0.57844275", "0.5769903", "0.5751254", "0.5728717", "0.57058626", "0.5682465", "0.5680432", "0.56533957", "0.56523496", "0.5649275", "0.5645089", "0.5636692", "0.5636692", "0.5632368", "0.5620526", "0.56196344", "0.56196344", "0.5614652", "0.55708504", "0.55689555", "0.5567144", "0.5566396", "0.5564168", "0.5562076", "0.5557405", "0.55428225", "0.55428225", "0.55428225", "0.55428225", "0.5536204", "0.55284387", "0.5522804", "0.5522804", "0.5522804", "0.5503333", "0.55021113", "0.5493844", "0.5486793", "0.5478041", "0.54716116", "0.5468841", "0.54360557", "0.54115593", "0.5397656", "0.5395853", "0.53945655", "0.53945655", "0.5392587", "0.5390979", "0.5389566", "0.5374971", "0.5369203", "0.536498", "0.53592455", "0.53548414", "0.53538597", "0.5349783", "0.5332265", "0.5328362", "0.5326765", "0.5317894", "0.53096515", "0.53072435", "0.5302443", "0.5301349" ]
0.73936695
2
Sets the attribute authentication_type
def authentication_type=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type_authentication!()\n @type = TAC_PLUS_AUTHEN\n end", "def auth_type=(type=:basic)\n @auth_type = case type\n when :basic, \"basic\"\n Request::AuthBasic\n when :digest, \"digest\"\n Request::AuthDigest\n when :any, \"any\"\n Request::AuthAny\n else\n raise \"#{type.inspect} is an unknown authentication type\"\n end\n end", "def authentication_type; end", "def authentication_service_type=(authentication_service_type)\n validator = EnumAttributeValidator.new('String', [\"AuthAnvil\", \"GoogleAuthenticator\"])\n unless validator.valid?(authentication_service_type)\n fail ArgumentError, \"invalid value for 'authentication_service_type', must be one of #{validator.allowable_values}.\"\n end\n @authentication_service_type = authentication_service_type\n end", "def authentication=(authentication)\n validator = EnumAttributeValidator.new('String', ['N', 'S', 'M'])\n unless validator.valid?(authentication)\n fail ArgumentError, 'invalid value for \"authentication\", must be one of #{validator.allowable_values}.'\n end\n @authentication = authentication\n end", "def authen_type=(val)\n if (val.kind_of?(Integer))\n @authen_type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @authen_type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_methods=(value)\n @authentication_methods = value\n end", "def auth_provider=( type )\n\t\t\t@auth_provider = Strelka::AuthProvider.get_subclass( type )\n\t\t\tself.log.debug \"Auth provider set to %p\" % [ @auth_provider ]\n\t\t\treturn @auth_provider\n\t\tend", "def authen_type_arap!()\n @authen_type = TAC_PLUS_AUTHEN_TYPE_ARAP\n end", "def authorization_mode=(mode); end", "def type_authorization!()\n @type = TAC_PLUS_AUTHOR\n end", "def role=(value)\n self.user_type = ROLES[value]\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def password_required_type=(value)\n @password_required_type = value\n end", "def type=(type)\n @type = type.to_sym\n end", "def auth_kind=(new_auth_kind)\n new_auth_kind = nil if new_auth_kind.blank?\n super new_auth_kind\n end", "def set_user_type\n @user_type = params[:user_type]\n end", "def type=(type)\n self['type'] = type\n end", "def capable_auth_types; end", "def authorization=(auth)\n write_attribute(column_for_attribute('authorization').name, auth)\n end", "def access_type= new_access_type\n @access_type = new_access_type\n end", "def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end", "def set_AuthenticationToken(value)\n set_input(\"AuthenticationToken\", value)\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"random\", \"hash\", \"client\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def passcode_required_type=(value)\n @passcode_required_type = value\n end", "def type=(type)\n write_attr :type, type\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.temporaryAccessPassAuthenticationMethod\"\n end", "def sslkeytype=(value)\n Curl.set_option(:sslkeytype, value_for(value, :string), handle)\n end", "def type=(new_type)\n @type = new_type.to_sym\n end", "def set_authentication_authority\n value = ';ShadowHash;HASHLIST:'\n authority = NSMutableArray.new\n if @kernel_version_major >= 12\n value << '<SALTED-SHA512-PBKDF2>'\n elsif @kernel_version_major == 11\n value << '<SALTED-SHA512>'\n else\n value << '<SALTED-SHA1>'\n end\n authority << value\n @user['authentication_authority'] = authority\n end", "def set_account_type(account_type = nil, reset = false)\n self.roles = nil if reset\n unless account_type.blank?\n self.roles << account_type.to_sym\n self.setup << :account_type\n end\n end", "def set_type\n end", "def type=(type)\n @type = type\n\n setOption('type', @type)\n end", "def httpauth=(value)\n Curl.set_option(:httpauth, value_for(value, :enum, :httpauth), handle)\n end", "def authen_type_ascii!()\n @authen_type = TAC_PLUS_AUTHEN_TYPE_ASCII\n end", "def type=(type)\n @type = type\n end", "def with_authentication_hash(auth_type, auth_values); end", "def type=(type)\n @type = type\n @signed = type.name.split('::').last[0] != \"U\"\n type\n end", "def type=(value)\n @type = value.to_sym\n end", "def type=(type)\n @type = type\n end", "def with_authentication_hash(auth_type, auth_values)\n self.authentication_hash, self.authentication_type = {}, auth_type\n self.password = auth_values[:password]\n\n parse_authentication_key_values(auth_values, authentication_keys) &&\n parse_authentication_key_values(request_values, request_keys)\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"fc-initiator\", \"fc-nvme-initiator\", \"fc-nvme-target\", \"fc-target\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def principal_type=(new_principal_type)\n super\n if @principal_name && !principal_id\n principal = Object.const_get(principal_type).\n find_by_name(@principal_name)\n self.principal_id = principal && principal.id\n end\n end", "def type=(type)\n @type = type\n end", "def set_authentication_method(opts)\n opts = check_params(opts,[:auth_methods])\n super(opts)\n end", "def auth_types\n @auth_types ||= hardcoded_auth_types #HTTParty.get(\"#{ENV['PRIVILEGES_BASE_URL']}/patrons.json?sublibrary_code=#{ENV['PRIVILEGES_SUBLIBRARY_CODE']}\").parsed_response\n end", "def authen_type_mschap!()\n @authen_type = TAC_PLUS_AUTHEN_TYPE_MSCHAP\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['string', 'number', 'boolean', 'date', 'address', 'country', 'email', 'url', 'image', 'signature', 'barcode', 'combined'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"NFS\", \"SMB\", \"iSCSI\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def auth_types\n @auth_types ||= [\"CB\"]\n end", "def type=(type)\n @@type = type\n end", "def authen_type_chap!()\n @authen_type = TAC_PLUS_AUTHEN_TYPE_CHAP\n end", "def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end", "def authentication_strength=(value)\n @authentication_strength = value\n end", "def set_authentication\n\t\t\t@authentication = Authentication.find(params[:id])\n\t\tend", "def account_type=(type)\n case type\n when TEMP_DUPLICATE\n @account_type = 'duplicate'\n when NORMAL\n @account_type = 'normal'\n when INTERDOMAIN_TRUST\n @account_type = 'interdomain_trust'\n when WORKSTATION_TRUST\n @account_type = 'workstation_trust'\n when SERVER_TRUST\n @account_type = 'server_trust'\n else\n @account_type = 'unknown'\n end\n end", "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"iam.EndPointPrivilege\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "def set_user_type\n if user_type_id.blank?\n customer_type_id = UserType.find_by(code: 'CUSTOMER').id\n self.user_type_id = customer_type_id\n end\n end", "def type=(type)\n validate_type_values(type)\n @type = type\n end", "def type_authentication?()\n return(true) if(@type == TAC_PLUS_AUTHEN)\n return(false)\n end", "def set_type\n case @type\n when :password\n I18n.t('hidden_password')\n when :currency\n formatted_value_currency(@value)\n when :breakable\n formatted_value_breakable(@value, @break_character)\n else\n # Other types can be autodetected\n formatted_value_other(@value, @type)\n end\n end", "def authentication_method\n super\n end", "def set_agent_type\n @agent_type = AgentType.find(params[:id])\n authorize @agent_type\n end", "def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Agreement\", \"CreditMemo\", \"DownPayment\", \"Miscellaneous\", \"Progress\", \"Standard\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def type= (type)\n self.tweet_type = type\n end", "def type=(val)\n @type = val.to_sym\n end", "def ssl_key_type=(key_type)\n raise \"Invalid ssl key type : '#{key_type}'...\" if key_type and !%w(PEM DER ENG).include?(key_type)\n set_option(:sslkeytype, key_type)\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "def identity_type=(value)\n @identity_type = value\n end", "def set_authenticator\n @authenticator = Authenticator.find(params[:id])\n end", "def authen_method=(val)\n if (val.kind_of?(Integer))\n @authen_method = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value must be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @authen_method = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n return(nil)\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def set_security_role_type\n @security_role_type = Security::RoleType.find(params[:id])\n end", "def ssl_key_type=(key_type)\n raise \"Invalid ssl key type : '#{key_type}'...\" if key_type and !%w(PEM DER ENG).include?(key_type)\n set_option(OPTION_VALUES[:CURLOPT_SSLKEYTYPE], key_type)\n end", "def class_type=(value)\n\t\tself[:type] = value\n\tend", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end", "def authentication_configuration=(value)\n @authentication_configuration = value\n end", "def authentication_params(type:)\n case type&.to_sym\n when :sign_up\n [:accept_terms, :email, :firstname, :language_id, :org_id, :password, :surname,\n { org_attributes: %i[abbreviation contact_email contact_name is_other\n managed name org_type target_url links] }]\n when :sign_in\n %i[email org_id password]\n else\n %i[email]\n end\n end", "def authen_type_pap!()\n @authen_type = TAC_PLUS_AUTHEN_TYPE_PAP\n end", "def set_role_credential(type = 'user', uid = 'Admin')\n jwt = role_jwt(type, uid)\n Ros::Sdk::Credential.authorization = \"Bearer #{jwt.encode}\"\n end", "def set_type(val)\n self.type = val\n self\n end", "def type=(new_type)\n self[:type_flags] = (flags | TYPES[new_type])\n end", "def set_identifier_type\n @identifier_type = IdentifierType.find(params[:id])\n authorize @identifier_type\n end", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end", "def set_authentication\n @authentication = Authentication.find(params[:id])\n end" ]
[ "0.7468862", "0.7029217", "0.6981294", "0.6913188", "0.6900223", "0.6547785", "0.64416295", "0.64416295", "0.63031423", "0.6262297", "0.62578136", "0.62269455", "0.6210702", "0.6181176", "0.6096881", "0.6096881", "0.6096881", "0.6096881", "0.6043441", "0.6022235", "0.6003842", "0.6000025", "0.599263", "0.5963291", "0.5962378", "0.59546363", "0.59546363", "0.5933438", "0.5924399", "0.59119", "0.5901469", "0.5878461", "0.58725196", "0.5868195", "0.5867149", "0.58615565", "0.5845858", "0.5844634", "0.5843092", "0.5842956", "0.583634", "0.5823492", "0.5817169", "0.5811054", "0.5804978", "0.5801427", "0.5786645", "0.57741", "0.57649046", "0.57642937", "0.5749675", "0.57485753", "0.57392764", "0.57098895", "0.57098895", "0.57098895", "0.57098895", "0.57098895", "0.57098895", "0.57098895", "0.57050776", "0.56916976", "0.5686287", "0.5674952", "0.56737465", "0.56641394", "0.56633544", "0.56632847", "0.56616485", "0.5660528", "0.56596464", "0.5659413", "0.565678", "0.5655097", "0.5640126", "0.56341636", "0.56319183", "0.561891", "0.5606213", "0.5605035", "0.56006503", "0.55875605", "0.55855757", "0.55825645", "0.55713165", "0.55713165", "0.55713165", "0.556836", "0.5566595", "0.5542599", "0.55388224", "0.5538208", "0.553796", "0.5527346", "0.5525938", "0.55213594", "0.5518025", "0.5510842", "0.5500496", "0.55004" ]
0.7036085
1
Override and set to false for things like OmniAuth that technically run through Authentication (user_set) very often, which would normally reset CSRF data in the session
def clean_up_csrf?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up_csrf?\n false\n end", "def disable_request_forgery_protection=(_arg0); end", "def disable_request_forgery_protection; end", "def clean_up_csrf?\n false\n end", "def clean_up_csrf?\n true\n end", "def clean_up_csrf?\n true\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\n end", "def protect_against_forgery?\n false\nend", "def protect_against_forgery? #:nodoc:\n false\n end", "def allow_forgery_protection\n true\n end", "def protect_against_forgery?; end", "def skip_forgery_protection(options = T.unsafe(nil)); end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def masked_authenticity_token(session, form_options: T.unsafe(nil)); end", "def use_null_session\n ActionController::RequestForgeryProtection::ProtectionMethods::NullSession.new(self)\n .handle_unverified_request\n end", "def use_request_specific_csrf_tokens?\n csrf_options[:require_request_specific_tokens]\n end", "def handle_unverified_request\n super\n cookies.delete(:autologin)\n end", "def protect_against_forgery?\n end", "def verify_csrf_token?\n false\n end", "def csrf_token\n session[:csrf] ||= SecureRandom.hex 32\n end", "def session_updatable?\n !devise_controller? && !request_xhr?\n end", "def set_csrf_token(_req, res)\n res.session[CSRF_TOKEN] ||= generate_csrf_token\n end", "def protect_against_forgery?\n\n end", "def set_user_session\n session[:previously_not_logged_in] = false\n session[:previously_not_logged_in] = true unless user_signed_in?\n end", "def csrf; end", "def protect_from_forgery\n end", "def csrf_meta_tags; end", "def csrf_safe?\n @csrf_safe\n end", "def authenticate_request\n @current_user = nil\n end", "def set_csrf_cookie\n csrf_cookie_key = 'XSRF-TOKEN'\n cookies[csrf_cookie_key] = form_authenticity_token if protect_against_forgery? && current_user\n end", "def reset_token\r\n authentication_token true\r\n end", "def csrf=(_arg0); end", "def set_csrf_cookie_for_ng\n\t\tcookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n\tend", "def handle_unverified_request\n sorcery_config.before_unverified_request.each do |callback|\n send(callback)\n end\n @current_user = nil\n super # call the default behaviour which resets the session\n end", "def handle_unverified_request\n super # call the default behaviour which resets the session\n cookies.delete(:remember_token)\n redirect_to :login\n end", "def reset_sorcery_session(keep_values: false)\n if keep_values\n # TODO: `to_hash` is functionally different from `to_h`, double check\n # that this usage is intended. (Typically you should use to_h)\n # https://stackoverflow.com/a/26610268\n old_session = session.dup.to_hash\n reset_session\n old_session.each_pair do |key, value|\n session[key.to_sym] = value\n end\n form_authenticity_token\n else\n reset_session\n end\n end", "def omit_unchanged_session_cookie\n # Only take this action if not-logged-in and session cookie is unchanged\n return unless !logged_in? && session.to_h == @original_session\n\n request.session_options[:skip] = true\n end", "def skip_session\n request.session_options[:skip] = true if token\n end", "def protect_against_forgery?\n controller.send(:protect_against_forgery?)\n end", "def check_csrf?\n true\n end", "def new\n session.delete('devise.omniauth_data')\n super\n end", "def handle_unverified_request\n logger.warn \" Form token: #{params[request_forgery_protection_token]}\" if logger\n logger.warn \" Header token: #{request.headers['X-CSRF-Token']}\" if logger\n logger.warn \" Session token: #{session[:_csrf_token]}\" if logger\n super\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def verified_request?\n super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n end", "def new\n super\n reset_session\n end", "def clear_login_data\r\n session[:edit_mode] = 0\r\n session[:user_id] = nil\r\n session[:user_name] = nil\r\n session[:user_roles] = nil\r\n cookies.delete :remember_me\r\nend", "def auth_handler=(handler)\n @session_cookie = nil\n return super(handler)\n end", "def check_csrf?\n true\n end", "def auth_token\n (protect_against_forgery? ? form_authenticity_token : nil)\n end", "def before_rodauth\n rails_verify_authenticity_token\n super\n end", "def verified_request?\r\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\r\n end", "def verified_request?\n\t\tsuper || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])\n\tend", "def skip_set_cookies_header\n reset_session\n end", "def ensure_session_token\n self.session_token ||= User.generate_session_token\nend", "def protect_against_forgery?\n @paf ||= ActionController::Base.new.send(:protect_against_forgery?)\n end", "def ensure_session_token \n self.session_token ||= SecureRandom::urlsafe_base64\n end", "def test_csrf_protection_on_login\n turtle_response = @user.register\n assert_response(turtle_response, :success)\n assert(@user.id)\n\n params = {\n 'email' => @user.email,\n 'password' => @user.password,\n }\n\n headers = {\n 'Accept-Encoding' => '',\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'Accept' => 'application/json'\n }\n\n # Step 1\n post '/login', params, headers\n assert_response(@response, 403)\n\n # Step 2\n post '/login', params.merge('_csrf' => 'idunnolol'), headers\n assert_response(@response, 403)\n\n headers_encode_only = { 'Accept-Encoding' => '' }\n\n # Step 3\n get '/login', {}, headers_encode_only\n assert_response(@response, :success)\n\n params['_csrf'] = get_csrf\n\n post '/login', params, headers\n assert_response(@response, 403, \"csrf: #{params['_csrf']}\")\n\n # Step 4\n get '/login', {}, headers_encode_only\n assert_response(@response, :success)\n\n update_session_in(headers)\n\n params['_csrf'] = 'omgnowai'\n\n post '/login', params, headers\n assert_response(@response, 403)\n\n # Step 5\n get '/login', {}, headers_encode_only\n assert_response(@response, :success)\n\n update_session_in(headers)\n\n params['_csrf'] = get_csrf\n\n post '/login', params, headers\n assert_response(@response, :success)\n end", "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save! #save will not throw error and only return true/false and save! will return true/error\n # error can't be part of conditional, we don't want it to fail quiety here\n self.session_token\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end", "def set_csrf_cookie\n cookies['CSRF-TOKEN'] = form_authenticity_token\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def verified_request?\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\n end", "def request_authenticity_tokens; end", "def reset_session_token!\n self.session_token = SecureRandom::urlsafe_base64\n self.save!\n # save! to persist. when not checking if worked, bang version\n end" ]
[ "0.7259691", "0.72274673", "0.7212052", "0.72044206", "0.7049534", "0.7049534", "0.6916054", "0.6916054", "0.6891523", "0.6878115", "0.6858617", "0.68569195", "0.68569195", "0.68569195", "0.68569195", "0.68569195", "0.68569195", "0.6844956", "0.68338215", "0.67773026", "0.67173827", "0.6664238", "0.6630903", "0.6630903", "0.6630903", "0.64695907", "0.64348406", "0.63815016", "0.6330642", "0.63213336", "0.63071567", "0.62986165", "0.6285096", "0.6244177", "0.6217608", "0.62068534", "0.62052804", "0.61620665", "0.6144743", "0.6143627", "0.6142177", "0.6137674", "0.613206", "0.6125005", "0.6119886", "0.6108363", "0.60971576", "0.60933805", "0.6087597", "0.60863", "0.6084931", "0.6080635", "0.60663795", "0.6056168", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.6052309", "0.60456043", "0.60456043", "0.60456043", "0.60408497", "0.6038442", "0.60327035", "0.60233414", "0.6017958", "0.60005885", "0.5996721", "0.59964204", "0.5987734", "0.59793466", "0.5976368", "0.5971007", "0.5955626", "0.5951188", "0.5949141", "0.5949141", "0.5949141", "0.5949141", "0.5949141", "0.5949141", "0.5949141", "0.5949141", "0.59331197", "0.59292567", "0.59292567", "0.59292567", "0.59292567", "0.5925977", "0.59206873" ]
0.69895554
7
Returns the value of attribute password. source://devise//lib/devise/strategies/authenticatable.rb11
def password; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password\n @attributes[:password]\n end", "def password\n @attributes[:password]\n end", "def password\n\t\tPassword.new( attribute_get(:password) )\n\tend", "def user_password\n @password\n end", "def encrypted_password\n read_attribute(:password)\n end", "def password\n return @password\n end", "def password\n return nil unless @password\n @password.password\n end", "def password\n return @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password_field\n self.password\n end", "def password\n @password\n end", "def password\n if current_user.present?\n if object.password.present? \n if current_user.super_admin?\n object.password\n else\n nil\n end\n else\n object.password\n end\n else\n nil\n end\n end", "def getPassword()\n return @password\n\tend", "def password\n raw_password = read_attribute(:password)\n raw_password.blank? ? nil : crypt.decrypt(raw_password)\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\n @password\n end", "def password\r\n @password\r\n end", "def password\n Password.find(password_id)\n end", "def password\n \t\t return password_virtual_attr\n end", "def password\n @crypted_password\n \n end", "def password\n begin\n password = ::BCrypt::Password.new(self.encrypted_password)\n rescue\n password = nil\n end\n password\n end", "def password\n\t\t# We expect that the default OpenMRS interface is used to create users\n\t\t#self.password = encrypt(self.plain_password, self.salt) if self.plain_password\n\t\t#raise @password.to_yaml\n\t\tself[:password]\n\tend", "def password\n\t\t@password\n\tend", "def password\n\t\t@password\n\tend", "def get_password(password)\n password\n end", "def password_protected\n @attributes[:password_protected]\n end", "def password\n @hash.to_s\n end", "def password_credentials\n return @password_credentials\n end", "def password\n return self[:password]\n end", "def password\n if !@password_insync && resource[:api_admin] == :true\n update_admin_pass_with_rake\n end\n return resource[:password] if @password_insync\n return nil\n end", "def password\n\t@password\n\tend", "def password\n @controls.password_field.text\n end", "def password_field(value = nil)\n if value.nil?\n read_inheritable_attribute(:password_field) || password_field(klass.password_field)\n else\n write_inheritable_attribute(:password_field, value)\n end\n end", "def password\n BCrypt::Password.new(self.password_digest)\n end", "def password\n credentials.last\n end", "def password \n @password \n end", "def password=(value)\n @password = value\n end", "def password(db_connection)\n sql = 'SELECT password FROM user_logins WHERE user_id=$1;'\n db_connection.exec_params(sql, [ id ]).first['password']\n end", "def password(id)\n profile_element = profile(id)\n if profile_element\n enc_passwd = profile_element['password']\n return decrypt(enc_passwd) if enc_passwd\n end\n end", "def password\n @password ||= BCrypt::Password.new(encrypted_password) if encrypted_password\n end", "def password\n @password ||= Password.new(self.hashed_password)\n end", "def password\n first_element_text('password')\n end", "def password\n@password\nend", "def password\n@password\nend", "def password\n @password ||= BCrypt::Password.new(h_password)\n end", "def password_credential\n user.credentials.find { |c| c.is_a? Credentials::Password }\n end", "def password=(value)\n\t\t\t@password = value\n\t\tend", "def password_required\n return @password_required\n end", "def password_required\n return @password_required\n end", "def password_required\n return @password_required\n end", "def getpassword()\r\n return getvalue(SVTags::PASSWORD)\r\n end", "def change_password\n @attributes[:change_password]\n end", "def password\n # Not using superclass_delegating_reader. See +site+ for explanation\n if defined?(@password)\n @password\n elsif superclass != Object && superclass.password\n superclass.password.dup.freeze\n end\n end", "def password\n @password||=@options['password']\n end", "def password\n @password ||= match[4]\n end", "def password\n @retain_user_connection_parameters.password\n end", "def authentication_password\n BCrypt::Password.new(hashed_password)\n end", "def password_digest(password)\n Devise.bcrypt(self.class, password)\n end", "def password\n [@password, @security_token].join('')\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password)\n end", "def password\n if password_digest\n @password ||= BCrypt::Password.new(password_digest)\n else\n nil\n end\n end", "def account_password\n\t\tif self[:account_password].blank?\n\t\t\treturn \"\"\n\t\tend\n\t\n\t\tBase64.decode64(self[:account_password])\n\tend", "def new_password\n @new_password\n end", "def password\n @password ||= BCrypt::Password.new(@password_hash)\n end", "def password_present?\n return self.password\n end", "def password\n @password ||= match[4]\n end", "def password # This is what is called whenever @user.password is referenced. Returns a Password object from the data in a stored encrypted hash\n if password_hash != nil\n @password ||= Password.new(password_hash)\n else\n return false\n end\n end", "def password # This is what is called whenever @user.password is referenced. Returns a Password object from the data in a stored encrypted hash\n if password_hash != nil\n @password ||= Password.new(password_hash)\n else\n return false\n end\n end", "def password\n connect\n password = self.class.query('CMD_API_VERIFY_PASSWORD',\n :user => resource[:username],\n :passwd => resource[:password]\n )\n if password[\"valid\"] == \"1\"\n return resource[:password]\n else\n return \"********\"\n end\n end", "def password\n @password ||= BCrypt::Password.new(hashed_password) # hangs on to the plain text password and compares it against the entered plain text password for authentication\n end", "def password_field; end", "def account_password\n get_account_password\n end", "def password\n @password ||= BCrypt::Password.new(password_hash)\n end" ]
[ "0.8561915", "0.8561915", "0.8178058", "0.81017876", "0.80812395", "0.8052466", "0.8037526", "0.80073214", "0.79973394", "0.79973394", "0.7961649", "0.7961649", "0.7956641", "0.7911797", "0.7900492", "0.784306", "0.7828491", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7827688", "0.7806103", "0.7799323", "0.77838427", "0.7764278", "0.76812416", "0.76283777", "0.7618488", "0.7618488", "0.7602452", "0.75984675", "0.75793344", "0.7547077", "0.75438416", "0.7525361", "0.74989605", "0.7484804", "0.7441628", "0.7431189", "0.7421029", "0.74132746", "0.740758", "0.73972195", "0.73614866", "0.73535323", "0.73406845", "0.7329813", "0.7314399", "0.7314399", "0.7300469", "0.72986573", "0.72967505", "0.726374", "0.726374", "0.726374", "0.7251008", "0.723308", "0.72318286", "0.7212458", "0.7193825", "0.71495926", "0.7149299", "0.71438986", "0.7140988", "0.71382475", "0.7117031", "0.7099435", "0.7075936", "0.7075425", "0.7074196", "0.7062336", "0.70616406", "0.70616406", "0.7058144", "0.7053475", "0.7050895", "0.7039706", "0.70337737" ]
0.0
-1
Sets the attribute password
def password=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password=(val)\n return if val.blank?\n attribute_set(:salt, Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{name}--\")) if new?\n attribute_set(:crypted_password, val.encrypt(self.salt))\n end", "def password=(value)\n\t\t\t@password = value\n\t\tend", "def password=(value)\n @password = value\n end", "def password=(str) \n write_attribute(:password, Digest::MD5.hexdigest(str)) \n end", "def password=(password)\n \t\tself.salt = Random.rand.to_s\n \t\tself.password_digest = Digest::SHA1.hexdigest(password + self.salt)\n \n self.password_virtual_attr = password\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def password\n\t\tPassword.new( attribute_get(:password) )\n\tend", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def password=(new_password)\n @password = new_password\n end", "def password_set(password)\n self.password.set password\n self.passwordconfirm.set password\n end", "def password= passwd\n return unless passwd\n new_salt = User.fresh_salt\n self.passworddate = Date.today.to_s\n self.salt = new_salt\n self.send(:write_attribute, :password, User.password_hash(passwd.to_s, new_salt))\n end", "def password=(password)\n validate_options(password: password)\n @password = password\n end", "def password=(password)\n @password = password\n end", "def password(value)\n @config[:password] = value\n end", "def password=(new_password); end", "def set_password_field(password)\n end", "def password=(value)\n value.blank? ? nil : write_attribute(:password, crypt.encrypt(value))\n end", "def pass=(new_password)\n self.password = Password.create(new_password)\n end", "def set_password(password)\n @password = Base64.encode64(password)\n end", "def password=(password)\n write_local(:crypted_password, Shield::Password.encrypt(password))\n\n @password = password\n end", "def _inki_password=(value)\n\t\t@_inki_password = value\n\tend", "def password\n @attributes[:password]\n end", "def password\n @attributes[:password]\n end", "def password=(s)\n if s\n replace_element_text('password', s)\n else\n delete_elements('password')\n end\n end", "def password=(value)\n reset_agent\n @password = value\n end", "def password=(value)\n reset_agent\n @password = value\n end", "def password=(value)\n reset_agent\n @password = value\n end", "def password(password)\n @options[:password] = password\n end", "def password= new_password\n @password = new_password\n end", "def set_password(pass)\n self.user_password = User.crypt(pass)\n end", "def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end", "def password=(arg)\n raise ArgumentError, \"password expected a string, not a #{arg.class}\" unless arg.is_a?(String)\n @password=arg\n end", "def password=(value)\n if value.to_s.blank?\n @password = nil\n @password_updated = false\n else\n @password = value\n @password_updated = true\n end\n end" ]
[ "0.83016336", "0.82853067", "0.82116514", "0.8082067", "0.795411", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7944346", "0.7943067", "0.7943067", "0.79268533", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.788867", "0.7887739", "0.7887739", "0.78662676", "0.78379524", "0.78275716", "0.78124684", "0.7802974", "0.77886355", "0.778274", "0.77824044", "0.77804434", "0.77475315", "0.76961535", "0.7670906", "0.7665309", "0.76561517", "0.76561517", "0.76533586", "0.7648879", "0.7648879", "0.7648879", "0.7634948", "0.7631374", "0.76191026", "0.75949603", "0.7590127", "0.757612" ]
0.0
-1
Holds the authenticatable name for this class. Devise::Strategies::DatabaseAuthenticatable becomes simply :database. source://devise//lib/devise/strategies/authenticatable.rb171
def authenticatable_name; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticatable_name\n @authenticatable_name ||=\n self.class.name.split(\"::\").last.underscore.sub(\"_authenticatable\", \"\").to_sym\n end", "def authenticatable_name\n @authenticatable_name ||=\n ActiveSupport::Inflector.underscore(self.class.name.split(\"::\").last).\n sub(\"_authenticatable\", \"\").to_sym\n end", "def name\n authentications.first.name\n end", "def authenticate_name\n super\n end", "def authentication_type; end", "def authentication_method\n @attributes[:authentication_method]\n end", "def authentication_method\n @attributes[:authentication_method]\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def user_key\n send(Devise.authentication_keys.first)\n end", "def database_authenticatable(options={})\n null = options[:null] || false\n default = options[:default] || \"\"\n\n if options.delete(:encryptor)\n ActiveSupport::Deprecation.warn \":encryptor as option is deprecated, simply remove it.\"\n end\n\n apply_schema :email, String, :null => null, :default => default\n apply_schema :encrypted_password, String, :null => null, :default => default, :limit => 128\n apply_schema :password_salt, String, :null => null, :default => default\n end", "def method_auth_name\r\n method_info[:method_auth_name]\r\n end", "def encryptor_class\n @encryptor_class ||= ::Devise::Encryptors.const_get(encryptor.to_s.classify)\n end", "def http_authenticatable?\n mapping.to.http_authenticatable?(authenticatable_name)\n end", "def http_authenticatable?\n mapping.to.http_authenticatable?(authenticatable_name)\n end", "def authentication_handler\n Metaforce.configuration.authentication_handler\n end", "def human_auth_method\n self[:auth_method].to_human\n end", "def scim_authentication_method\n @attributes[:scim_authentication_method]\n end", "def default_database_name\n self.name.tableize\n end", "def iam_database_authentication_enabled\n data[:iam_database_authentication_enabled]\n end", "def iam_database_authentication_enabled\n data[:iam_database_authentication_enabled]\n end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def authenticatable?\n self.class.included_modules.include?(Authenticatable)\n end", "def table_name\n self.class.name.demodulize.tableize\n end", "def database_name # :nodoc:\n return nil unless Module.constants.include? 'DataMapper' or Module.constants.include? :DataMapper\n raise \"No such database connection #{options[:database]}\" if options[:database] and DataMapper::Repository.adapters[options[:database]].nil?\n # Custom database connection specified\n return options[:database].to_sym if options[:database]\n # Leaf config name\n return leaf_name.to_sym if DataMapper::Repository.adapters[leaf_name.to_sym]\n # Leaf config name, underscored\n return leaf_name.methodize.to_sym if DataMapper::Repository.adapters[leaf_name.methodize.to_sym]\n # Leaf class name\n return self.class.to_s.to_sym if DataMapper::Repository.adapters[self.class.to_s.to_sym]\n # Leaf class name, underscored\n return self.class.to_s.methodize.to_sym if DataMapper::Repository.adapters[self.class.to_s.methodize.to_sym]\n # I give up\n return nil\n end", "def table_name\n @table_name ||= self.class.const_get(class_name).table_name\n end", "def authentication_methods\n return @authentication_methods\n end", "def http_authenticatable?; end", "def model_class\n AuthenticationToken\n end", "def plugin_name\n 'auth'\n end", "def authenticate_active_admin_user\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n send(active_admin_namespace.authentication_method) if active_admin_namespace.authentication_method\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n end", "def authenticatable_salt\n read_attribute(:authenticatable_salt)\n end", "def authentication\n if @property_hash[:authentication] == 'SERVER' and @resource[:authentication].upcase == 'DCS'\n return @resource[:authentication]\n else\n return @property_hash[:authentication]\n end\n end", "def user_class\n Merb::Authentication.user_class\n end", "def params_authenticatable?\n User.params_authenticatable?(authenticatable_name)\n end", "def resource_name\n devise_mapping.name\n end", "def _table_name\n self.class.table_name\n end", "def authentication_method\n super\n end", "def table_name\n self.class.table_name\n end", "def auth_scheme; end", "def authentication_keys\n @authentication_keys ||= User.authentication_keys\n end", "def user_model\n (@user_model || \"User\").to_s.constantize\n end", "def table_name\n self.name.split('::').last\n end", "def authentication provider=:identity\n Authentication.where(user_id: id, provider: provider).all.first\n end", "def table_name\n cti_tables ? cti_tables.last : super\n end", "def authentication_token\n loop do\n token = Devise.friendly_token\n break token unless to_adapter.find_first({ authentication_token: token })\n end\n end", "def capable_auth_types; end", "def providers\n authentication_strategies.pluck :provider\n end", "def login_name\n return @login_name\n end", "def auth_env\n auth_env_as(users(:mati))\n end", "def session_authentication_method(sym=nil)\n @session_authentication_method = sym if sym\n @session_authentication_method\n end", "def get_table_name\n self.class.table_name\n end", "def authenticating_with\n @authenticating_with ||= :password\n end", "def default_join_table\n ([self[:class_name].demodulize, self[:model].name.to_s.demodulize]. \\\n map{|i| i.pluralize.underscore}.sort.join('_')).to_sym\n end", "def resource_class\n devise_mapping.to\n end", "def authenticate_active_admin_user\n send(active_admin_namespace.authentication_method) if active_admin_namespace.authentication_method\n end", "def authentication\n raise NotImplementedError\n end", "def schema_name\n return self.table_name.split('.')[0] if self.table_name && self.table_name =~ /\\./\n return self.table_name_prefix.to_s.gsub(/\\./,'') if self.table_name_prefix && self.table_name_prefix =~ /\\./\n return self.connection.config[:database] if self.connection.mysql?\n end", "def class_name\n table.model.name\n end", "def table_name\n @table_name ||= (superclass == SmallRecord::Base) ? default_table_name : superclass.table_name\n end", "def alternative_names\n auth_providers.map do |ap|\n { provider: ap.provider, name: \"#{ap.uname} (#{ap.provider})\" }\n end\n end", "def user_parameter\n user_model.model_name.singular.to_sym\n end", "def authentication_type=(_arg0); end", "def table_name\n self.to_s.pluralize.underscore\n end", "def check_authentication\n case self.controller_name\n when /^clients/i, /^ingredients/i, /^orders/i, /^pages/i, /^productpresentations/i, /^products/i, /^companies/i\n authenticate\n end\n end", "def params_authenticatable?\n mapping.to.params_authenticatable?(authenticatable_name)\n end", "def table_name\n\t\tself.table_name\n\tend", "def authenticate_active_admin_user\n send(active_admin_namespace.authentication_method) if active_admin_namespace.authentication_method\n end", "def current_database_name\n ActiveRecord::Base.connection_pool.spec.config[:name] || 'default'\n end", "def table_name\n self.class.table_name\n end", "def xlate_authen_method()\n return AUTHEN_METHOD_XLATES[@authen_method] if (AUTHEN_METHOD_XLATES.has_key?(@authen_method))\n return(@authen_method.to_s) \n end", "def provider\n authorization.provider\n end", "def table\n self.class.table_name\n end", "def user_authentication\n end", "def params_authenticatable?; end", "def associated_table_names\n user_access_controls.valid_resources([:table]).where(resource_type: :table).select(&:access).map(&:resource_name).uniq\n end", "def schema_key\n @schema_key ||= self.class.name.demodulize.gsub('Validator', '').underscore\n end", "def authenticating_authority\n @authenticating_authority ||= []\n end", "def model_table_name\n model_name = model_param.name\n model_class = model_name.demodulize\n model_class.tableize\n end", "def tableize\n # TODO\n # Inflector.demodulize(self)\n end", "def implicit_table_name\n pluralize(underscore(demodulize(name))).to_sym\n end", "def implicit_table_name\n pluralize(underscore(demodulize(name))).to_sym\n end", "def name\n name = self[:name]\n name.blank? ? login : name\n end", "def authentications\r\n AuthenticationsController.instance\r\n end", "def active_for_authentication?\n self.active?\n end", "def database_name\n @dbi.db_name\n end", "def database_name\n @dbi.db_name\n end", "def authenticator_token\n @authenticator ||= self.get_authenticator_token\n end", "def format\n self.class.name.split('::').last.downcase.to_sym\n end", "def active_for_authentication?\n super\n end", "def tables\n [\n ::GDO::Login::GDO_LoginHistory,\n ::GDO::Login::GDO_LoginAttempts,\n ]\n end", "def index\n\t @authentications = current_user.authentications.order('provider asc')\n\t end", "def platform_authorized_key(type)\n \"#{type.graphql_name}.authorized\"\n end", "def key\n self.class.name.split(/::/).last.underscore\n end", "def symbolize_password_keys!(authentications)\n auth_type = authentications.keys.first\n # symbolize userid, password\n authentications[auth_type].symbolize_keys!\n\n return authentications, auth_type\n end", "def api_table\n controller_name\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using \n #our own \"is_active\" column\n super and self.is_active?\n end", "def database_name\n __evaluate__(storage_options[:database])\n end", "def authentication_information\n password.nil? ?\n { :method => :anonymous } :\n { :method => :simple, :username => username, :password => password }\n end" ]
[ "0.8510426", "0.8403227", "0.6163791", "0.6136346", "0.6077906", "0.59636647", "0.59636647", "0.5938621", "0.5938621", "0.57953995", "0.57588947", "0.5752565", "0.57008654", "0.57008654", "0.56558996", "0.560047", "0.555657", "0.55251145", "0.5497138", "0.5497138", "0.54784745", "0.54784745", "0.54296124", "0.5415424", "0.5400754", "0.53936297", "0.53812265", "0.5371158", "0.536903", "0.53464985", "0.53453004", "0.53413624", "0.53407186", "0.53303957", "0.5309851", "0.53049725", "0.52934456", "0.5292068", "0.5282733", "0.5277737", "0.52762634", "0.5273294", "0.52707356", "0.52697474", "0.5269689", "0.52573997", "0.52558357", "0.5234429", "0.5229869", "0.52217305", "0.5218632", "0.52030426", "0.5168342", "0.5150313", "0.51469296", "0.51392454", "0.5136957", "0.5120611", "0.5104423", "0.5098621", "0.5096803", "0.50916547", "0.5072395", "0.5070351", "0.5050697", "0.5046518", "0.5044034", "0.5040712", "0.50315505", "0.5029971", "0.50238883", "0.5021687", "0.50210524", "0.501303", "0.50074065", "0.4997671", "0.4997666", "0.49936932", "0.49907064", "0.49874082", "0.49858168", "0.49858168", "0.49757564", "0.49741066", "0.49705014", "0.49640453", "0.49640453", "0.4955858", "0.49512425", "0.49345505", "0.4923517", "0.49193487", "0.49193248", "0.4912843", "0.4909041", "0.48975375", "0.4897176", "0.4897176", "0.48962778", "0.48933765" ]
0.77965504
2
Helper to decode credentials from HTTP. source://devise//lib/devise/strategies/authenticatable.rb122
def decode_credentials; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_credentials\n return [] unless request.authorization && request.authorization =~ /^Basic (.*)/mi\n Base64.decode64($1).split(/:/, 2)\n end", "def decode_credentials\n return [] unless request.authorization && request.authorization =~ /^Basic (.*)/mi\n Base64.decode64($1).split(/:/, 2)\n end", "def get_auth_data \n auth_data = nil\n [\n 'REDIRECT_REDIRECT_X_HTTP_AUTHORIZATION',\n 'REDIRECT_X_HTTP_AUTHORIZATION',\n 'X-HTTP_AUTHORIZATION', \n 'HTTP_AUTHORIZATION'\n ].each do |key|\n if request.env.has_key?(key)\n auth_data = request.env[key].to_s.split\n break\n end\n end\n if auth_data && auth_data[0] == 'Basic' \n return Base64.decode64(auth_data[1]).split(':')[0..1] \n end \n end", "def get_auth_data\n auth_key = @@http_auth_headers.find { |h| request.env.key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil]\n end", "def http_auth_hash\n keys = [http_authentication_key, :password]\n Hash[*keys.zip(decode_credentials).flatten]\n end", "def http_auth_hash\n keys = [http_authentication_key, :password]\n Hash[*keys.zip(decode_credentials).flatten]\n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def decoded_auth_token\n @decoded_auth_token ||= AuthToken.decode(http_auth_token)\n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil]\n end", "def decoded_auth_token\n @decoded_auth_token ||= AuthToken.decode(http_auth_token, key_field: :admin_secret_key_base)\n end", "def http_auth_hash; end", "def authenticate()\n\tuser_env = @env[\"Authorization\"] || @env[\"HTTP_AUTHORIZATION\"]\n if user_env\n user = Base64.decode64(user_env[6,user_env.length-6])[/\\w+/]\n\t\treturn user\n else\n \treturn nil\n\tend\nend", "def decoded_auth_token\n @decoded_auth_token ||= AuthToken.decode(http_auth_token)\n end", "def get_auth_data\n user, pass = nil, nil\n # extract authorisation credentials \n if request.env.has_key? 'X-HTTP_AUTHORIZATION' \n # try to get it where mod_rewrite might have put it \n authdata = request.env['X-HTTP_AUTHORIZATION'].to_s.split \n elsif request.env.has_key? 'HTTP_AUTHORIZATION' \n # this is the regular location \n authdata = request.env['HTTP_AUTHORIZATION'].to_s.split \n end \n \n # at the moment we only support basic authentication \n if authdata && authdata[0] == 'Basic' \n user, pass = Base64.decode64(authdata[1]).split(':')[0..1] \n end \n return [user, pass] \n end", "def http_authorization_to_creds\n @auth ||= Rack::Auth::Basic::Request.new request.env\n return unless @auth.provided? && @auth.basic?\n\n @auth.credentials\n end", "def decoded_auth_token\n @decoded_auth_token ||= Authentication::AuthToken.decode(http_auth_header_content)\n end", "def decoded_auth_token\n @decoded_auth_token ||= JsonWebToken.decode(http_auth_header)\n end", "def process_basic_auth(auth)\n case auth\n when String\n self.login, self.password = auth.split(':', 2)\n when Hash\n self.login = auth[:login]\n self.password = auth[:password]\n end\n end", "def credentials\n @credentials ||= begin\n txt = ::Base64.decode64(header.params || '')\n txt.split(/:/, 2)\n end\n end", "def http_auth_hash\n keys = [http_authentication_key, :ip_address]\n Hash[*keys.zip(decode_credentials).flatten]\n end", "def unpack_challenge(authenticate)\n if authenticate =~ /Basic\\srealm=\\\"([^\\\"]*)\\\"/\n return Regexp.last_match[1]\n else\n if authenticate =~ /^Basic/\n fail(UnwellformedHeader, \"Can't parse the WWW-Authenticate header, it's probably not well formed\")\n else\n fail(ArgumentError, 'HTTPAuth::Basic can only unpack Basic Authentication headers')\n end\n end\n end", "def credentials(authorization, request); end", "def process_basic_auth(auth)\n case auth\n when String\n self.username, self.password = auth.split(':', 2)\n when Hash\n self.username = auth[:username]\n self.password = auth[:password]\n end\n end", "def authorization_hash\n Base64.encode64(\"#{BASIC_AUTH.fetch(:username)}:#{BASIC_AUTH.fetch(:password)}\").strip\n end", "def credentials\n auth_hash['credentials']\n end", "def parse(www_authenticate); end", "def decoded_token\n if auth_header\n # label token from the header of the request, the first word will be Bearer by convention\n # If you send in JUST the token as your Authorization you won't need the split\n token = auth_header.split(' ')[1]\n begin\n # decode the token with your secret password/phrase\n # This sequence is important to have the true and, for now, this algorithm\n # You can look into what they mean on your own, but just know they help JWT stuff work.\n JWT.decode(token, \"put your secret password here\", true, algorithm: 'HS256')\n rescue JWT::DecodeError\n nil\n end\n end\n end", "def decoded_auth_token\r\n result = Token::Decode.call(token: auth_token)\r\n add_error!(result.errors) if result.failure?\r\n result.decoded.first.deep_symbolize_keys\r\n end", "def decode_auth_token\n return nil unless verify_header\n\n JsonWebToken.decode_token(verify_header)\n end", "def http_auth_login\n # FIXME: Implement\n end", "def auth_code\n unescape params['x_auth_code']\n end", "def authenticate_user\n jwt=cookies.signed[:jwt]\n decode_jwt(jwt) \n end", "def auth_scheme; end", "def decoded_token\n if auth_header\n token = auth_header.split(' ')[1]\n begin\n JWT.decode(token, 'yourSecret', true, algorithm: 'HS256')\n rescue JWT::DecodeError\n nil\n end\n end\n end", "def auth\n @auth ||= Hash.new\n\n if !@auth[:username] && @headers['Authorization']\n str = Base64.decode64 @headers['Authorization'].split[1]\n username, password = str.split(\":\", 2)\n @auth = {:username => username, :password => password}.merge @auth\n end\n\n @auth\n end", "def credentials_for(uri, realm); end", "def get_credentials\n Rails.logger.info(\"get_credentials\")\n if request.params['message']\n if request.params['message'] == \"\"\n error = \"Unknown Error\"\n else\n begin\n error = File.read(@error_pages[request.params['message']])\n rescue Exception => e\n error = \"Error: \" + request.params['message']\n end\n end\n end\n aem = AuthenticationErrorMessage.new(error)\n html = ERB.new(File.read(@login_page)) # Read every time - allows for changes while running\n res = html.result(aem.get_binding)\n Rack::Response.new(res).finish\n end", "def custom_http_auth_scheme\n @custom_http_auth_scheme.to_s\n end", "def authentication_information\n password.nil? ?\n { :method => :anonymous } :\n { :method => :simple, :username => username, :password => password }\n end", "def auth_token\n Auth.decode(header_token)\n end", "def capable_plain_auth?; end", "def login_using_basic_auth\n @request.env['HTTP_AUTHENTICATION'] = ActionController::HttpAuthentication::Basic.encode_credntials(\"\", \"\")\nend", "def decoded_token\n bearer, token = request.authorization.to_s.split\n\n if bearer == \"Bearer\"\n JWT.decode(token, Rails.application.secrets.secret_key_base, true, { algorithm: 'HS256' }).first\n else\n {}\n end\n end", "def form_credentials\n {\n username: @username,\n password: @password,\n }\n end", "def get_auth_tkt_user_data\n cookie_decoded = Base64.decode64(cookies[:auth_tkt])\n return cookie_decoded.split('!')[2]\n end", "def authentication\n {:username => @username, :password => @password}\n end", "def http_auth_token\n auth_token = request.env[\"HTTP_AUTHORIZATION\"]\n auth_token.split(\" \").last if auth_token.present? && auth_token.split(\" \").first.downcase == \"bearer\"\n end", "def auth_hash\n request.env['omniauth.auth'].symbolize_keys!\n end", "def decoded_token\n if token_from_cookie\n token= token_from_cookie\n # byebug\n begin\n JWT.decode(token, Rails.application.credentials.jwt_token, true, algorithm: \"HS256\")\n # JWT.decode => [{ \"user_id\"=>\"2\" }, { \"alg\"=>\"HS256\" }]\n rescue JWT::DecodeError\n nil\n end\n end\n end", "def params_auth_hash; end", "def with_authentication_hash(auth_type, auth_values); end", "def auth_hash\n # raise request.env['omniauth.auth'].to_yaml\n request.env[\"omniauth.auth\"]\n end", "def decoded_token\n if auth_header\n # Removed token = auth_header.split(' ')[1] here\n begin\n JWT.decode(auth_header, ENV[\"SECRET\"], true, algorithm: 'HS256')\n rescue JWT::DecodeError\n nil\n end\n end\n end", "def valid_for_http_auth?; end", "def auth\n Hash['type' => @auth_type,\n 'username' => @user,\n 'password' => @password]\n end", "def http_auth_token\n request.headers['Authorization']&.split(' ')&.last\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def auth_hash\n request.env['omniauth.auth']\n end", "def decoded_token\n if auth_header\n token = auth_header.split(' ')[1]\n begin\n token = JWT.decode token, Rails.application.credentials.jwt_secret,\n true,\n { algorithm: 'HS256' }\n token&.first['jti']\n rescue JWT::DecodeError\n nil\n end\n end\n end", "def http_login(username, password)\n @request.env['HTTP_AUTHORIZATION'] = \"Basic #{Base64.encode64(username << ':' << password)}\"\n end", "def auth\n if (!@auth || !@auth[:username]) && @headers['Authorization'] &&\n @headers['Authorization'] !~ /^OAuth\\s/\n\n str = Base64.decode64 @headers['Authorization'].split[1]\n username, password = str.split(\":\", 2)\n @auth = {\n :username => username,\n :password => password\n }.merge(@auth || {})\n end\n\n @auth\n end", "def initialize(url)\n url = \"https://#{url}\" unless url.include?(\"://\")\n @uri = URI.parse(url)\n @username = @uri.user\n @password = @uri.password\n @password = File.read(CGI.unescape(@password)) if @username == \"_json_key\"\n end", "def credentials\n @credentials ||= params.unpack1('m*').split(':', 2)\n end", "def basic_auth\n {\n username: @username,\n password: @password\n }\n end", "def authenticate_with_http_digest(realm = T.unsafe(nil), &password_procedure); end", "def login_from_client\n return nil unless params[:auth_client] && \n params[:auth_client] == \"iphone\" &&\n params[:auth_id] &&\n params[:auth_secret] \n\n auth_secret_index = request.url =~ /&auth_secret/\n signature = Digest::MD5.hexdigest \"--#{CONFIG[:iphone_salt]}\"\\\n \"--#{request.url.slice(0,auth_secret_index)}\"\n\n return nil unless signature == params[:auth_secret].downcase || /\\/auth/ === request.url\n\n User.find Cryptography.deobfuscate(params[:auth_id])\n rescue\n nil\n end", "def http_auth?; end", "def credentials_for uri, realm\n uri = URI uri unless URI === uri\n\n uri += '/'\n uri.user = nil\n uri.password = nil\n\n realms = @auth_accounts[uri]\n\n realms[realm] || realms[nil] || @default_auth\n end", "def sanitize_credentials\n if params[:user_session]\n params[:user_session][:login].strip!\n params[:user_session][:password].strip!\n end\n end", "def sanitize_credentials\n if params[:user_session]\n params[:user_session][:login].strip!\n params[:user_session][:password].strip!\n end\n end", "def authorization_hash\n {Authorization: \"Basic #{Base64.strict_encode64(\"#{@login}:#{@password}\")}\"}\n end", "def normalized_password\n URI.encode(CGI.unescape(password), ENCODE_PASSWORD).force_encoding(Encoding::UTF_8) if password\n end", "def authentication_token\n if env && env['HTTP_AUTHORIZATION']\n env['HTTP_AUTHORIZATION'].split(\" \").last\n end\n end", "def auth(value); end", "def auth_credentials\n auth = Rack::Auth::Basic::Request.new(request.env)\n auth.provided? && auth.basic? ? auth.credentials : [nil,nil]\n end", "def request_http_digest_authentication(realm = T.unsafe(nil), message = T.unsafe(nil)); end", "def request_authenticity_tokens; end", "def http_auth_token\n @http_auth_token ||= if request.headers['Authorization'].present?\n request.headers['Authorization'].split(' ').last\n end\n end", "def auth_cookie\n cookies[:auth]\n end", "def parse_twitter_credentials(response_data)\n account_data = NSString.alloc.initWithData(response_data, encoding:NSUTF8StringEncoding)\n params = {}\n\n account_data.split('&').each do |param|\n key, value = param.split('=')\n params[key] = value\n end\n\n # This is super fragile error handling, but basically check that the token and token secret are there.\n # If not, return the result that Twitter returned.\n if params['oauth_token_secret'] && params['oauth_token']\n params\n else\n { 'error' => account_data }\n end\n end", "def handle_auth data\n CERTIFICATE.to_pem\n end", "def authenticate_with_http_basic\n nil\n end", "def authentication_type; end", "def credentials\n params.values_at('username', 'password')\n end", "def auth_info\n params[auth_param] || {}\n end", "def auth_for_url(url)\n self.hr_config.get_for_url(url, :auth)\n end", "def credentials\n { :username => @email, :password => @password }\n end", "def split_userinfo(ui)\n return nil, nil unless ui\n user, password = ui.split(':', 2)\n\n return user, password\n end", "def with_uri_credentials(uri)\n if uri.user and uri.password\n yield(Utils.unescape(uri.user), Utils.unescape(uri.password))\n end\n end", "def authorize_request(request)\n user = Rails.application.secrets.service_login\n pw = Rails.application.secrets.service_password\n request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)\n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == ENV['USERNAMEV'] && password == ENV['PASSWORDV'] \n end \n end", "def get_auth_code()\n return @RESPONSE_HASH['AUTH_CODE']\n end", "def process_auth\n return if username.empty? || password.empty?\n \"#{username}:#{password}\"\n end", "def get_token_from_auth_data(auth_data)\n auth_data.split(\" \")[1]\nend" ]
[ "0.7316356", "0.7316356", "0.7054831", "0.68088424", "0.6752107", "0.6752107", "0.67363393", "0.6656258", "0.6628075", "0.6578698", "0.657107", "0.6567258", "0.65596193", "0.65581816", "0.65177447", "0.6367539", "0.6345176", "0.6282231", "0.6227451", "0.6217617", "0.6178514", "0.61765283", "0.6169316", "0.61675996", "0.61530775", "0.6149764", "0.61094147", "0.6058448", "0.605831", "0.602515", "0.59278196", "0.5901835", "0.5887521", "0.5873151", "0.5858389", "0.5854612", "0.5839555", "0.58225954", "0.5820758", "0.5799582", "0.579273", "0.5775956", "0.5773333", "0.57636636", "0.5751197", "0.5750578", "0.5749631", "0.5743296", "0.5741403", "0.57105166", "0.5708013", "0.5692401", "0.5669338", "0.5648469", "0.5648069", "0.56441385", "0.56393236", "0.56136185", "0.56052375", "0.56052375", "0.56052375", "0.56052375", "0.56052375", "0.56052375", "0.5599973", "0.55958325", "0.55938303", "0.557508", "0.5556421", "0.5551612", "0.55514175", "0.5549996", "0.55455583", "0.5542683", "0.55395", "0.55395", "0.55344576", "0.55127794", "0.5506298", "0.55047727", "0.5504407", "0.5486496", "0.54856294", "0.5482403", "0.54784286", "0.54743963", "0.5469597", "0.5469413", "0.5468494", "0.5466195", "0.5465235", "0.5450838", "0.544679", "0.5433618", "0.54287475", "0.5424025", "0.5420927", "0.5416722", "0.5410849", "0.54056257" ]
0.7933103
0