This commit is contained in:
Kekskurse 2021-01-12 20:56:51 +01:00
parent 8b196bf5cf
commit 09da9b47fe
2 changed files with 9 additions and 1 deletions

View file

@ -17,10 +17,16 @@ class AccountController extends BaseController
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function registerView() {
if(!env('REGISTER_ENABLED')){
return abort(401);
}
return view("account.register");
}
public function register(Request $request) {
if(!env('REGISTER_ENABLED')){
return abort(401);
}
$validated = $request->validate([
'username' => 'required|unique:users|unique:tenants,url|regex:/^[a-z0-9]{8,30}$/i',
'email' => 'required|unique:users|email:rfc,dns',

View file

@ -16,7 +16,9 @@
<input name="username" value="{{ old('username') }}" class="form-control" placeholder="Username">
<input name="password" type="password" class="form-control" placeholder="Password">
<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>
@endif
</form>
</div>
</div>