Commit 8445397d authored by Christian Giupponi's avatar Christian Giupponi

Fix the bug that prevent user to login or register to the site

parent cdad9b6c
......@@ -54,3 +54,13 @@ if (! function_exists('asgard_editor')) {
return view('core::components.textarea-wrapper', compact('fieldName', 'labelName', 'content'));
}
}
if (! function_exists('localize_route')) {
function localize_route($route, $locale = null)
{
$locale = $locale ? : app()->getLocale();
return str_replace(env('APP_URL'), rtrim(env('APP_URL'), '/') . '/' . $locale, route($route));
}
}
\ No newline at end of file
......@@ -13,7 +13,8 @@
<p class="login-box-msg">{{ trans('user::auth.sign in welcome message') }}</p>
@include('partials.notifications')
{!! Form::open(['route' => 'login.post']) !!}
<form method="POST" action="{{localize_route('login.post')}}" accept-charset="UTF-8">
{{csrf_field()}}
<div class="form-group has-feedback {{ $errors->has('email') ? ' has-error' : '' }}">
<input type="email" class="form-control" autofocus
name="email" placeholder="{{ trans('user::auth.email') }}" value="{{ old('email')}}">
......
......@@ -11,7 +11,9 @@
<div class="register-box-body">
<p class="login-box-msg">{{ trans('user::auth.register') }}</p>
@include('partials.notifications')
{!! Form::open(['route' => 'register.post']) !!}
<form method="POST" action="{{localize_route('register.post')}}" accept-charset="UTF-8">
{{csrf_field()}}
<div class="form-group has-feedback {{ $errors->has('email') ? ' has-error has-feedback' : '' }}">
<input type="email" name="email" class="form-control" autofocus
placeholder="{{ trans('user::auth.email') }}" value="{{ old('email') }}">
......
......@@ -13,7 +13,8 @@
<p class="login-box-msg">{{ trans('user::auth.to reset password complete this form') }}</p>
@include('partials.notifications')
{!! Form::open(['route' => 'reset.post']) !!}
<form method="POST" action="{{localize_route('reset.post')}}" accept-charset="UTF-8">
{{csrf_field()}}
<div class="form-group has-feedback {{ $errors->has('email') ? ' has-error' : '' }}">
<input type="email" class="form-control" autofocus
name="email" placeholder="{{ trans('user::auth.email') }}" value="{{ old('email')}}">
......@@ -28,7 +29,7 @@
</button>
</div>
</div>
{!! Form::close() !!}
</form>
<a href="{{ route('login') }}" class="text-center">{{ trans('user::auth.I remembered my password') }}</a>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment