56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
# File 'lib/power_api/generator_helper/simple_token_auth_helper.rb', line 56
def simple_token_auth_initializer_tpl
" SimpleTokenAuthentication.configure do |config|\n # Configure the session persistence policy after a successful sign in,\n # in other words, if the authentication token acts as a signin token.\n # If true, user is stored in the session and the authentication token and\n # email may be provided only once.\n # If false, users must provide their authentication token and email at every request.\n # config.sign_in_token = false\n\n # Configure the name of the HTTP headers watched for authentication.\n #\n # Default header names for a given token authenticatable entity follow the pattern:\n # { entity: { authentication_token: 'X-Entity-Token', email: 'X-Entity-Email'} }\n #\n # When several token authenticatable models are defined, custom header names\n # can be specified for none, any, or all of them.\n #\n # Note: when using the identifiers options, this option behaviour is modified.\n # Please see the example below.\n #\n # Examples\n #\n # Given User and SuperAdmin are token authenticatable,\n # When the following configuration is used:\n # `config.header_names = { super_admin: { authentication_token: 'X-Admin-Auth-Token' } }`\n # Then the token authentification handler for User watches the following headers:\n # `X-User-Token, X-User-Email`\n # And the token authentification handler for SuperAdmin watches the following headers:\n # `X-Admin-Auth-Token, X-SuperAdmin-Email`\n #\n # When the identifiers option is set:\n # `config.identifiers = { super_admin: :phone_number }`\n # Then both the header names identifier key and default value are modified accordingly:\n # `config.header_names = { super_admin: { phone_number: 'X-SuperAdmin-PhoneNumber' } }`\n #\n # config.header_names = { user: { authentication_token: 'X-User-Token', email: 'X-User-Email' } }\n\n # Configure the name of the attribute used to identify the user for authentication.\n # That attribute must exist in your model.\n #\n # The default identifiers follow the pattern:\n # { entity: 'email' }\n #\n # Note: the identifer must match your Devise configuration,\n # see https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address#tell-devise-to-use-username-in-the-authentication_keys\n #\n # Note: setting this option does modify the header_names behaviour,\n # see the header_names section above.\n #\n # Example:\n #\n # `config.identifiers = { super_admin: 'phone_number', user: 'uuid' }`\n #\n # config.identifiers = { user: 'email' }\n\n # Configure the Devise trackable strategy integration.\n #\n # If true, tracking is disabled for token authentication: signing in through\n # token authentication won't modify the Devise trackable statistics.\n #\n # If false, given Devise trackable is configured for the relevant model,\n # then signing in through token authentication will be tracked as any other sign in.\n #\n # config.skip_devise_trackable = true\n end\n INITIALIZER\nend\n"
|