refactor: fix password auth
refactor: move tabs around
This commit is contained in:
parent
316663be32
commit
e397bc884b
17 changed files with 49 additions and 26 deletions
|
@ -79,7 +79,7 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
|
|||
});
|
||||
}
|
||||
|
||||
const verified = await bcrypt.compare(`${password_hash}${password_entry.salt}`, password_entry.hash);
|
||||
const verified = await bcrypt.compare(password_hash, password_entry.hash);
|
||||
|
||||
if (!verified) {
|
||||
return Response.json({
|
||||
|
|
|
@ -106,13 +106,12 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
|
|||
|
||||
await USERS.create(user);
|
||||
|
||||
const salt = await bcrypt.genSalt();
|
||||
const hashed_password_value = await bcrypt.hash(password_hash, salt);
|
||||
// automatically salted
|
||||
const hashed_password_value = await bcrypt.hash(password_hash);
|
||||
|
||||
const password_entry: PASSWORD_ENTRY = {
|
||||
user_id: user.id,
|
||||
hash: hashed_password_value,
|
||||
salt,
|
||||
timestamps: {
|
||||
created: now,
|
||||
updated: now
|
||||
|
|
3
public/tabs/calendar/README.md
Normal file
3
public/tabs/calendar/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# calendar
|
||||
|
||||
The calendar should help people coordinate events.
|
|
@ -10,5 +10,7 @@
|
|||
><div class="icon calendar"></div>
|
||||
<div class="label">Calendar</div></label
|
||||
>
|
||||
<div class="tab-content">This is the calendar tab.</div>
|
||||
<div class="tab-content">
|
||||
<!-- #include file="./README.md" -->
|
||||
</div>
|
||||
</div>
|
3
public/tabs/exchange/README.md
Normal file
3
public/tabs/exchange/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# exchange
|
||||
|
||||
The exchange should help people find goods and trade.
|
|
@ -10,5 +10,7 @@
|
|||
><div class="icon exchange"></div>
|
||||
<div class="label">Exchange</div></label
|
||||
>
|
||||
<div class="tab-content">This is the exchange tab.</div>
|
||||
<div class="tab-content">
|
||||
<!-- #include file="./README.md" -->
|
||||
</div>
|
||||
</div>
|
3
public/tabs/home/README.md
Normal file
3
public/tabs/home/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Home
|
||||
|
||||
This tab should show notifications and an overview.
|
|
@ -11,5 +11,7 @@
|
|||
<div class="icon home"></div>
|
||||
<div class="label">Home</div>
|
||||
</label>
|
||||
<div class="tab-content">This is the home tab.</div>
|
||||
<div class="tab-content">
|
||||
<!-- #include file="./README.md" -->
|
||||
</div>
|
||||
</div>
|
3
public/tabs/resources/README.md
Normal file
3
public/tabs/resources/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Resources
|
||||
|
||||
Resources should be a wiki for organizing community knowledge.
|
|
@ -10,5 +10,5 @@
|
|||
><div class="icon resources"></div>
|
||||
<div class="label">Resources</div></label
|
||||
>
|
||||
<div class="tab-content">This is the resources tab.</div>
|
||||
<div class="tab-content"><!-- #include file="./README.md" --></div>
|
||||
</div>
|
|
@ -126,11 +126,11 @@
|
|||
</style>
|
||||
|
||||
<div class="tabs">
|
||||
<!-- #include file="./home.html" -->
|
||||
<!-- #include file="./home/home.html" -->
|
||||
<!-- #include file="./talk/talk.html" -->
|
||||
<!-- #include file="./exchange.html" -->
|
||||
<!-- #include file="./work.html" -->
|
||||
<!-- #include file="./resources.html" -->
|
||||
<!-- #include file="./calendar.html" -->
|
||||
<!-- #include file="./profile.html" -->
|
||||
<!-- #include file="./exchange/exchange.html" -->
|
||||
<!-- #include file="./resources/resources.html" -->
|
||||
<!-- #include file="./calendar/calendar.html" -->
|
||||
<!-- #include file="./work/work.html" -->
|
||||
<!-- #include file="./profile/profile.html" -->
|
||||
</div>
|
||||
|
|
8
public/tabs/work/README.md
Normal file
8
public/tabs/work/README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Work
|
||||
|
||||
This tab should help people find and list work, but without being shitty:
|
||||
|
||||
- Make requirements favor users
|
||||
- Salary required
|
||||
- Location required
|
||||
- Discussions available on listings without poster's control
|
|
@ -10,5 +10,5 @@
|
|||
><div class="icon work"></div>
|
||||
<div class="label">Work</div>
|
||||
</label>
|
||||
<div class="tab-content">This is the work tab.</div>
|
||||
<div class="tab-content"><!-- #include file="./README.md" --></div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue