Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Server side reset password #594

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ REDIS_PASS=A3vniod98Zbuvn9u5


# ================================================
# Tip: use mailtrap.io for local development
[email protected]

SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
# ================================================
# Database
# ================================================
Expand Down
101 changes: 53 additions & 48 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ 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}
EMAIL_SENDING_ADDRESS: ${EMAIL_SENDING_ADDRESS}
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 +200,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 +276,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
5 changes: 5 additions & 0 deletions docker-compose.source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ 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}
EMAIL_SENDING_ADDRESS: ${EMAIL_SENDING_ADDRESS}
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
restart: unless-stopped
ports:
- 3000:3000
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ 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}
EMAIL_SENDING_ADDRESS: ${EMAIL_SENDING_ADDRESS}
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
Loading