Stuff
This commit is contained in:
parent
8b196bf5cf
commit
09da9b47fe
2 changed files with 9 additions and 1 deletions
|
@ -17,10 +17,16 @@ class AccountController extends BaseController
|
||||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
|
||||||
public function registerView() {
|
public function registerView() {
|
||||||
|
if(!env('REGISTER_ENABLED')){
|
||||||
|
return abort(401);
|
||||||
|
}
|
||||||
return view("account.register");
|
return view("account.register");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register(Request $request) {
|
public function register(Request $request) {
|
||||||
|
if(!env('REGISTER_ENABLED')){
|
||||||
|
return abort(401);
|
||||||
|
}
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
'username' => 'required|unique:users|unique:tenants,url|regex:/^[a-z0-9]{8,30}$/i',
|
'username' => 'required|unique:users|unique:tenants,url|regex:/^[a-z0-9]{8,30}$/i',
|
||||||
'email' => 'required|unique:users|email:rfc,dns',
|
'email' => 'required|unique:users|email:rfc,dns',
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
<input name="username" value="{{ old('username') }}" class="form-control" placeholder="Username">
|
<input name="username" value="{{ old('username') }}" class="form-control" placeholder="Username">
|
||||||
<input name="password" type="password" class="form-control" placeholder="Password">
|
<input name="password" type="password" class="form-control" placeholder="Password">
|
||||||
<input type="submit" class="btn btn-outline-success" style="width: 100%" value="Login">
|
<input type="submit" class="btn btn-outline-success" style="width: 100%" value="Login">
|
||||||
|
@if (env('REGISTER_ENABLED'))
|
||||||
<a style="float: right;" href="/register">Register</a>
|
<a style="float: right;" href="/register">Register</a>
|
||||||
|
@endif
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue