This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
/
recaptcha.php
179 lines (157 loc) · 4.93 KB
/
recaptcha.php
1
2
3
4
5
6
7
8
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
49
50
51
52
53
54
55
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
* Copyright (c) 2017 - present
* LaravelGoogleRecaptcha - recaptcha.php
* author: Roberto Belotti - roby.belotti@gmail.com
* web : robertobelotti.com, github.com/biscolab
* Initial version created on: 12/9/2018
* MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
*/
/**
* To configure correctly please visit https://developers.google.com/recaptcha/docs/start
*/
return [
/**
*
* The site key
* get site key @ www.google.com/recaptcha/admin
*
*/
'api_site_key' => env('RECAPTCHA_SITE_KEY', ''),
/**
*
* The secret key
* get secret key @ www.google.com/recaptcha/admin
*
*/
'api_secret_key' => env('RECAPTCHA_SECRET_KEY', ''),
/**
*
* ReCATCHA version
* Supported: "v2", "invisible", "v3",
*
* get more info @ https://developers.google.com/recaptcha/docs/versions
*
*/
'version' => 'v2',
/**
*
* The curl timout in seconds to validate a recaptcha token
* @since v3.5.0
*
*/
'curl_timeout' => 10,
/**
*
* IP addresses for which validation will be skipped
* IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
*
*/
'skip_ip' => env('RECAPTCHA_SKIP_IP', []),
/**
*
* Default route called to check the Google reCAPTCHA token
* @since v3.2.0
*
*/
'default_validation_route' => 'biscolab-recaptcha/validate',
/**
*
* The name of the parameter used to send Google reCAPTCHA token to verify route
* @since v3.2.0
*
*/
'default_token_parameter_name' => 'token',
/**
*
* The default Google reCAPTCHA language code
* It has no effect with v3
* @see https://developers.google.com/recaptcha/docs/language
* @since v3.6.0
*
*/
'default_language' => null,
/**
*
* The default form ID. Only for "invisible" reCAPTCHA
* @since v4.0.0
*
*/
'default_form_id' => 'biscolab-recaptcha-invisible-form',
/**
*
* Deferring the render can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.
* It has no effect with v3 and invisible
* @see https://developers.google.com/recaptcha/docs/display#explicit_render
* @since v4.0.0
* Supported true, false
*
*/
'explicit' => false,
/**
*
* Set API domain. You can use "www.recaptcha.net" in case "www.google.com" is not accessible.
* (no check will be made on the entered value)
* @see https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
* @since v4.3.0
* Default 'www.google.com' (ReCaptchaBuilder::DEFAULT_RECAPTCHA_API_DOMAIN)
*
*/
'api_domain' => 'www.google.com',
/**
*
* Set `true` when the error message must be null
* @since v5.1.0
* Default false
*
*/
'empty_message' => false,
/**
*
* Set either the error message or the errom message translation key
* @since v5.1.0
* Default 'validation.recaptcha'
*
*/
'error_message_key' => 'validation.recaptcha',
/**
*
* g-recaptcha tag attributes and grecaptcha.render parameters (v2 only)
* @see https://developers.google.com/recaptcha/docs/display#render_param
* @since v4.0.0
*/
'tag_attributes' => [
/**
* The color theme of the widget.
* Supported "light", "dark"
*/
'theme' => 'light',
/**
* The size of the widget.
* Supported "normal", "compact"
*/
'size' => 'normal',
/**
* The tabindex of the widget and challenge.
* If other elements in your page use tabindex, it should be set to make user navigation easier.
*/
'tabindex' => 0,
/**
* The name of your callback function, executed when the user submits a successful response.
* The g-recaptcha-response token is passed to your callback.
* DO NOT SET "biscolabOnloadCallback"
*/
'callback' => null,
/**
* The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
* DO NOT SET "biscolabOnloadCallback"
*/
'expired-callback' => null,
/**
* The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored.
* If you specify a function here, you are responsible for informing the user that they should retry.
* DO NOT SET "biscolabOnloadCallback"
*/
'error-callback' => null,
]
];