Skip to content

Commit

Permalink
feat: Server side reset password
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid Flih authored and Rachid Flih committed Jul 31, 2024
1 parent fd19b51 commit 5d1c081
Show file tree
Hide file tree
Showing 12 changed files with 436 additions and 970 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ REDIS_PASS=A3vniod98Zbuvn9u5


# ================================================

# Tip: use mailtrap.io for local development
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
# ================================================
# Database
# ================================================
Expand Down
100 changes: 52 additions & 48 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ services:
HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET: ${HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET}
IRONCLAD_TICKETING_CLOUD_CLIENT_ID: ${IRONCLAD_TICKETING_CLOUD_CLIENT_ID}
IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET: ${IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}

restart: unless-stopped
ports:
Expand Down Expand Up @@ -195,47 +199,47 @@ services:
retries: 5
start_period: 10s

webapp-nextjs:
build:
dockerfile: ./apps/webapp/Dockerfile.dev
context: ./
args:
VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
environment:
NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
NEXT_PUBLIC_MAGIC_LINK_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
NEXT_PUBLIC_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
NEXT_PUBLIC_REDIRECT_WEBHOOK_INGRESS: ${REDIRECT_TUNNEL_INGRESS}
restart: unless-stopped
ports:
- 80:8090
depends_on:
api:
condition: service_healthy
volumes:
- .:/app
networks:
- backend
- frontend
# webapp-nextjs:
# build:
# dockerfile: ./apps/webapp/Dockerfile.dev
# context: ./
# args:
# VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# environment:
# NEXT_PUBLIC_DISTRIBUTION: ${DISTRIBUTION}
# NEXT_PUBLIC_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# NEXT_PUBLIC_MAGIC_LINK_DOMAIN: ${NEXT_PUBLIC_MAGIC_LINK_DOMAIN}
# NEXT_PUBLIC_WEBAPP_DOMAIN: ${NEXT_PUBLIC_WEBAPP_DOMAIN}
# NEXT_PUBLIC_REDIRECT_WEBHOOK_INGRESS: ${REDIRECT_TUNNEL_INGRESS}
# restart: unless-stopped
# ports:
# - 80:8090
# depends_on:
# api:
# condition: service_healthy
# volumes:
# - .:/app
# networks:
# - backend
# - frontend

magic-link-frontend:
build:
dockerfile: ./apps/magic-link/Dockerfile.dev
context: ./
args:
VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
restart: always
ports:
- 81:5173
depends_on:
api:
condition: service_healthy
networks:
- backend
- frontend
volumes:
- .:/app
# magic-link-frontend:
# build:
# dockerfile: ./apps/magic-link/Dockerfile.dev
# context: ./
# args:
# VITE_BACKEND_DOMAIN: ${NEXT_PUBLIC_BACKEND_DOMAIN}
# restart: always
# ports:
# - 81:5173
# depends_on:
# api:
# condition: service_healthy
# networks:
# - backend
# - frontend
# volumes:
# - .:/app

# pgadmin:
# image: dpage/pgadmin4
Expand Down Expand Up @@ -271,14 +275,14 @@ services:
# condition: service_healthy
# network_mode: "host"

docs:
build:
dockerfile: ./Dockerfile.dev
context: ./docs/
ports:
- 911:3000
volumes:
- ./docs/:/app
# docs:
# build:
# dockerfile: ./Dockerfile.dev
# context: ./docs/
# ports:
# - 911:3000
# volumes:
# - ./docs/:/app

