Auth logic is completed (signin, signup, logout), Added: Middlewares, RequireAuth middleware
This commit is contained in:
@ -1,9 +1,21 @@
|
||||
<section class="signin">
|
||||
<form>
|
||||
<label for="username">Username</label>
|
||||
<input type="text" name="username" id="username">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password">
|
||||
<input type="submit" value="Sign In" id="submit-signin">
|
||||
</form>
|
||||
<?php if ($this->get('error')): ?>
|
||||
<div class="error"><?= $this->get('error') ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="/auth/signin" method="POST">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" name="email" id="email" value="<?= htmlspecialchars($_POST['email'] ?? '') ?>" required>
|
||||
<?php if (isset($this->get('validationErrors')['email'])): ?>
|
||||
<small class="error"><?= $this->get('validationErrors')['email'] ?></small>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="password">Password</label>
|
||||
<input type="password" name="password" id="password" required>
|
||||
<?php if (isset($this->get('validationErrors')['password'])): ?>
|
||||
<small class="error"><?= $this->get('validationErrors')['password'] ?></small>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="submit" value="Sign In">
|
||||
</form>
|
||||
</section>
|
||||
|
@ -0,0 +1 @@
|
||||
<h1>Welcome <?= $_SESSION['user']['username']?>!</h1>
|
||||
|
@ -8,6 +8,7 @@
|
||||
<header>
|
||||
<a href="/auth/signin">Log In</a>
|
||||
<a href="/auth/signup">Sign Up</a>
|
||||
<a href="/auth/logout">Log Out</a>
|
||||
</header>
|
||||
<section class="content">
|
||||
<?= $content ?>
|
||||
|
@ -1,4 +0,0 @@
|
||||
<header>
|
||||
<a href="/signin">Log In</a>
|
||||
<a href="/signup">Sign Up</a>
|
||||
</header>
|
Reference in New Issue
Block a user