app/forms/user_form.rb
# Generates a secure password for a new user based on our password-complexity requirements
Generates a secure password for a new user based on our password-complexity requirements
Generates a secure password for a new user based on our password - complexity requirements
def generate_new_password
    symbols = %w[! " # $ % & ' ( ) * + , - . / : ; < = > ? @ \[ \\ \] ^ _ ` { | } ~]
    chars = ("a".."z").to_a.sample(3) + ("1".."9").to_a.sample(3) + ("A".."Z").to_a.sample(3) + symbols.sample(3)
    chars.shuffle.join
  end
def generate_new_password symbols = %w[ ! " # $ % & ' ( ) * + , - . / : ; < = > ? @  \[  \\  \] ^ _ ` { | } ~ ] chars = ( "a" .. "z" ) . to_a . sample ( 3 ) + ( "1" .. "9" ) . to_a . sample ( 3 ) + ( "A" .. "Z" ) . to_a . sample ( 3 ) + symbols . sample ( 3 ) chars . shuffle . join end
Generates a secure password for a new user based on our password-complexity requirements
Generates a secure password for a new user based on our password - complexity requirements