volumes:
local_pgdata:
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ services:
HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET: ${HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET}
IRONCLAD_TICKETING_CLOUD_CLIENT_ID: ${IRONCLAD_TICKETING_CLOUD_CLIENT_ID}
IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET: ${IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
restart: unless-stopped
ports:
- 3000:3000
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ services:
HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET: ${HELPSCOUT_TICKETING_CLOUD_CLIENT_SECRET}
IRONCLAD_TICKETING_CLOUD_CLIENT_ID: ${IRONCLAD_TICKETING_CLOUD_CLIENT_ID}
IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET: ${IRONCLAD_TICKETING_CLOUD_CLIENT_SECRET}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
restart: unless-stopped
ports:
- 3000:3000
Expand Down
1 change: 1 addition & 0 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"js-yaml": "^4.1.0",
"jwt-decode": "^4.0.0",
"nestjs-pino": "^3.5.0",
"nodemailer": "^6.9.14",
"openai": "^4.38.5",
"passport": "^0.6.0",
"passport-headerapikey": "^1.2.2",
Expand Down
80 changes: 49 additions & 31 deletions packages/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ datasource db {
model users {
id_user String @id(map: "pk_users") @db.Uuid
identification_strategy String
email String?
email String? @unique(map: "unique_email")
password_hash String?
first_name String
last_name String
id_stytch String? @unique(map: "force_stytch_id_unique")
created_at DateTime @default(now()) @db.Timestamp(6)
modified_at DateTime @default(now()) @db.Timestamp(6)
reset_token String?
reset_token_expires_at DateTime? @db.Timestamptz(6)
api_keys api_keys[]
projects projects[]
}
Expand Down Expand Up @@ -1637,37 +1639,44 @@ model acc_vendor_credits {
}

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
model ecom_customer_addresses {
id_ecom_customer_address String @id(map: "pk_ecom_customer_addresses") @db.Uuid
address_type String?
line_1 String?
line_2 String?
street_1 String?
street_2 String?
city String?
state String?
postal_code String?
country String?
id_ecom_customer String @db.Uuid
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
ecom_customers ecom_customers @relation(fields: [id_ecom_customer], references: [id_ecom_customer], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_customer_customeraddress")
model ecom_addresses {
id_ecom_address String @id(map: "pk_ecom_customer_addresses") @db.Uuid
address_type String?
street_1 String?
street_2 String?
city String?
state String?
postal_code String?
country String?
id_ecom_customer String @db.Uuid
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
remote_deleted Boolean
id_ecom_order String @db.Uuid
ecom_customers ecom_customers @relation(fields: [id_ecom_customer], references: [id_ecom_customer], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_customer_customeraddress")
ecom_orders ecom_orders @relation(fields: [id_ecom_order], references: [id_ecom_order], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_order_address")
@@index([id_ecom_customer], map: "fk_index_ecom_customer_customeraddress")
@@index([id_ecom_order], map: "fk_index_fk_ecom_order_address")
}

model ecom_customers {
id_ecom_customer String @id(map: "pk_ecom_customers") @db.Uuid
remote_id String?
email String?
first_name String?
last_name String?
phone_number String?
modifed_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
id_connection String @db.Uuid
ecom_customer_addresses ecom_customer_addresses[]
ecom_orders ecom_orders[]
id_ecom_customer String @id(map: "pk_ecom_customers") @db.Uuid
remote_id String?
email String?
first_name String?
last_name String?
phone_number String?
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
id_connection String @db.Uuid
remote_deleted Boolean
ecom_addresses ecom_addresses[]
ecom_orders ecom_orders[]
}

model ecom_fulfilment_orders {
id_ecom_fulfilment_order String @id(map: "pk_ecom_fulfilment_order") @db.Uuid
}

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
Expand All @@ -1680,13 +1689,18 @@ model ecom_fulfilments {
remote_id String?
id_ecom_order String? @db.Uuid
id_connection String @db.Uuid
modifed_at DateTime @db.Timestamptz(6)
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
remote_deleted Boolean
ecom_orders ecom_orders? @relation(fields: [id_ecom_order], references: [id_ecom_order], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_order_fulfilment")
@@index([id_ecom_order], map: "fk_index_ecom_order_fulfilment")
}

model ecom_order_line_items {
id_ecom_order_line_item String @id(map: "pk_106") @db.Uuid
}

model ecom_orders {
id_ecom_order String @id(map: "pk_ecom_orders") @db.Uuid
order_status String?
Expand All @@ -1701,8 +1715,10 @@ model ecom_orders {
remote_id String?
id_ecom_customer String? @db.Uuid
id_connection String @db.Uuid
modifed_at DateTime @db.Timestamptz(6)
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
remote_deleted Boolean
ecom_addresses ecom_addresses[]
ecom_fulfilments ecom_fulfilments[]
ecom_customers ecom_customers? @relation(fields: [id_ecom_customer], references: [id_ecom_customer], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_customer_orders")
Expand All @@ -1721,8 +1737,9 @@ model ecom_product_variants {
weight BigInt?
inventory_quantity BigInt?
id_ecom_product String? @db.Uuid
modifed_at DateTime @db.Timestamptz(6)
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
remote_deleted Boolean
ecom_products ecom_products? @relation(fields: [id_ecom_product], references: [id_ecom_product], onDelete: NoAction, onUpdate: NoAction, map: "fk_ecom_products_variants")
@@index([id_ecom_product], map: "fk_index_ecom_products_variants")
Expand All @@ -1738,8 +1755,9 @@ model ecom_products {
description String?
vendor String?
tags String[]
modifed_at DateTime @db.Timestamptz(6)
modified_at DateTime @db.Timestamptz(6)
created_at DateTime @db.Timestamptz(6)
id_connection String @db.Uuid
remote_deleted Boolean
ecom_product_variants ecom_product_variants[]
}
Loading

0 comments on commit 5d1c081

Please sign in to comment.