diff --git a/app/server/src/modules/api/v2/account/login.http b/app/server/src/modules/api/v2/account/login.http index f5b6b7f..2db2734 100644 --- a/app/server/src/modules/api/v2/account/login.http +++ b/app/server/src/modules/api/v2/account/login.http @@ -3,7 +3,7 @@ POST http://localhost:2024/api/v2/account/login Content-Type: application/json { - "ticketId": "53f18071-0327-4c7d-a74f-5d19611295cc", + "ticketId": "aa3b3fc4-3207-44dc-9f87-f0da77665240", "email": "pagoru@gmail.com", "password": "123456Abc*", diff --git a/app/server/src/modules/api/v2/account/login.request.ts b/app/server/src/modules/api/v2/account/login.request.ts index 844cd37..6137ee1 100644 --- a/app/server/src/modules/api/v2/account/login.request.ts +++ b/app/server/src/modules/api/v2/account/login.request.ts @@ -42,6 +42,7 @@ export const loginRequest: RequestType = { email, ]); + console.log(!accountByEmail); if (!accountByEmail) return Response.json( { status: 403 }, diff --git a/app/server/src/modules/api/v2/account/register.request.ts b/app/server/src/modules/api/v2/account/register.request.ts index 1df4f39..b79b5a5 100644 --- a/app/server/src/modules/api/v2/account/register.request.ts +++ b/app/server/src/modules/api/v2/account/register.request.ts @@ -76,6 +76,7 @@ export const registerRequest: RequestType = { `${verifyUrl}

`, ); + // Every key related to the account is temporary until the account is verified or freed if not await System.db.set( ["accounts", accountId], { diff --git a/app/server/src/modules/api/v2/account/verify.request.ts b/app/server/src/modules/api/v2/account/verify.request.ts index 16ee0e9..b2e19b5 100644 --- a/app/server/src/modules/api/v2/account/verify.request.ts +++ b/app/server/src/modules/api/v2/account/verify.request.ts @@ -2,6 +2,7 @@ import { RequestType } from "shared/types/main.ts"; import { RequestMethod } from "shared/enums/main.ts"; import { System } from "system/main.ts"; import * as bcrypt from "bcrypt"; +import { ACCOUNT_EXPIRE_TIME } from "shared/consts/account.consts.ts"; export const verifyRequest: RequestType = { method: RequestMethod.GET, @@ -57,7 +58,13 @@ export const verifyRequest: RequestType = { delete account.verifyTokensHash; await System.db.delete(["accountsByVerifyId", id]); + await System.db.set(["accounts", account.accountId], account); + await System.db.set(["accountsByEmail", account.email], account.accountId); + await System.db.set( + ["accountsByUsername", account.username.toLowerCase()], + account.accountId, + ); return Response.json( {