9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/generators/devise_otp/install_generator.rb', line 9
def add_configs
content = "\n # ==> Devise OTP Extension\n # Configure OTP extension for devise\n\n # OTP is mandatory, users are going to be asked to\n # enroll OTP the next time they sign in, before they can successfully complete the session establishment.\n # This is the global value, can also be set on each user.\n #config.otp_mandatory = false\n\n # Drift: a window which provides allowance for drift between a user's token device clock\n # (and therefore their OTP tokens) and the authentication server's clock.\n # Expressed in minutes centered at the current time. (Note: it's a number, *NOT* 3.minutes )\n #config.otp_drift_window = 3\n\n # Users that have logged in longer than this time ago, are going to be asked their password\n # (and an OTP challenge, if enabled) before they can see or change their otp informations.\n #config.otp_credentials_refresh = 15.minutes\n\n # Users are given a list of one-time recovery tokens, for emergency access\n # set to false to disable giving recovery tokens.\n #config.otp_recovery_tokens = 10\n\n # The user is allowed to set his browser as \"trusted\", no more OTP challenges will be\n # asked for that browser, for a limited time.\n # set to false to disable setting the browser as trusted\n #config.otp_trust_persistence = 1.month\n\n # The name of the token issuer, to be added to the provisioning\n # url. Display will vary based on token application. (defaults to the Rails application class)\n #config.otp_issuer = 'my_application'\n\n # Custom view path for Devise OTP controllers\n #config.otp_controller_path = 'devise'\n\n CONTENT\n\n inject_into_file \"config/initializers/devise.rb\", content, before: /end[ |\\n]+\\Z/\nend\n"
|