mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-24 07:15:35 +00:00
Doh!
This commit is contained in:
@@ -34,7 +34,6 @@ export function authSetup(app) {
|
|||||||
|
|
||||||
app.post('/auth/signup', async(req, res, next) => {
|
app.post('/auth/signup', async(req, res, next) => {
|
||||||
try {
|
try {
|
||||||
debugger
|
|
||||||
const { username, email, password } = req.body;
|
const { username, email, password } = req.body;
|
||||||
|
|
||||||
const userExists = db.find('username', username);
|
const userExists = db.find('username', username);
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
<h1>You are now logged in!</h1>
|
<h1>You are now logged in!</h1>
|
||||||
|
|
||||||
<figure>
|
|
||||||
{#if $user.username === 'general-zod'}
|
{#if $user.username === 'general-zod'}
|
||||||
|
<figure>
|
||||||
<img alt='Zod' src='zod.png'>
|
<img alt='Zod' src='zod.png'>
|
||||||
<figcaption>Kneel before Zod!</figcaption>
|
<figcaption>Kneel before Zod!</figcaption>
|
||||||
|
</figure>
|
||||||
{:else}
|
{:else}
|
||||||
|
<figure>
|
||||||
<img alt='Super' src='super.png'>
|
<img alt='Super' src='super.png'>
|
||||||
<figcaption>Up, up, and away!</figcaption>
|
<figcaption>Up, up, and away!</figcaption>
|
||||||
{/if}
|
|
||||||
</figure>
|
</figure>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
h1, figure, p {
|
h1, figure {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ export async function post(req, res) {
|
|||||||
res.writeHead(200, { 'Content-Type': 'application/json' });
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||||
try {
|
try {
|
||||||
if (req.body.key === 'username') {
|
if (req.body.key === 'username') {
|
||||||
debugger
|
|
||||||
const found = db.find(req.body.key, req.body.value);
|
const found = db.find(req.body.key, req.body.value);
|
||||||
if (found) {
|
if (found) {
|
||||||
message = 'That username is already in use.';
|
message = 'That username is already in use.';
|
||||||
@@ -18,7 +17,6 @@ export async function post(req, res) {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
message = 'Email is invalid.';
|
message = 'Email is invalid.';
|
||||||
} else {
|
} else {
|
||||||
debugger
|
|
||||||
const found = db.find(req.body.key, req.body.value);
|
const found = db.find(req.body.key, req.body.value);
|
||||||
if (found) {
|
if (found) {
|
||||||
message = 'Email is already taken.';
|
message = 'Email is already taken.';
|
||||||
|
|||||||
Reference in New Issue
Block a user