query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
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 ...
[ "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.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\...
[ "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.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 @wa...
[ "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.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] ...
[ "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.61172...
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]\...
[ "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.6061...
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_att...
[ "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.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 => [:subje...
[ "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.59830...
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_mappi...
[ "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.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_mappi...
[ "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.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_*...
[ "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.5139...
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 # ...
[ "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.56...
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_a...
[ "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.49...
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}...
[ "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.57414...
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_SERIAL...
[ "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.648838...
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.n...
[ "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.690848...
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...
[ "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.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(usernam...
[ "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.554...
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 \...
[ "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.537...
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, valu...
[ "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.5264...
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? || confirmatio...
[ "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.66434...
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 c...
[ "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.6286...
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 ...
[ "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.729094...
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 :...
[ "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.76...
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.genera...
[ "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.6...
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_...
[ "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.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_con...
[ "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.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_reconfirmat...
[ "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.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", "de...
[ "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.6954822...
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.no...
[ "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.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_perio...
[ "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.619...
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.cl...
[ "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.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_require...
[ "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.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.co...
[ "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.704302...
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 ...
[ "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.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_...
[ "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.664...
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_...
[ "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.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_con...
[ "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.670...
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 ...
[ "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.6...
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 = Us...
[ "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.60356...
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 w...
[ "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.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 suc...
[ "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.546821...
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...
[ "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.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_...
[ "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.749133...
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 ...
[ "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.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...
[ "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.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 ema...
[ "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.6695...
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 ...
[ "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.681...
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 )\...
[ "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.65590...
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_passwo...
[ "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.645698...
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 ...
[ "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.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_pas...
[ "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.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 ...
[ "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.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_passwor...
[ "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.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(conf...
[ "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.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 activ...
[ "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.7943...
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 ...
[ "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.5830...
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 ...
[ "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.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 => T...
[ "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.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_...
[ "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.606591...
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", ...
[ "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.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_lock...
[ "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...
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_ret...
[ "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.5...
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", ...
[ "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.67...
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 ret...
[ "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.6932...
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).f...
[ "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.5213368...
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.persist...
[ "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.5...
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?) &&\...
[ "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.648289...
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_...
[ "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.6586...
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...
[ "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.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_a...
[ "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.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[:...
[ "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...
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 ...
[ "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.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_sessi...
[ "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.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_...
[ "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.5620...
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 se...
[ "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.6954...
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 ...
[ "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.712069...
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(:remem...
[ "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....
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 > s...
[ "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.750780...
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 =...
[ "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.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 cre...
[ "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.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?\...
[ "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.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 retur...
[ "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.821302...
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 ...
[ "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.540127...
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...
[ "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.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...
[ "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.6...
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...
[ "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.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(attri...
[ "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.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...
[ "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.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...
[ "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.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 ...
[ "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.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 ...
[ "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.522...
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.ne...
[ "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.59334...
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_au...
[ "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.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_authe...
[ "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.599...
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\...
[ "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.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 pro...
[ "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.671...
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 passwo...
[ "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.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 @pass...
[ "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.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)....
[ "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.5478474...
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($...
[ "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.7933103
0