mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-07-18 13:43:51 +03:00
Compare commits
1 Commits
v0.27.4
...
captcha_ex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c49454da28 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -5,10 +5,10 @@ Homestead.yaml
|
||||
.idea
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/public/dist/*.map
|
||||
/public/dist
|
||||
/public/plugins
|
||||
/public/css/*.map
|
||||
/public/js/*.map
|
||||
/public/css
|
||||
/public/js
|
||||
/public/bower
|
||||
/public/build/
|
||||
/storage/images
|
||||
|
||||
@@ -13,6 +13,7 @@ use BookStack\Exceptions\SocialSignInException;
|
||||
use BookStack\Exceptions\UserRegistrationException;
|
||||
use BookStack\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -115,6 +116,20 @@ class RegisterController extends Controller
|
||||
$this->checkRegistrationAllowed();
|
||||
$this->validator($request->all())->validate();
|
||||
|
||||
$captcha = $request->get('g-recaptcha-response');
|
||||
$resp = (new Client())->post('https://www.google.com/recaptcha/api/siteverify', [
|
||||
'form_params' => [
|
||||
'response' => $captcha,
|
||||
'secret' => '%%secret_key%%',
|
||||
]
|
||||
]);
|
||||
$respBody = json_decode($resp->getBody());
|
||||
if (!$respBody->success) {
|
||||
return redirect()->back()->withInput()->withErrors([
|
||||
'g-recaptcha-response' => 'Did not pass captcha',
|
||||
]);
|
||||
}
|
||||
|
||||
$userData = $request->all();
|
||||
return $this->registerUser($userData);
|
||||
}
|
||||
|
||||
27
public/dist/app.js
vendored
27
public/dist/app.js
vendored
File diff suppressed because one or more lines are too long
2785
public/dist/export-styles.css
vendored
2785
public/dist/export-styles.css
vendored
File diff suppressed because it is too large
Load Diff
36
public/dist/print-styles.css
vendored
36
public/dist/print-styles.css
vendored
@@ -1,36 +0,0 @@
|
||||
:root {
|
||||
--color-primary: #206ea7;
|
||||
--color-primary-light: rgba(32,110,167,0.15);
|
||||
--color-page: #206ea7;
|
||||
--color-page-draft: #7e50b1;
|
||||
--color-chapter: #af4d0d;
|
||||
--color-book: #077b70;
|
||||
--color-bookshelf: #a94747; }
|
||||
|
||||
header {
|
||||
display: none; }
|
||||
|
||||
html, body {
|
||||
font-size: 12px;
|
||||
background-color: #FFF; }
|
||||
|
||||
.page-content {
|
||||
margin: 0 auto; }
|
||||
|
||||
.print-hidden {
|
||||
display: none !important; }
|
||||
|
||||
.tri-layout-container {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-areas: "b";
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
display: block; }
|
||||
|
||||
.card {
|
||||
box-shadow: none; }
|
||||
|
||||
.content-wrap.card {
|
||||
padding-left: 0;
|
||||
padding-right: 0; }
|
||||
|
||||
4430
public/dist/styles.css
vendored
4430
public/dist/styles.css
vendored
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,14 @@
|
||||
@include('form.password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
<div class="g-recaptcha" data-sitekey="%%site_key%%"></div>
|
||||
@if($errors->has('g-recaptcha-response'))
|
||||
<div class="text-neg text-small">{{ $errors->first('g-recaptcha-response') }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="grid half collapse-xs gap-xl v-center mt-m">
|
||||
<div class="text-small">
|
||||
<a href="{{ url('/login') }}">{{ trans('auth.already_have_account') }}</a>
|
||||
|
||||
Reference in New Issue
Block a user