diff --git a/.devcontainer/base/Dockerfile b/.devcontainer/base/Dockerfile
new file mode 100644
index 0000000000..119594bc6f
--- /dev/null
+++ b/.devcontainer/base/Dockerfile
@@ -0,0 +1,16 @@
+FROM mcr.microsoft.com/devcontainers/typescript-node:20-bookworm
+
+ENV SHELL=/bin/bash \
+ DEBIAN_FRONTEND=noninteractive \
+ LANG=C.UTF-8 \
+ LC_ALL=C.UTF-8 \
+ CI=1 \
+ PNPM_HOME=/home/node/.local/share/pnpm \
+ PATH=/home/node/.local/share/pnpm:$PATH
+
+
+RUN apt-get update && \
+ apt-get --no-install-recommends install -y \
+ libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb && \
+ apt-get clean && \
+ corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@9.1.2 --activate
diff --git a/.devcontainer/base/devcontainer.json b/.devcontainer/base/devcontainer.json
new file mode 100644
index 0000000000..187e012e67
--- /dev/null
+++ b/.devcontainer/base/devcontainer.json
@@ -0,0 +1,28 @@
+{
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
+ "name": "devcontainer",
+ "dockerComposeFile": "docker-compose.yml",
+ "service": "devcontainer",
+ "workspaceFolder": "/workspaces",
+ "features": {
+ "ghcr.io/devcontainers/features/go:1": {
+ "version": "1.24"
+ },
+ "ghcr.io/guiyomh/features/golangci-lint:0": {},
+ "ghcr.io/jungaretti/features/make:1": {}
+ },
+ "forwardPorts": [
+ 3000,
+ 3001,
+ 4200,
+ 8080
+ ],
+ "onCreateCommand": "pnpm install -g sass@1.64.1",
+ "customizations": {
+ "jetbrains": {
+ "settings": {
+ "com.intellij:app:HttpConfigurable.use_proxy_pac": true
+ }
+ }
+ }
+}
diff --git a/.devcontainer/base/docker-compose.yml b/.devcontainer/base/docker-compose.yml
new file mode 100644
index 0000000000..d1b26f1a7b
--- /dev/null
+++ b/.devcontainer/base/docker-compose.yml
@@ -0,0 +1,225 @@
+services:
+
+ devcontainer:
+ container_name: devcontainer
+ build:
+ context: .
+ volumes:
+ - ../../:/workspaces:cached
+ - /tmp/.X11-unix:/tmp/.X11-unix:cached
+ - home-dir:/home/node:delegated
+ command: sleep infinity
+ working_dir: /workspaces
+ environment:
+ ZITADEL_DATABASE_POSTGRES_HOST: db
+ ZITADEL_EXTERNALSECURE: false
+
+ db:
+ container_name: db
+ image: postgres:17.0-alpine3.19
+ restart: unless-stopped
+ volumes:
+ - postgres-data:/var/lib/postgresql/data
+ environment:
+ PGUSER: postgres
+ POSTGRES_PASSWORD: postgres
+ healthcheck:
+ test: [ "CMD-SHELL", "pg_isready" ]
+ interval: "10s"
+ timeout: "30s"
+ retries: 5
+ start_period: "20s"
+ ports:
+ - "5432:5432"
+
+ mock-zitadel:
+ container_name: mock-zitadel
+ build:
+ context: ../../apps/login/integration/core-mock
+ ports:
+ - 22220:22220
+ - 22222:22222
+
+ login-integration:
+ container_name: login-integration
+ build:
+ context: ../..
+ dockerfile: build/login/Dockerfile
+ image: "${LOGIN_TAG:-zitadel-login:local}"
+ env_file: ../../apps/login/.env.test
+ network_mode: service:devcontainer
+ environment:
+ NODE_ENV: test
+ PORT: 3001
+ depends_on:
+ mock-zitadel:
+ condition: service_started
+
+ zitadel:
+ image: "${ZITADEL_TAG:-ghcr.io/zitadel/zitadel:v4.0.0-rc.2}"
+ container_name: zitadel
+ command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --config /zitadel.yaml --steps /zitadel.yaml'
+ volumes:
+ - ../../apps/login/acceptance/pat:/pat:delegated
+ - ../../apps/login/acceptance/zitadel.yaml:/zitadel.yaml:cached
+ network_mode: service:devcontainer
+ healthcheck:
+ test:
+ - CMD
+ - /app/zitadel
+ - ready
+ - --config
+ - /zitadel.yaml
+ depends_on:
+ db:
+ condition: "service_healthy"
+
+ configure-login:
+ container_name: configure-login
+ restart: no
+ build:
+ context: ../../apps/login/acceptance/setup
+ dockerfile: ../go-command.Dockerfile
+ entrypoint: "./setup.sh"
+ network_mode: service:devcontainer
+ environment:
+ PAT_FILE: /pat/zitadel-admin-sa.pat
+ ZITADEL_API_URL: http://localhost:8080
+ WRITE_ENVIRONMENT_FILE: /login-env/.env.test.local
+ SINK_EMAIL_INTERNAL_URL: http://sink:3333/email
+ SINK_SMS_INTERNAL_URL: http://sink:3333/sms
+ SINK_NOTIFICATION_URL: http://sink:3333/notification
+ LOGIN_BASE_URL: http://localhost:3000/ui/v2/login/
+ ZITADEL_API_DOMAIN: localhost
+ ZITADEL_ADMIN_USER: zitadel-admin@zitadel.localhost
+ volumes:
+ - ../../apps/login/acceptance/pat:/pat:cached # Read the PAT file from zitadels setup
+ - ../../apps/login:/login-env:delegated # Write the environment variables file for the login
+ depends_on:
+ zitadel:
+ condition: "service_healthy"
+
+ login-acceptance:
+ container_name: login
+ image: "${LOGIN_TAG:-ghcr.io/zitadel/zitadel-login:v4.0.0-rc.2}"
+ network_mode: service:devcontainer
+ volumes:
+ - ../../apps/login/.env.test.local:/env-files/.env:cached
+ depends_on:
+ configure-login:
+ condition: service_completed_successfully
+
+ mock-notifications:
+ container_name: mock-notifications
+ build:
+ context: ../../apps/login/acceptance/sink
+ dockerfile: ../go-command.Dockerfile
+ args:
+ - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
+ environment:
+ PORT: '3333'
+ command:
+ - -port
+ - '3333'
+ - -email
+ - '/email'
+ - -sms
+ - '/sms'
+ - -notification
+ - '/notification'
+ ports:
+ - "3333:3333"
+ depends_on:
+ configure-login:
+ condition: "service_completed_successfully"
+
+ mock-oidcrp:
+ container_name: mock-oidcrp
+ build:
+ context: ../../apps/login/acceptance/oidcrp
+ dockerfile: ../go-command.Dockerfile
+ args:
+ - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
+ network_mode: service:devcontainer
+ environment:
+ API_URL: 'http://localhost:8080'
+ API_DOMAIN: 'localhost'
+ PAT_FILE: '/pat/zitadel-admin-sa.pat'
+ LOGIN_URL: 'http://localhost:3000/ui/v2/login'
+ ISSUER: 'http://localhost:8000'
+ HOST: 'localhost'
+ PORT: '8000'
+ SCOPES: 'openid profile email'
+ volumes:
+ - ../../apps/login/acceptance/pat:/pat:cached
+ depends_on:
+ configure-login:
+ condition: "service_completed_successfully"
+
+ # mock-oidcop:
+ # container_name: mock-oidcop
+ # build:
+ # context: ../../apps/login/acceptance/idp/oidc
+ # dockerfile: ../../go-command.Dockerfile
+ # args:
+ # - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
+ # network_mode: service:devcontainer
+ # environment:
+ # API_URL: 'http://localhost:8080'
+ # API_DOMAIN: 'localhost'
+ # PAT_FILE: '/pat/zitadel-admin-sa.pat'
+ # SCHEMA: 'http'
+ # HOST: 'localhost'
+ # PORT: "8004"
+ # volumes:
+ # - "../apps/login/packages/acceptance/pat:/pat:cached"
+ # depends_on:
+ # configure-login:
+ # condition: "service_completed_successfully"
+
+ mock-samlsp:
+ container_name: mock-samlsp
+ build:
+ context: ../../apps/login/acceptance/samlsp
+ dockerfile: ../go-command.Dockerfile
+ args:
+ - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
+ network_mode: service:devcontainer
+ environment:
+ API_URL: 'http://localhost:8080'
+ API_DOMAIN: 'localhost'
+ PAT_FILE: '/pat/zitadel-admin-sa.pat'
+ LOGIN_URL: 'http://localhost:3000/ui/v2/login'
+ IDP_URL: 'http://localhost:8080/saml/v2/metadata'
+ HOST: 'http://localhost:8001'
+ PORT: '8001'
+ volumes:
+ - "../apps/login/packages/acceptance/pat:/pat:cached"
+ depends_on:
+ configure-login:
+ condition: "service_completed_successfully"
+
+# mock-samlidp:
+# container_name: mock-samlidp
+# build:
+# context: ../../apps/login/acceptance/idp/saml
+# dockerfile: ../../go-command.Dockerfile
+# args:
+# - LOGIN_TEST_ACCEPTANCE_GOLANG_TAG=${LOGIN_TEST_ACCEPTANCE_GOLANG_TAG:-golang:1.24-alpine}
+# network_mode: service:devcontainer
+# environment:
+# API_URL: 'http://localhost:8080'
+# API_DOMAIN: 'localhost'
+# PAT_FILE: '/pat/zitadel-admin-sa.pat'
+# SCHEMA: 'http'
+# HOST: 'localhost'
+# PORT: "8003"
+# volumes:
+# - "../apps/login/packages/acceptance/pat:/pat"
+# depends_on:
+# configure-login:
+# condition: "service_completed_successfully"
+
+volumes:
+ postgres-data:
+ home-dir:
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
deleted file mode 100644
index 5d49f92cf4..0000000000
--- a/.devcontainer/devcontainer.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "zitadel",
- "dockerComposeFile": "docker-compose.yml",
- "service": "devcontainer",
- "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
- "features": {
- "ghcr.io/devcontainers/features/go:1": {
- "version": "1.22"
- },
- "ghcr.io/devcontainers/features/node:1": {},
- "ghcr.io/guiyomh/features/golangci-lint:0": {},
- "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
- "ghcr.io/devcontainers/features/github-cli:1": {},
- "ghcr.io/jungaretti/features/make:1": {}
- },
- "forwardPorts": [
- 3000,
- 4200,
- 8080
- ],
- "onCreateCommand": "npm install -g sass@1.64.1"
-}
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
deleted file mode 100644
index cece28632b..0000000000
--- a/.devcontainer/docker-compose.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-version: '3.8'
-services:
- devcontainer:
- image: mcr.microsoft.com/devcontainers/base:ubuntu
- volumes:
- - ../..:/workspaces:cached
- - /var/run/docker.sock:/var/run/docker.sock
- network_mode: service:db
- command: sleep infinity
- environment:
- ZITADEL_DATABASE_POSTGRES_HOST: db
- ZITADEL_DATABASE_POSTGRES_PORT: 5432
- ZITADEL_DATABASE_POSTGRES_DATABASE: zitadel
- ZITADEL_DATABASE_POSTGRES_USER_USERNAME: zitadel
- ZITADEL_DATABASE_POSTGRES_USER_PASSWORD: zitadel
- ZITADEL_DATABASE_POSTGRES_USER_SSL_MODE: disable
- ZITADEL_DATABASE_POSTGRES_ADMIN_USERNAME: postgres
- ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD: postgres
- ZITADEL_DATABASE_POSTGRES_ADMIN_SSL_MODE: disable
- ZITADEL_EXTERNALSECURE: false
- db:
- image: postgres:latest
- restart: unless-stopped
- volumes:
- - postgres-data:/var/lib/postgresql/data
- environment:
- PGUSER: postgres
- POSTGRES_PASSWORD: postgres
-
-volumes:
- postgres-data:
diff --git a/.devcontainer/login-integration-debug/devcontainer.json b/.devcontainer/login-integration-debug/devcontainer.json
new file mode 100644
index 0000000000..525b04788e
--- /dev/null
+++ b/.devcontainer/login-integration-debug/devcontainer.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
+ "name": "login-integration-debug",
+ "dockerComposeFile": [
+ "../base/docker-compose.yml",
+ "docker-compose.yml"
+ ],
+ "service": "login-integration-debug",
+ "runServices": ["login-integration-debug"],
+ "workspaceFolder": "/workspaces",
+ "forwardPorts": [3001],
+ "onCreateCommand": "pnpm install --recursive",
+ "postAttachCommand": "pnpm turbo daemon clean; pnpm turbo @zitadel/login#dev test:integration:login:debug",
+ "customizations": {
+ "jetbrains": {
+ "settings": {
+ "com.intellij:app:HttpConfigurable.use_proxy_pac": true
+ }
+ }
+ }
+}
diff --git a/.devcontainer/login-integration-debug/docker-compose.yml b/.devcontainer/login-integration-debug/docker-compose.yml
new file mode 100644
index 0000000000..11ce02ee7d
--- /dev/null
+++ b/.devcontainer/login-integration-debug/docker-compose.yml
@@ -0,0 +1,9 @@
+services:
+ login-integration-debug:
+ extends:
+ file: ../base/docker-compose.yml
+ service: devcontainer
+ container_name: login-integration-debug
+ depends_on:
+ mock-zitadel:
+ condition: service_started
diff --git a/.devcontainer/login-integration/devcontainer.json b/.devcontainer/login-integration/devcontainer.json
new file mode 100644
index 0000000000..1b7e02df43
--- /dev/null
+++ b/.devcontainer/login-integration/devcontainer.json
@@ -0,0 +1,19 @@
+{
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
+ "name": "login-integration",
+ "dockerComposeFile": [
+ "../base/docker-compose.yml"
+ ],
+ "service": "devcontainer",
+ "runServices": ["login-integration"],
+ "workspaceFolder": "/workspaces",
+ "forwardPorts": [3001],
+ "onCreateCommand": "pnpm install --frozen-lockfile --recursive && cd apps/login/packages/integration && pnpm cypress install && pnpm test:integration:login",
+ "customizations": {
+ "jetbrains": {
+ "settings": {
+ "com.intellij:app:HttpConfigurable.use_proxy_pac": true
+ }
+ }
+ }
+}
diff --git a/.devcontainer/turbo-lint-unit-debug/devcontainer.json b/.devcontainer/turbo-lint-unit-debug/devcontainer.json
new file mode 100644
index 0000000000..19446687a1
--- /dev/null
+++ b/.devcontainer/turbo-lint-unit-debug/devcontainer.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
+ "name": "turbo-lint-unit-debug",
+ "dockerComposeFile": [
+ "../base/docker-compose.yml",
+ "docker-compose.yml"
+ ],
+ "service": "turbo-lint-unit-debug",
+ "runServices": ["turbo-lint-unit-debug"],
+ "workspaceFolder": "/workspaces",
+ "forwardPorts": [3001],
+ "onCreateCommand": "pnpm install --recursive",
+ "postAttachCommand": "pnpm turbo daemon clean; pnpm turbo watch lint test:unit",
+ "customizations": {
+ "jetbrains": {
+ "settings": {
+ "com.intellij:app:HttpConfigurable.use_proxy_pac": true
+ }
+ }
+ }
+}
diff --git a/.devcontainer/turbo-lint-unit-debug/docker-compose.yml b/.devcontainer/turbo-lint-unit-debug/docker-compose.yml
new file mode 100644
index 0000000000..a19a0211e5
--- /dev/null
+++ b/.devcontainer/turbo-lint-unit-debug/docker-compose.yml
@@ -0,0 +1,6 @@
+services:
+ turbo-lint-unit-debug:
+ extends:
+ file: ../base/docker-compose.yml
+ service: devcontainer
+ container_name: turbo-lint-unit-debug
diff --git a/.devcontainer/turbo-lint-unit/devcontainer.json b/.devcontainer/turbo-lint-unit/devcontainer.json
new file mode 100644
index 0000000000..f3c4f64355
--- /dev/null
+++ b/.devcontainer/turbo-lint-unit/devcontainer.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/refs/heads/main/schemas/devContainer.schema.json",
+ "name": "turbo-lint-unit",
+ "dockerComposeFile": [
+ "../base/docker-compose.yml"
+ ],
+ "service": "devcontainer",
+ "runServices": ["devcontainer"],
+ "workspaceFolder": "/workspaces",
+ "postStartCommand": "pnpm install --frozen-lockfile --recursive && pnpm turbo lint test:unit",
+ "customizations": {
+ "jetbrains": {
+ "settings": {
+ "com.intellij:app:HttpConfigurable.use_proxy_pac": true
+ }
+ }
+ }
+}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index fe88f7cea9..abeaa32085 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -86,18 +86,6 @@ jobs:
core_cache_key: ${{ needs.core.outputs.cache_key }}
core_cache_path: ${{ needs.core.outputs.cache_path }}
- login-quality:
- needs: [compile]
- uses: ./.github/workflows/login-quality.yml
- permissions:
- actions: write
- id-token: write
- with:
- ignore-run-cache: ${{ github.event_name == 'workflow_dispatch' || fromJSON(github.run_attempt) > 1 }}
- node_version: "20"
- secrets:
- DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
-
container:
needs: [compile]
uses: ./.github/workflows/container.yml
@@ -110,7 +98,6 @@ jobs:
login-container:
uses: ./.github/workflows/login-container.yml
- if: ${{ github.event_name == 'workflow_dispatch' }}
permissions:
packages: write
id-token: write
@@ -139,7 +126,6 @@ jobs:
lint,
container,
login-container,
- login-quality,
e2e,
]
if: ${{ github.event_name == 'workflow_dispatch' }}
diff --git a/.github/workflows/console.yml b/.github/workflows/console.yml
index a6fb0e2d54..04bdcb2227 100644
--- a/.github/workflows/console.yml
+++ b/.github/workflows/console.yml
@@ -50,7 +50,7 @@ jobs:
cache-dependency-path: pnpm-lock.yaml
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install dependencies
- run: pnpm install
+ run: pnpm install --frozen-lockfile
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Build console with Turbo
run: pnpm turbo build --filter=./console
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 33ffd4f6af..f762124e00 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -79,7 +79,7 @@ jobs:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
- file: build/Dockerfile
+ file: build/zitadel/Dockerfile
target: artifact
platforms: linux/${{ matrix.arch }}
push: true
@@ -94,7 +94,7 @@ jobs:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
- file: build/Dockerfile
+ file: build/zitadel/Dockerfile
target: final
platforms: linux/${{ matrix.arch }}
push: true
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 6251076fd2..ef289463e0 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -46,22 +46,19 @@ jobs:
with:
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.base_ref }}"
- console:
+ turbo-lint-unit:
if: ${{ github.event_name == 'pull_request' }}
- name: console
- runs-on: ubuntu-latest
+ name: turbo-lint-unit
+ runs-on: depot-ubuntu-22.04-8
steps:
- name: Checkout
uses: actions/checkout@v4
- - uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4
+ - name: Run lint and unit tests in dev container
+ uses: devcontainers/ci@v0.3
with:
- node-version: ${{ inputs.node_version }}
- cache: "pnpm"
- cache-dependency-path: pnpm-lock.yaml
- - run: pnpm install --filter=console
- - name: lint
- run: make console_lint
+ push: never
+ configFile: .devcontainer/turbo-lint-unit/devcontainer.json
+ runCmd: echo "Successfully ran lint and unit tests in dev container postStartCommand"
core:
name: core
diff --git a/.github/workflows/login-container.yml b/.github/workflows/login-container.yml
index 958e0a8f5b..6910bca074 100644
--- a/.github/workflows/login-container.yml
+++ b/.github/workflows/login-container.yml
@@ -62,10 +62,9 @@ jobs:
provenance: true
sbom: true
targets: login-standalone
- set: login-*.context=./login/
project: w47wkxzdtw
files: |
- ./login/docker-bake.hcl
- ./login/docker-bake-release.hcl
+ ./apps/login/docker-bake.hcl
+ ./apps/login/docker-bake-release.hcl
./docker-bake.hcl
cwd://${{ steps.login-meta.outputs.bake-file }}
diff --git a/.github/workflows/login-quality.yml b/.github/workflows/login-quality.yml
deleted file mode 100644
index 194ed73c42..0000000000
--- a/.github/workflows/login-quality.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-name: Login Quality
-
-on:
- workflow_call:
- inputs:
- ignore-run-cache:
- description: "Ignore run caches"
- type: boolean
- required: true
- node_version:
- required: true
- type: string
- secrets:
- DEPOT_TOKEN:
- required: true
-
-jobs:
- quality:
- name: Ensure Quality
- runs-on: depot-ubuntu-22.04-8
- timeout-minutes: 30
- permissions:
- actions: write
- env:
- CACHE_DIR: /tmp/login-run-caches
- steps:
- - uses: actions/checkout@v4
- - uses: depot/setup-action@v1
- - name: Restore Run Caches
- uses: actions/cache/restore@v4
- id: run-caches-restore
- with:
- path: ${{ env.CACHE_DIR }}
- key: ${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}-${{github.run_attempt}}
- restore-keys: |
- ${{ runner.os }}-login-run-caches-${{github.ref_name}}-${{ github.sha }}-
- ${{ runner.os }}-login-run-caches-${{github.ref_name}}-
- ${{ runner.os }}-login-run-caches-
- - uses: actions/download-artifact@v4
- with:
- path: .artifacts
- name: zitadel-linux-amd64
- - name: Unpack executable
- run: |
- tar -xvf .artifacts/zitadel-linux-amd64.tar.gz
- mv zitadel-linux-amd64/zitadel ./zitadel
- - uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4
- with:
- node-version: ${{ inputs.node_version }}
- cache: "pnpm"
- cache-dependency-path: pnpm-lock.yaml
- - name: Install dependencies
- run: pnpm install
- - name: Run login quality checks with Turbo
- run: pnpm turbo test:unit --filter=@zitadel/login
- env:
- DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }}
- LOGIN_BAKE_CLI: depot bake
- DEPOT_PROJECT_ID: w47wkxzdtw
- IGNORE_RUN_CACHE: ${{ github.event.inputs.ignore-run-cache }}
- NODE_VERSION: ${{ inputs.node_version }}
-
- - name: Save Run Caches
- uses: actions/cache/save@v4
- with:
- path: ${{ env.CACHE_DIR }}
- key: ${{ steps.run-caches-restore.outputs.cache-primary-key }}
- if: always()
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e23c8869c5..bfbc3d6934 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -165,7 +165,7 @@ jobs:
run: |
gh workflow -R zitadel/zitadel-charts run bump.yml
- typescript-packages:
+ npm-packages:
runs-on: ubuntu-latest
needs: version
if: ${{ github.ref_name == 'next' }}
@@ -184,7 +184,7 @@ jobs:
- name: Install dependencies
working-directory: login
- run: pnpm install
+ run: pnpm install --frozen-lockfile
- name: Create Release Pull Request
uses: changesets/action@v1
@@ -192,9 +192,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ needs.version.outputs.version }}
- cwd: login
+ cwd: packages
+ createGithubReleases: false
- typescript-repo:
+ login-repo:
runs-on: ubuntu-latest
needs: version
if: ${{ github.ref_name == 'next' }}
diff --git a/.gitignore b/.gitignore
index dd694bdeb5..4c3c877a18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
# Test binary, build with `go test -c`
*.test
+!/**/.env.test
# Coverage
coverage.txt
@@ -68,6 +69,7 @@ docs/docs/apis/proto
/internal/api/ui/login/static/resources/themes/zitadel/css/zitadel.css
/internal/api/ui/login/static/resources/themes/zitadel/css/zitadel.css.map
zitadel-*-*
+!apps/**/zitadel-*-*
# local
build/local/*.env
@@ -92,3 +94,6 @@ load-test/output/*
# Turbo
.turbo/
**/.turbo/
+
+# PNPM
+.pnpm-store
\ No newline at end of file
diff --git a/login/.nvmrc b/.nvmrc
similarity index 100%
rename from login/.nvmrc
rename to .nvmrc
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bfea059cee..4c1ae53072 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,5 @@
-# Contributing to ZITADEL
+# Contributing to Zitadel
+
## Introduction
@@ -12,84 +13,28 @@ If you want to give an answer or be part of discussions please be kind. Treat ot
## What can I contribute?
-For people who are new to ZITADEL: We flag issues which are a good starting point to start contributing. You find them [here](https://github.com/zitadel/zitadel/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
+For people who are new to Zitadel: We flag issues which are a good starting point to start contributing.
+You find them [here](https://github.com/zitadel/zitadel/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
+We add the label "good first issue" for problems we think are a good starting point to contribute to Zitadel.
-Make ZITADEL more popular and give it a ⭐
+- [Issues for first time contributors](https://github.com/zitadel/zitadel/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
+- [All issues](https://github.com/zitadel/zitadel/issues)
-Help shaping the future of ZITADEL:
+Help shaping the future of Zitadel:
- Join our [chat](https://zitadel.com/chat) and discuss with us or others.
- Ask or answer questions in the [issues section](https://github.com/zitadel/zitadel/issues)
- Share your thoughts and ideas in the [discussions section](https://github.com/zitadel/zitadel/discussions)
-[Contribute](#how-to-contribute)
-
-- [Contribute code](#contribute)
-- If you found a mistake on our [docs page](https://zitadel.com/docs) or something is missing please read [the docs section](#contribute-docs)
-- [Translate](#contribute-internationalization) and improve texts
+Make Zitadel more popular and give it a ⭐
Follow [@zitadel](https://twitter.com/zitadel) on twitter
-## Quick Start for Contributors
+[Contribute](#how-to-contribute)
-ZITADEL uses **pnpm** as package manager and **Turbo** for build orchestration across the monorepo. Here are the most common commands you'll need:
-
-### Prerequisites
-
-- [Node version v20.x](https://nodejs.org/en/download/)
-- [pnpm version 9.x](https://pnpm.io/installation)
-- [Docker](https://docs.docker.com/engine/install/) for running databases and services
-
-### Common Development Commands
-
-```bash
-# Install all dependencies across the monorepo
-pnpm install
-
-# Start the backend database and ZITADEL server
-docker compose --file ./e2e/docker-compose.yaml up --detach zitadel
-
-# Develop the Console (Angular app)
-pnpm turbo dev --filter=console
-
-# Develop the Login UI (Next.js app)
-pnpm turbo dev --filter=@zitadel/login
-
-# Develop the Documentation (Docusaurus)
-pnpm turbo dev --filter=zitadel-docs
-
-# Build everything
-pnpm turbo build
-
-# Lint and fix code across all packages
-pnpm turbo lint
-
-# Run tests
-pnpm turbo test
-
-# Clean up
-docker compose --file ./e2e/docker-compose.yaml down
-```
-
-### Monorepo Structure
-
-The repository is organized as follows:
-
-| Package | Description | Technology | Development Command |
-| ----------------- | --------------------------- | ------------------- | --------------------------------------------- |
-| `console` | Management UI (post-login) | Angular, TypeScript | `pnpm turbo dev --filter=console` |
-| `@zitadel/login` | Authentication UI | Next.js, React | `pnpm turbo dev --filter=@zitadel/login` |
-| `zitadel-docs` | Documentation site | Docusaurus | `pnpm turbo dev --filter=zitadel-docs` |
-| `@zitadel/client` | TypeScript client library | TypeScript | `pnpm turbo build --filter=@zitadel/client` |
-| `@zitadel/proto` | Protocol buffer definitions | Protobuf | `pnpm turbo generate --filter=@zitadel/proto` |
-
-### Development Workflow
-
-1. **Start the backend**: `docker compose --file ./e2e/docker-compose.yaml up --detach zitadel`
-2. **Choose your focus**: Run one of the development commands above
-3. **Make changes**: Edit code with live reload feedback
-4. **Test your changes**: Use the appropriate test commands
-5. **Cleanup**: `docker compose --file ./e2e/docker-compose.yaml down`
+- [Contribute code](#contribute)
+- If you found a mistake on our [docs page](https://zitadel.com/docs) or something is missing please read [the docs section](contribute-docs)
+- [Translate](#contribute-internationalization) and improve texts
## How to contribute
@@ -101,6 +46,21 @@ If you are unfamiliar with git have a look at Github's documentation on [creatin
Please draft the pull request as soon as possible.
Go through the following checklist before you submit the final pull request:
+### Components
+
+The code consists of the following parts:
+
+| name | description | language | where to find | Development Guide |
+| --------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------- |
+| backend | Service that serves the grpc(-web) and RESTful API | [go](https://go.dev) | [API implementation](./internal/api/grpc) | [Contribute to Backend](contribute-backend) |
+| API definitions | Specifications of the API | [Protobuf](https://developers.google.com/protocol-buffers) | [./proto/zitadel](./proto/zitadel) | [Contribute to Backend](contribute-backend) |
+| console | Frontend the user interacts with after log in | [Angular](https://angular.io), [Typescript](https://www.typescriptlang.org) | [./console](./console) | [Contribute to Frontend](contribute-frontend) |
+| login | Modern authentication UI built with Next.js | [Next.js](https://nextjs.org), [React](https://reactjs.org), [TypeScript](https://www.typescriptlang.org) | [./login](./login) | [Contribute to Frontend](contribute-frontend) |
+| docs | Project documentation made with docusaurus | [Docusaurus](https://docusaurus.io/) | [./docs](./docs) | [Contribute to Frontend](contribute-frontend) |
+| translations | Internationalization files for default languages | YAML | [./console](./console) and [./internal](./internal) | [Contribute Translations](contribute-translations) |
+
+Please follow the guides to validate and test the code before you contribute.
+
### Submit a pull request (PR)
1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [zitadel/zitadel](https://github.com/zitadel/zitadel) repository on GitHub
@@ -165,27 +125,6 @@ Please make sure you cover your changes with tests before marking a Pull Request
- [ ] Integration tests ensure that certain commands emit expected events that trigger notifications.
- [ ] Integration tests ensure that certain events trigger expected notifications.
-## Contribute
-
-The code consists of the following parts:
-
-| name | description | language | where to find |
-| --------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
-| backend | Service that serves the grpc(-web) and RESTful API | [go](https://go.dev) | [API implementation](./internal/api/grpc) |
-| console | Frontend the user interacts with after log in | [Angular](https://angular.io), [Typescript](https://www.typescriptlang.org) | [./console](./console) |
-| login | Modern authentication UI built with Next.js | [Next.js](https://nextjs.org), [React](https://reactjs.org), [TypeScript](https://www.typescriptlang.org) | [./login](./login) |
-| API definitions | Specifications of the API | [Protobuf](https://developers.google.com/protocol-buffers) | [./proto/zitadel](./proto/zitadel) |
-| docs | Project documentation made with docusaurus | [Docusaurus](https://docusaurus.io/) | [./docs](./docs) |
-
-**Important**: This repository uses **pnpm** as package manager and **Turbo** for build orchestration. All frontend packages (console, login, docs) are managed as a monorepo with shared dependencies and optimized builds.
-
-Please validate and test the code before you contribute.
-
-We add the label "good first issue" for problems we think are a good starting point to contribute to ZITADEL.
-
-- [Issues for first time contributors](https://github.com/zitadel/zitadel/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
-- [All issues](https://github.com/zitadel/zitadel/issues)
-
### General Guidelines
#### Gender Neutrality and Inclusive Language
@@ -206,34 +145,62 @@ Choose alternative words depending on the context.
### API
-ZITADEL follows an API first approach. This means all features can not only be accessed via the UI but also via the API.
+Zitadel follows an API first approach. This means all features can not only be accessed via the UI but also via the API.
The API is designed to be used by different clients, such as web applications, mobile applications, and other services.
Therefore, the API is designed to be easy to use, consistent, and reliable.
Please check out the dedicated [API guidelines](./API_DESIGN.md) page when contributing to the API.
-### Developing ZITADEL with Dev Containers
-Follow the instructions provided by your code editor/IDE to initiate the development container. This typically involves opening the "Command Palette" or similar functionality and searching for commands related to "Dev Containers" or "Remote Containers". The quick start guide for VS Code can found [here](https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container)
+#### >Developing Zitadel with Dev Containers
-When you are connected to the container run the following commands to start ZITADEL.
+You can use dev containers if you'd like to make sure you have the same development environment like the corresponding GitHub PR checks use.
+The following dev containers are available:
+
+- **.devcontainer/base/devcontainer.json**: Contains everything you need to run whatever you want.
+- **.devcontainer/turbo-lint-unit/devcontainer.json**: Runs a dev container that executes frontent linting and unit tests and then exits. This is useful to reproduce the corresponding GitHub PR check.
+- **.devcontainer/turbo-lint-unit-debug/devcontainer.json**: Runs a dev container that executes frontent linting and unit tests in watch mode. You can fix the errors right away and have immediate feedback.
+- **.devcontainer/login-integration/devcontainer.json**: Runs a dev container that executes login integration tests and then exits. This is useful to reproduce the corresponding GitHub PR check.
+- **.devcontainer/login-integration-debug/devcontainer.json**: Runs a dev container that spins up the login in a hot-reloading dev server and executes login integration tests interactively. You can fix the errors right away and have immediate feedback.
+
+You can also run the GitHub PR checks locally in dev containers without having to connect to a dev container.
+
+
+The following pnpm commands use the [devcontainer CLI](https://github.com/devcontainers/cli/) and exit when the checks are done.
+The minimal system requirements are having Docker and the devcontainers CLI installed.
+If you don't have the node_modules installed already, you need to install the devcontainers CLI manually. Run `npm i -g @devcontainers/cli`. Alternatively, the [official Microsoft VS Code extension for Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) offers a command `Dev Containers: Install devcontainer CLI`
+
+
+```bash
+npm run devcontainer:lint-unit
+npm run devcontainer:integration:login
+```
+
+If you don't have NPM installed, copy and execute the scripts from the package.json directly.
+
+To connect to a dev container to have full IDE support, follow the instructions provided by your code editor/IDE to initiate the dev container.
+This typically involves opening the "Command Palette" or similar functionality and searching for commands related to "Dev Containers" or "Remote Containers".
+The quick start guide for VS Code can found [here](https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container)
+
+For example, to build and run the Zitadel binary in a dev container, connect your IDE to the dev container described in .devcontainer/base/devcontainer.json.
+Run the following commands inside the container to start Zitadel.
```bash
make compile && ./zitadel start-from-init --masterkey MasterkeyNeedsToHave32Characters --tlsMode disabled
```
-ZITADEL serves traffic as soon as you can see the following log line:
+Zitadel serves traffic as soon as you can see the following log line:
`INFO[0001] server is listening on [::]:8080`
-### Backend/login
+## Contribute Backend Code
-By executing the commands from this section, you run everything you need to develop the ZITADEL backend locally.
+By executing the commands from this section, you run everything you need to develop the Zitadel backend locally.
Using [Docker Compose](https://docs.docker.com/compose/), you run a [PostgreSQL](https://www.postgresql.org/download/) on your local machine.
-With [make](https://www.gnu.org/software/make/), you build a debuggable ZITADEL binary and run it using [delve](https://github.com/go-delve/delve).
+With [make](https://www.gnu.org/software/make/), you build a debuggable Zitadel binary and run it using [delve](https://github.com/go-delve/delve).
Then, you test your changes via the console your binary is serving at http://localhost:8080 and by verifying the database.
Once you are happy with your changes, you run end-to-end tests and tear everything down.
-ZITADEL uses [golangci-lint](https://golangci-lint.run) for code quality checks. Please use [this configuration](.golangci.yaml) when running `golangci-lint`. We recommend to set golangci-lint as linter in your IDE.
+Zitadel uses [golangci-lint](https://golangci-lint.run) for code quality checks. Please use [this configuration](.golangci.yaml) when running `golangci-lint`. We recommend to set golangci-lint as linter in your IDE.
The commands in this section are tested against the following software versions:
@@ -262,10 +229,10 @@ make compile
> Build the binary: `make compile`
You can now run and debug the binary in .artifacts/zitadel/zitadel using your favourite IDE, for example GoLand.
-You can test if ZITADEL does what you expect by using the UI at http://localhost:8080/ui/console.
+You can test if Zitadel does what you expect by using the UI at http://localhost:8080/ui/console.
Also, you can verify the data by running `psql "host=localhost dbname=zitadel sslmode=disable"` and running SQL queries.
-#### Run Local Unit Tests
+### Run Local Unit Tests
To test the code without dependencies, run the unit tests:
@@ -273,11 +240,11 @@ To test the code without dependencies, run the unit tests:
make core_unit_test
```
-#### Run Local Integration Tests
+### Run Local Integration Tests
-Integration tests are run as gRPC clients against a running ZITADEL server binary.
+Integration tests are run as gRPC clients against a running Zitadel server binary.
The server binary is typically [build with coverage enabled](https://go.dev/doc/build-cover).
-It is also possible to run a ZITADEL sever in a debugger and run the integrations tests like that. In order to run the server, a database is required.
+It is also possible to run a Zitadel sever in a debugger and run the integrations tests like that. In order to run the server, a database is required.
In order to prepare the local system, the following will bring up the database, builds a coverage binary, initializes the database and starts the sever.
@@ -300,7 +267,7 @@ To run all available integration tests:
make core_integration_test_packages
```
-When you change any ZITADEL server code, be sure to rebuild and restart the server before the next test run.
+When you change any Zitadel server code, be sure to rebuild and restart the server before the next test run.
```bash
make core_integration_server_stop core_integration_server_start
@@ -314,17 +281,17 @@ make core_integration_server_stop core_integration_db_down
The test binary has the race detector enabled. `core_core_integration_server_stop` checks for any race logs reported by Go and will print them along a `66` exit code when found. Note that the actual race condition may have happened anywhere during the server lifetime, including start, stop or serving gRPC requests during tests.
-#### Run Local End-to-End Tests
+### Run Local End-to-End Tests
To test the whole system, including the console UI and the login UI, run the E2E tests.
```bash
# Build the production docker image
-export ZITADEL_IMAGE=zitadel:local GOOS=linux
+export Zitadel_IMAGE=zitadel:local GOOS=linux
make docker_image
# If you made changes in the e2e directory, make sure you reformat the files
-pnpm turbo lint --filter=e2e
+pnpm turbo lint:fix --filter=e2e
# Run the tests
docker compose --file ./e2e/docker-compose.yaml run --service-ports e2e
@@ -337,7 +304,7 @@ When you are happy with your changes, you can cleanup your environment.
docker compose --file ./e2e/docker-compose.yaml down
```
-#### Run Local End-to-End Tests Against Your Dev Server Console
+### Run Local End-to-End Tests Against Your Dev Server Console
If you also make [changes to the console](#console), you can run the test suite against your locally built backend code and frontend server.
@@ -346,10 +313,10 @@ If you also make [changes to the console](#console), you can run the test suite
pnpm install
# Run the tests interactively
-cd ./e2e && pnpm run open:golangangular
+pnpm run open:golangangular
# Run the tests non-interactively
-cd ./e2e && pnpm run e2e:golangangular
+pnpm run e2e:golangangular
```
When you are happy with your changes, you can cleanup your environment.
@@ -359,23 +326,38 @@ When you are happy with your changes, you can cleanup your environment.
docker compose --file ./e2e/docker-compose.yaml down
```
-### Console
+## Contribute Frontend Code
-By executing the commands from this section, you run everything you need to develop the console locally.
-Using [Docker Compose](https://docs.docker.com/compose/), you run [PostgreSQL](https://www.postgresql.org/download/) and the [latest release of ZITADEL](https://github.com/zitadel/zitadel/releases/latest) on your local machine.
-You use the ZITADEL container as backend for your console.
-The console is run in your [Node](https://nodejs.org/en/about/) environment using [a local development server for Angular](https://angular.io/cli/serve#ng-serve), so you have fast feedback about your changes.
+This repository uses **pnpm** as package manager and **Turbo** for build orchestration.
+All frontend packages are managed as a monorepo with shared dependencies and optimized builds:
-We use **pnpm** as package manager and **Turbo** for build orchestration. Use angular-eslint/Prettier for linting/formatting, so please run `pnpm turbo lint --filter=console` before committing. (VSCode users, check out [this ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [this Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to fix lint and formatting issues in development)
+- [apps/login](contribute-login) (depends on packages/zitadel-client and packages/zitadel-proto)
+- apps/login/integration
+- apps/login/acceptance
+- [console](contribute-console) (depends on packages/zitadel-client)
+- packages/zitadel-client
+- packages/zitadel-proto
+- [docs](contribute-docs)
-Once you are happy with your changes, you run end-to-end tests and tear everything down.
+### Frontend Development Requirements
+
+The frontend components are run in a [Node](https://nodejs.org/en/about/) environment and are managed using the pnpm package manager and the Turborepo orchestrator.
+
+> [!INFO]
+> Some [dev containers are available](dev-containers) for remote development with docker and pipeline debugging in isolated environments.
+> If you don't want to use one of the dev containers, you can develop the frontend components directly on your local machine.
+> To do so, proceed with installing the necessary dependencies.
+
+We use **pnpm** as package manager and **Turbo** for build orchestration. Use angular-eslint/Prettier for linting/formatting.
+VSCode users, check out [this ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [this Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to fix lint and formatting issues during development.
The commands in this section are tested against the following software versions:
- [Docker version 20.10.17](https://docs.docker.com/engine/install/)
- [Node version v20.x](https://nodejs.org/en/download/)
- [pnpm version 9.x](https://pnpm.io/installation)
-- [Cypress runtime dependencies](https://docs.cypress.io/guides/continuous-integration/introduction#Dependencies)
+
+To run tests with Cypress, ensure you have installed the required [Cypress runtime dependencies](https://docs.cypress.io/guides/continuous-integration/introduction#Dependencies)
Note for WSL2 on Windows 10
@@ -387,131 +369,19 @@ The commands in this section are tested against the following software versions:
4. When starting XLaunch, make sure to disable access control
-Run the database and the latest backend locally.
+### Contribute to Login
-```bash
-# Start from the root of the repository
-# You just need the db and the zitadel services to develop the console against.
-docker compose --file ./e2e/docker-compose.yaml up --detach zitadel
-```
+The Login UI is a Next.js application that provides the user interface for authentication flows.
+It's located in the `apps/login` directory and uses pnpm and Turbo for development.
-When the backend is ready, you have the latest zitadel exposed at http://localhost:8080.
-You can now run a local development server with live code reloading at http://localhost:4200.
-To allow console access via http://localhost:4200, you have to configure the ZITADEL backend.
-
-1. Navigate to .
-2. When prompted, login with _zitadel-admin@zitadel.localhost_ and _Password1!_
-3. Select the _ZITADEL_ project.
-4. Select the _Console_ application.
-5. Select _Redirect Settings_
-6. Add _http://localhost:4200/auth/callback_ to the _Redirect URIs_
-7. Add _http://localhost:4200/signedout_ to the _Post Logout URIs_
-8. Select the _Save_ button
-
-You can run the local console development server now.
-
-```bash
-# Install dependencies (from repository root)
-pnpm install
-
-# Option 1: Run console development server with Turbo (recommended)
-pnpm turbo dev --filter=console
-
-# Option 2: Run console development server directly
-cd ./console && pnpm start
-
-# Option 3: Build and serve console (production build)
-pnpm turbo build --filter=console
-cd ./console && pnpm serve
-
-# If you don't want to develop against http://localhost:8080, you can use another environment
-ENVIRONMENT_JSON_URL=https://my-cloud-instance-abcdef.zitadel.cloud/ui/console/assets/environment.json pnpm turbo dev --filter=console
-```
-
-Navigate to http://localhost:4200/.
-Make some changes to the source code and see how the browser is automatically updated.
-
-#### Console Development Scripts
-
-Here are the most useful scripts for console development:
-
-```bash
-# Generate protobuf files (happens automatically with Turbo dependencies)
-pnpm turbo generate --filter=console
-
-# Run development server with live reload
-pnpm turbo dev --filter=console
-
-# Build for production
-pnpm turbo build --filter=console
-
-# Lint and fix code
-pnpm turbo lint --filter=console
-
-# Run unit tests
-pnpm turbo test --filter=console
-
-# Run all console-related tasks
-pnpm turbo dev lint test --filter=console
-```
-
-After making changes to the code, you should run the end-to-end-tests.
-Open another shell.
-
-```bash
-# Reformat your console code using Turbo
-pnpm turbo lint --filter=console
-
-# Change to the e2e directory
-cd ./e2e
-
-# If you made changes in the e2e directory, make sure you reformat the files here too
-pnpm run lint:fix
-
-# Install pnpm dependencies
-pnpm install
-
-# Run all e2e tests
-pnpm run e2e:angular -- --headed
-```
-
-You can also open the test suite interactively for fast feedback on specific tests.
-
-```bash
-# Run tests interactively
-pnpm run open:angular
-```
-
-If you also make [changes to the backend code](#backend--login), you can run the test against your locally built backend code and frontend server
-
-```bash
-pnpm run open:golangangular
-pnpm run e2e:golangangular
-```
-
-When you are happy with your changes, you can format your code and cleanup your environment
-
-```bash
-# Stop and remove the docker containers for zitadel and the database
-docker compose --file ./e2e/docker-compose.yaml down
-```
-
-### Login UI
-
-The Login UI is a Next.js application that provides the user interface for authentication flows. It's located in the `./login` directory and uses pnpm and Turbo for development.
-
-#### Prerequisites
-
-- [Node version v20.x](https://nodejs.org/en/download/)
-- [pnpm version 9.x](https://pnpm.io/installation)
-- [Docker](https://docs.docker.com/engine/install/) for running the backend
+To start developing the login, make sure your system has the [required system dependencies](frontend-dev-requirements) installed.
#### Development Setup
```bash
# Start from the root of the repository
-# Start the database and ZITADEL backend
-docker compose --file ./e2e/docker-compose.yaml up --detach zitadel
+# Start the database and Zitadel backend
+docker compose --file ./apps/login/acceptance/docker-compose.yaml up --detach zitadel
# Install dependencies
pnpm install
@@ -519,52 +389,19 @@ pnpm install
# Option 1: Run login development server with Turbo (recommended)
pnpm turbo dev --filter=@zitadel/login
-# Option 2: Run login development server directly
-cd ./login && pnpm dev
-
-# Option 3: Build and serve login (production build)
+# Option 2: Build and serve login (production build)
pnpm turbo build --filter=@zitadel/login
cd ./login && pnpm start
```
-The login UI will be available at http://localhost:3000.
-
-#### Login Development Scripts
-
-Here are the most useful scripts for login development:
-
-```bash
-# Generate protobuf files (happens automatically with Turbo dependencies)
-pnpm turbo generate --filter=@zitadel/login
-
-# Run development server with live reload
-pnpm turbo dev --filter=@zitadel/login
-
-# Build for production
-pnpm turbo build --filter=@zitadel/login
-
-# Lint and fix code
-pnpm turbo lint --filter=@zitadel/login
-
-# Run unit tests
-pnpm turbo test:unit --filter=@zitadel/login
-
-# Run integration tests
-pnpm turbo test:integration --filter=@zitadel/login
-
-# Run acceptance tests
-pnpm turbo test:acceptance --filter=@zitadel/login
-
-# Run all login-related tasks
-pnpm turbo dev lint test:unit --filter=@zitadel/login
-```
+The login UI is available at http://localhost:3000.
#### Login Architecture
The login application consists of multiple packages:
- `@zitadel/login` - Main Next.js application
-- `@zitadel/client` - TypeScript client library for ZITADEL APIs
+- `@zitadel/client` - TypeScript client library for Zitadel APIs
- `@zitadel/proto` - Protocol buffer definitions and generated code
The build process uses Turbo to orchestrate dependencies:
@@ -573,34 +410,98 @@ The build process uses Turbo to orchestrate dependencies:
2. Client library build (`@zitadel/client#build`)
3. Login application build (`@zitadel/login#build`)
-#### Testing the Login UI
+#### Pass Quality Checks
+
+Reproduce the pipelines linting and testing for the login.
```bash
-# Run unit tests
-pnpm turbo test:unit --filter=@zitadel/login
-
-# Run integration tests (requires running backend)
-pnpm turbo test:integration --filter=@zitadel/login
-
-# Run acceptance tests
-pnpm turbo test:acceptance --filter=@zitadel/login
-
-# Run all tests
-pnpm turbo test:unit test:integration test:acceptance --filter=@zitadel/login
+pnpm turbo quality --filter=./apps/login/* --filter=./packages/*
```
-When you are happy with your changes, cleanup your environment:
+Fix the [quality checks](troubleshoot-frontend), add new checks that cover your changes and mark your pull request as ready for review when the pipeline checks pass.
+
+### Contribute to Console
+
+To start developing the console, make sure your system has the [required system dependencies](frontend-dev-requirements) installed.
+Then, you need to decide which Zitadel instance you would like to target.
+- The easiest starting point is to [configure your environment](console-dev-existing-zitadel) to use a [Zitadel cloud](https://zitadel.com) instance.
+- Alternatively, you can [start a local Zitadel instance from scratch and develop against it](console-dev-local-zitadel).
+
+#### Develop against an already running Zitadel instance
+
+By default, `pnpm dev --filter=console` targets a Zitadel API running at http://localhost:8080.
+To change this, export the link to your environment.json in your environment variables.
```bash
-# Stop and remove the docker containers
-docker compose --file ./e2e/docker-compose.yaml down
+export ENVIRONMENT_JSON_URL=https://my-cloud-instance-abcdef.us1.zitadel.cloud/ui/console/assets/environment.json
```
-## Contribute docs
+Proceed [with configuring your console redirect URIs](console-redirect).
+
+#### Develop against a local Zitadel instance from scratch
+
+By executing the commands from this section, you run everything you need to develop the console locally.
+Using [Docker Compose](https://docs.docker.com/compose/), you run [PostgreSQL](https://www.postgresql.org/download/) and the [latest release of Zitadel](https://github.com/zitadel/zitadel/releases/latest) on your local machine.
+You use the Zitadel container as backend for your console.
+
+Run the database and the latest backend locally.
+
+```bash
+# Start from the root of the repository
+# You just need the db and the zitadel services to develop the console against.
+docker compose --file ./e2e/docker-compose.yaml up --detach zitadel
+```
+
+When Zitadel accepts traffic, navigate to http://localhost:8080/ui/console/projects?login_hint=zitadel-admin@zitadel.localhost and log in with _Password1!_.
+
+Proceed [with configuring your console redirect URIs](console-redirect).
+
+#### Configure Console redirect URI
+
+To allow console access via http://localhost:4200, you have to configure the Zitadel backend.
+
+1. Navigate to /ui/console/projects in your target Zitadel instance.
+3. Select the _Zitadel_ project.
+4. Select the _Console_ application.
+5. Select _Redirect Settings_
+6. Add _http://localhost:4200/auth/callback_ to the _Redirect URIs_
+7. Add _http://localhost:4200/signedout_ to the _Post Logout URIs_
+8. Select the _Save_ button
+
+#### Develop
+
+Run the local console development server.
+
+```bash
+# Install dependencies (from repository root)
+pnpm install
+
+# Option 1: Run console development server with live reloading and dependency rebuilds
+pnpm turbo dev --filter=console
+
+# Option 2: Build and serve console (production build)
+pnpm turbo build --filter=console
+pnpm turbo serve --filter=console
+```
+
+Navigate to http://localhost:4200/.
+Make some changes to the source code and see how the browser is automatically updated.
+
+#### Pass Quality Checks
+
+Reproduce the pipelines linting and testing for the console.
+
+```bash
+pnpm turbo quality --filter=console --filter=e2e
+```
+
+Fix the [quality checks](troubleshoot-frontend), add new checks that cover your changes and mark your pull request as ready for review when the pipeline checks pass.
+
+### Contribute to Docs
Project documentation is made with Docusaurus and is located under [./docs](./docs). The documentation uses **pnpm** and **Turbo** for development and build processes.
-### Local Development
+#### Local Development
```bash
# Install dependencies (from repository root)
@@ -609,35 +510,11 @@ pnpm install
# Option 1: Run docs development server with Turbo (recommended)
pnpm turbo dev --filter=zitadel-docs
-# Option 2: Run docs development server directly
-cd ./docs && pnpm start
-
-# Option 3: Build and serve docs (production build)
+# Option 2: Build and serve docs (production build)
pnpm turbo build --filter=zitadel-docs
cd ./docs && pnpm serve
```
-#### Docs Development Scripts
-
-Here are the most useful scripts for docs development:
-
-```bash
-# Generate API documentation and configuration docs
-pnpm turbo generate --filter=zitadel-docs
-
-# Run development server with live reload
-pnpm turbo dev --filter=zitadel-docs
-
-# Build for production
-pnpm turbo build --filter=zitadel-docs
-
-# Lint and fix code
-pnpm turbo lint --filter=zitadel-docs
-
-# Run all docs-related tasks
-pnpm turbo dev lint build --filter=zitadel-docs
-```
-
The docs build process automatically:
1. Downloads required protoc plugins
@@ -646,11 +523,11 @@ The docs build process automatically:
4. Copies configuration files
5. Builds the Docusaurus site
-### Local testing
+#### Local testing
The documentation server will be available at http://localhost:3000 with live reload for fast development feedback.
-### Style guide
+#### Style guide
- **Code with variables**: Make sure that code snippets can be used by setting environment variables, instead of manually replacing a placeholder.
- **Embedded files**: When embedding mdx files, make sure the template ist prefixed by "\_" (lowdash). The content will be rendered inside the parent page, but is not accessible individually (eg, by search).
@@ -666,14 +543,54 @@ The style guide covers a lot of material, so their [highlights](https://develope
- Use active voice: make clear who's performing the action.
- Use descriptive link text.
-### Docs pull request
+#### Docs pull request
When making a pull request use `docs(): ` as title for the semantic release.
Scope can be left empty (omit the brackets) or refer to the top navigation sections.
-## Contribute internationalization
+#### Pass Quality Checks
-ZITADEL loads translations from four files:
+Reproduce the pipelines linting checks for the docs.
+
+```bash
+pnpm turbo quality --filter=docs
+```
+
+Fix the [quality checks](troubleshoot-frontend), add new checks that cover your changes and mark your pull request as ready for review when the pipeline checks pass.
+
+### Troubleshoot Frontend Quality Checks
+
+To debug and fix failing tasks, execute them individually using the `--filter` flag.
+
+We recommend to use [one of the dev containers](dev-containers) to reproduce pipeline issues.
+
+```bash
+# to reproduce linting error in the console:
+pnpm lint --filter=console
+# To fix them:
+pnpm lint:fix --filter=console
+```
+
+More tasks that are runnable on-demand.
+Some tasks have variants like `pnpm test:e2e:angulargolang`,
+others support arguments and flags like `pnpm test:integration run --spec apps/login/integration/integration/login.cy.ts`.
+For the turbo commands, check your options with `pnpm turbo --help`
+
+| Command | Description | Example |
+| ------------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `pnpm turbo run generate` | Generate stubs from Proto files | Generate API docs: `pnpm turbo run generate --filter zitadel-docs` |
+| `pnpm turbo build` | Build runnable JavaScript code | Regenerate the proto stubs and build the @zitadel/client package: `pnpm turbo build --filter @zitadel/client` |
+| `pnpm turbo quality` | Reproduce the pipeline quality checks | Run login-related quality checks `pnpm turbo quality --filter './apps/login/*' --filter './packages/*'` |
+| `pnpm turbo lint` | Check linting issues | Check login-related linting issues for differences with main `pnpm turbo lint --filter=[main...HEAD] --filter .'/apps/login/**/*' --filter './packages/*'` |
+| `pnpm turbo lint:fix` | Fix linting issues | Fix console-relevant linting issues `pnpm turbo lint:fix --filter console --filter './packages/*' --filter zitadel-e2e` |
+| `pnpm turbo test:unit` | Run unit tests. Rerun on file changes | Run unit tests in all packages in and watch for file changes `pnpm turbo watch test:unit` |
+| `pnpm turbo test:e2e` | Run the Cypress CLI for console e2e tests | Test interactively against the console in a local dev server and Zitadel in a container: `pnpm turbo test:e2e:angular open` |
+| `pnpm turbo down` | Remove containers and volumes | Shut down containers from the integration test setup `pnpm turbo down` |
+| `pnpm turbo clean` | Remove downloaded dependencies and other generated files | Remove generated docs `pnpm turbo clean --filter zitadel-docs` |
+
+## Contribute Translations
+
+Zitadel loads translations from four files:
- [Console texts](./console/src/assets/i18n)
- [Login interface](./internal/api/ui/login/static/i18n)
@@ -691,7 +608,7 @@ You also have to add some changes to the following files:
- [Customized Text Docs](./docs/docs/guides/manage/customize/texts.md)
- [Add language option](./internal/api/ui/login/static/templates/external_not_found_option.html)
-## Want to start ZITADEL?
+## Want to start Zitadel?
You can find an installation guide for all the different environments here:
[https://zitadel.com/docs/self-hosting/deploy/overview](https://zitadel.com/docs/self-hosting/deploy/overview)
@@ -702,14 +619,14 @@ You can find an installation guide for all the different environments here:
## Product management
-The ZITADEL Team works with an agile product management methodology.
+The Zitadel Team works with an agile product management methodology.
You can find all the issues prioritized and ordered in the [product board](https://github.com/orgs/zitadel/projects/2/views/1).
### Sprint
We want to deliver a new release every second week. So we plan everything in two-week sprints.
Each Tuesday we estimate new issues and on Wednesday the last sprint will be reviewed and the next one will be planned.
-After a sprint ends a new version of ZITADEL will be released, and publish to [ZITADEL Cloud](https://zitadel.cloud) the following Monday.
+After a sprint ends a new version of Zitadel will be released, and publish to [Zitadel Cloud](https://zitadel.cloud) the following Monday.
If there are some critical or urgent issues we will have a look at it earlier, than the two weeks.
To show the community the needed information, each issue gets attributes and labels.
@@ -729,15 +646,16 @@ The state should reflect the progress of the issue and what is going on right no
- **🔖 Ready**: The issue is ready to take into a sprint. Difference to "prioritized..." is that the complexity is defined by the team.
- **📋 Sprint backlog**: The issue is scheduled for the current sprint.
- **🏗 In progress**: Someone is working on this issue right now. The issue will get an assignee as soon as it is in progress.
+- **❌ Blocked**: The issue is blocked until another issue is resolved/done.
- **👀 In review**: The issue is in review. Please add someone to review your issue or let us know that it is ready to review with a comment on your pull request.
- **✅ Done**: The issue is implemented and merged to main.
#### Priority
-Priority shows you the priority the ZITADEL team has given this issue. In general the higher the demand from customers and community for the feature, the higher the priority.
+Priority shows you the priority the Zitadel team has given this issue. In general the higher the demand from customers and community for the feature, the higher the priority.
- **🌋 Critical**: This is a security issue or something that has to be fixed urgently, because the software is not usable or highly vulnerable.
-- **🏔 High**: These are the issues the ZITADEL team is currently focusing on and will be implemented as soon as possible.
+- **🏔 High**: These are the issues the Zitadel team is currently focusing on and will be implemented as soon as possible.
- **🏕 Medium**: After all the high issues are done these will be next.
- **🏝 Low**: This is low in priority and will probably not be implemented in the next time or just if someone has some time in between.
@@ -752,18 +670,18 @@ Everything that is higher than 8 should be split in smaller parts.
There are a few general labels that don't belong to a specific category.
-- **good first issue**: This label shows contributors, that it is an easy entry point to start developing on ZITADEL.
-- **help wanted**: The author is seeking help on this topic, this may be from an internal ZITADEL team member or external contributors.
+- **good first issue**: This label shows contributors, that it is an easy entry point to start developing on Zitadel.
+- **help wanted**: The author is seeking help on this topic, this may be from an internal Zitadel team member or external contributors.
#### Category
-The category shows which part of ZITADEL is affected.
+The category shows which part of Zitadel is affected.
- **category: backend**: The backend includes the APIs, event store, command and query side. This is developed in golang.
- **category: ci**: ci is all about continues integration and pipelines.
-- **category: design**: All about the ux/ui of ZITADEL
+- **category: design**: All about the ux/ui of Zitadel
- **category: docs**: Adjustments or new documentations, this can be found in the docs folder.
-- **category: frontend**: The frontend concerns on the one hand the ZITADEL management console (Angular) and on the other hand the login (gohtml)
+- **category: frontend**: The frontend concerns on the one hand the Zitadel management console (Angular) and on the other hand the login (gohtml)
- **category: infra**: Infrastructure does include many different parts. E.g Terraform-provider, docker, metrics, etc.
- **category: translation**: Everything concerning translations or new languages
diff --git a/LICENSING.md b/LICENSING.md
index 259a0d5070..ca4717afa5 100644
--- a/LICENSING.md
+++ b/LICENSING.md
@@ -23,6 +23,7 @@ The following files and directories, including their subdirectories, are license
```
login/
+clients/
```
## Community Contributions
diff --git a/Makefile b/Makefile
index 0232d42528..ad561ab725 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ docker_image:
else \
echo "Reusing precompiled zitadel binary"; \
fi
- DOCKER_BUILDKIT=1 docker build -f build/Dockerfile -t $(ZITADEL_IMAGE) .
+ DOCKER_BUILDKIT=1 docker build -f build/zitadel/Dockerfile -t $(ZITADEL_IMAGE) .
.PHONY: compile_pipeline
compile_pipeline: console_move
@@ -97,17 +97,11 @@ console_move:
.PHONY: console_dependencies
console_dependencies:
- pnpm install
-
-.PHONY: console_client
-console_client:
- cd console && \
- pnpm generate
+ npx pnpm install --frozen-lockfile --filter=./console
.PHONY: console_build
-console_build: console_dependencies console_client
- cd console && \
- pnpm build
+console_build: console_dependencies
+ npx pnpm turbo build --filter=./console
.PHONY: clean
clean:
@@ -165,7 +159,7 @@ core_integration_test: core_integration_server_start core_integration_test_packa
.PHONY: console_lint
console_lint:
- pnpm turbo lint --filter=./console
+ npx pnpm turbo lint --filter=./console
.PHONY: core_lint
core_lint:
@@ -177,15 +171,15 @@ core_lint:
.PHONY: login_pull
login_pull: login_ensure_remote
- @echo "Pulling changes from the 'login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
+ @echo "Pulling changes from the 'apps/login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
git fetch $(LOGIN_REMOTE_NAME) $(LOGIN_REMOTE_BRANCH)
git merge -s ours --allow-unrelated-histories $(LOGIN_REMOTE_NAME)/$(LOGIN_REMOTE_BRANCH) -m "Synthetic merge to align histories"
git push
.PHONY: login_push
login_push: login_ensure_remote
- @echo "Pushing changes to the 'login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
- git subtree split --prefix=login -b login-sync-tmp
+ @echo "Pushing changes to the 'apps/login' subtree on remote $(LOGIN_REMOTE_NAME) branch $(LOGIN_REMOTE_BRANCH)"
+ git subtree split --prefix=apps/login -b login-sync-tmp
git checkout login-sync-tmp
git fetch $(LOGIN_REMOTE_NAME) main
git merge -s ours --allow-unrelated-histories $(LOGIN_REMOTE_NAME)/main -m "Synthetic merge to align histories"
@@ -200,16 +194,3 @@ login_ensure_remote:
else \
echo "Remote $(LOGIN_REMOTE_NAME) already exists."; \
fi
-
-export LOGIN_DIR := ./login/
-export LOGIN_BAKE_CLI_ADDITIONAL_ARGS := --set login-*.context=./login/ --file ./docker-bake.hcl
-export ZITADEL_TAG ?= $(ZITADEL_IMAGE)
-include login/Makefile
-
-# Intentional override of login_test_acceptance_build
-login_test_acceptance_build: docker_image
- @echo "Building login test acceptance environment with the local zitadel image"
- $(MAKE) login_test_acceptance_build_compose login_test_acceptance_build_bake
-
-login_dev: docker_image typescript_generate login_test_acceptance_build_compose login_test_acceptance_cleanup login_test_acceptance_setup_dev
- @echo "Starting login test environment with the local zitadel image"
diff --git a/apps/login/.dockerignore b/apps/login/.dockerignore
new file mode 100644
index 0000000000..4e64fd495f
--- /dev/null
+++ b/apps/login/.dockerignore
@@ -0,0 +1,21 @@
+*
+
+!constants
+!scripts
+!src
+!public
+!locales
+!next.config.mjs
+!next-env-vars.d.ts
+!next-env.d.ts
+!tailwind.config.js
+!tsconfig.json
+!package.json
+!pnpm-lock.yaml
+
+**/*.md
+**/*.png
+**/node_modules
+**/.turbo
+**/*.test.ts
+**/*.test.tsx
\ No newline at end of file
diff --git a/apps/login/.env.test b/apps/login/.env.test
new file mode 100644
index 0000000000..134fdb5669
--- /dev/null
+++ b/apps/login/.env.test
@@ -0,0 +1,5 @@
+NEXT_PUBLIC_BASE_PATH="/ui/v2/login"
+ZITADEL_API_URL=http://mock-zitadel:22222
+ZITADEL_SERVICE_USER_TOKEN="yolo"
+EMAIL_VERIFICATION=true
+DEBUG=true
diff --git a/login/apps/login/.eslintrc.cjs b/apps/login/.eslintrc.cjs
similarity index 79%
rename from login/apps/login/.eslintrc.cjs
rename to apps/login/.eslintrc.cjs
index 76ad0c10d8..d704a7f0c3 100644
--- a/login/apps/login/.eslintrc.cjs
+++ b/apps/login/.eslintrc.cjs
@@ -7,7 +7,10 @@ module.exports = {
"@next/next/no-img-element": "off",
"react/no-unescaped-entities": "off",
"no-unused-vars": "off",
- "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
+ "@typescript-eslint/no-unused-vars": ["error", {
+ argsIgnorePattern: "^_" ,
+ varsIgnorePattern: "^_" ,
+ }],
"no-undef": "off",
},
parserOptions: {
diff --git a/login/.github/ISSUE_TEMPLATE/bug.yaml b/apps/login/.github/ISSUE_TEMPLATE/bug.yaml
similarity index 100%
rename from login/.github/ISSUE_TEMPLATE/bug.yaml
rename to apps/login/.github/ISSUE_TEMPLATE/bug.yaml
diff --git a/login/.github/ISSUE_TEMPLATE/config.yml b/apps/login/.github/ISSUE_TEMPLATE/config.yml
similarity index 100%
rename from login/.github/ISSUE_TEMPLATE/config.yml
rename to apps/login/.github/ISSUE_TEMPLATE/config.yml
diff --git a/login/.github/ISSUE_TEMPLATE/docs.yaml b/apps/login/.github/ISSUE_TEMPLATE/docs.yaml
similarity index 100%
rename from login/.github/ISSUE_TEMPLATE/docs.yaml
rename to apps/login/.github/ISSUE_TEMPLATE/docs.yaml
diff --git a/login/.github/ISSUE_TEMPLATE/improvement.yaml b/apps/login/.github/ISSUE_TEMPLATE/improvement.yaml
similarity index 100%
rename from login/.github/ISSUE_TEMPLATE/improvement.yaml
rename to apps/login/.github/ISSUE_TEMPLATE/improvement.yaml
diff --git a/login/.github/ISSUE_TEMPLATE/proposal.yaml b/apps/login/.github/ISSUE_TEMPLATE/proposal.yaml
similarity index 100%
rename from login/.github/ISSUE_TEMPLATE/proposal.yaml
rename to apps/login/.github/ISSUE_TEMPLATE/proposal.yaml
diff --git a/login/.github/custom-i18n.png b/apps/login/.github/custom-i18n.png
similarity index 100%
rename from login/.github/custom-i18n.png
rename to apps/login/.github/custom-i18n.png
diff --git a/login/.github/dependabot.example.yml b/apps/login/.github/dependabot.example.yml
similarity index 100%
rename from login/.github/dependabot.example.yml
rename to apps/login/.github/dependabot.example.yml
diff --git a/login/.github/pull_request_template.md b/apps/login/.github/pull_request_template.md
similarity index 100%
rename from login/.github/pull_request_template.md
rename to apps/login/.github/pull_request_template.md
diff --git a/login/.github/workflows/close_pr.yml b/apps/login/.github/workflows/close_pr.yml
similarity index 100%
rename from login/.github/workflows/close_pr.yml
rename to apps/login/.github/workflows/close_pr.yml
diff --git a/login/.github/workflows/issues.yml b/apps/login/.github/workflows/issues.yml
similarity index 100%
rename from login/.github/workflows/issues.yml
rename to apps/login/.github/workflows/issues.yml
diff --git a/login/.github/workflows/release.yml b/apps/login/.github/workflows/release.yml
similarity index 100%
rename from login/.github/workflows/release.yml
rename to apps/login/.github/workflows/release.yml
diff --git a/login/.github/workflows/test.yml b/apps/login/.github/workflows/test.yml
similarity index 100%
rename from login/.github/workflows/test.yml
rename to apps/login/.github/workflows/test.yml
diff --git a/login/.gitignore b/apps/login/.gitignore
similarity index 66%
rename from login/.gitignore
rename to apps/login/.gitignore
index 8d49ae1b37..17a18bf973 100644
--- a/login/.gitignore
+++ b/apps/login/.gitignore
@@ -1,3 +1,8 @@
+custom-config.js
+.env*.local
+standalone
+tsconfig.tsbuildinfo
+
.DS_Store
node_modules
.turbo
@@ -7,12 +12,5 @@ dist
dist-ssr
*.local
.env
-server/dist
-public/dist
.vscode
-.idea
-.vercel
-.env*.local
/blob-report/
-/out
-/docker
diff --git a/apps/login/.prettierignore b/apps/login/.prettierignore
new file mode 100644
index 0000000000..413c4b52e0
--- /dev/null
+++ b/apps/login/.prettierignore
@@ -0,0 +1,5 @@
+*
+!constants
+!src
+!locales
+!scripts/healthcheck.js
\ No newline at end of file
diff --git a/login/.prettierrc b/apps/login/.prettierrc
similarity index 100%
rename from login/.prettierrc
rename to apps/login/.prettierrc
diff --git a/login/CODE_OF_CONDUCT.md b/apps/login/CODE_OF_CONDUCT.md
similarity index 100%
rename from login/CODE_OF_CONDUCT.md
rename to apps/login/CODE_OF_CONDUCT.md
diff --git a/login/CONTRIBUTING.md b/apps/login/CONTRIBUTING.md
similarity index 100%
rename from login/CONTRIBUTING.md
rename to apps/login/CONTRIBUTING.md
diff --git a/apps/login/Dockerfile b/apps/login/Dockerfile
new file mode 100644
index 0000000000..7e3d8668d2
--- /dev/null
+++ b/apps/login/Dockerfile
@@ -0,0 +1,36 @@
+FROM node:20-alpine AS base
+
+FROM base AS build
+ENV PNPM_HOME="/pnpm"
+ENV PATH="$PNPM_HOME:$PATH"
+RUN corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@9.1.2 --activate && \
+ apk update && apk add --no-cache && \
+ rm -rf /var/cache/apk/*
+WORKDIR /app
+COPY pnpm-lock.yaml ./
+RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile
+COPY package.json ./
+RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod
+COPY . .
+RUN pnpm build:login:standalone
+
+FROM scratch AS build-out
+COPY --from=build /app/.next/standalone /
+COPY --from=build /app/.next/static /.next/static
+COPY --from=build /app/public /public
+
+FROM base AS login-standalone
+WORKDIR /runtime
+RUN addgroup --system --gid 1001 nodejs && \
+ adduser --system --uid 1001 nextjs
+# If /.env-file/.env is mounted into the container, its variables are made available to the server before it starts up.
+RUN mkdir -p /.env-file && touch /.env-file/.env && chown -R nextjs:nodejs /.env-file
+COPY ./scripts/ ./
+COPY --chown=nextjs:nodejs --from=build-out / ./
+USER nextjs
+ENV HOSTNAME="0.0.0.0"
+ENV PORT=3000
+# TODO: Check healthy, not ready
+HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
+CMD ["/bin/sh", "-c", "node ./healthcheck.js http://localhost:${PORT}/ui/v2/login/healthy"]
+ENTRYPOINT ["./entrypoint.sh"]
diff --git a/login/LICENSE b/apps/login/LICENSE
similarity index 100%
rename from login/LICENSE
rename to apps/login/LICENSE
diff --git a/login/README.md b/apps/login/README.md
similarity index 100%
rename from login/README.md
rename to apps/login/README.md
diff --git a/login/.eslintrc.cjs b/apps/login/acceptance/.eslintrc.cjs
similarity index 100%
rename from login/.eslintrc.cjs
rename to apps/login/acceptance/.eslintrc.cjs
diff --git a/login/apps/login-test-acceptance/.gitignore b/apps/login/acceptance/.gitignore
similarity index 100%
rename from login/apps/login-test-acceptance/.gitignore
rename to apps/login/acceptance/.gitignore
diff --git a/login/apps/login-test-acceptance/go-command.Dockerfile b/apps/login/acceptance/go-command.Dockerfile
similarity index 100%
rename from login/apps/login-test-acceptance/go-command.Dockerfile
rename to apps/login/acceptance/go-command.Dockerfile
diff --git a/login/apps/login-test-acceptance/idp/oidc/go.mod b/apps/login/acceptance/idp/oidc/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/idp/oidc/go.mod
rename to apps/login/acceptance/idp/oidc/go.mod
diff --git a/login/apps/login-test-acceptance/idp/oidc/go.sum b/apps/login/acceptance/idp/oidc/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/idp/oidc/go.sum
rename to apps/login/acceptance/idp/oidc/go.sum
diff --git a/login/apps/login-test-acceptance/idp/oidc/main.go b/apps/login/acceptance/idp/oidc/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/idp/oidc/main.go
rename to apps/login/acceptance/idp/oidc/main.go
diff --git a/login/apps/login-test-acceptance/idp/saml/go.mod b/apps/login/acceptance/idp/saml/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/idp/saml/go.mod
rename to apps/login/acceptance/idp/saml/go.mod
diff --git a/login/apps/login-test-acceptance/idp/saml/go.sum b/apps/login/acceptance/idp/saml/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/idp/saml/go.sum
rename to apps/login/acceptance/idp/saml/go.sum
diff --git a/login/apps/login-test-acceptance/idp/saml/main.go b/apps/login/acceptance/idp/saml/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/idp/saml/main.go
rename to apps/login/acceptance/idp/saml/main.go
diff --git a/login/apps/login-test-acceptance/oidcrp/go.mod b/apps/login/acceptance/oidcrp/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/oidcrp/go.mod
rename to apps/login/acceptance/oidcrp/go.mod
diff --git a/login/apps/login-test-acceptance/oidcrp/go.sum b/apps/login/acceptance/oidcrp/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/oidcrp/go.sum
rename to apps/login/acceptance/oidcrp/go.sum
diff --git a/login/apps/login-test-acceptance/oidcrp/main.go b/apps/login/acceptance/oidcrp/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/oidcrp/main.go
rename to apps/login/acceptance/oidcrp/main.go
diff --git a/login/apps/login-test-acceptance/package.json b/apps/login/acceptance/package.json
similarity index 74%
rename from login/apps/login-test-acceptance/package.json
rename to apps/login/acceptance/package.json
index 1fb83f0345..fc4a191373 100644
--- a/login/apps/login-test-acceptance/package.json
+++ b/apps/login/acceptance/package.json
@@ -2,8 +2,8 @@
"name": "login-test-acceptance",
"private": true,
"scripts": {
- "test:acceptance": "dotenv -e ../login/.env.test.local pnpm exec playwright",
- "test:acceptance:setup": "cd ../.. && make login_test_acceptance_setup_env && NODE_ENV=test pnpm exec turbo run test:acceptance:setup:dev",
+ "test:acceptance": "dotenv -e ../login/.env.test.local playwright",
+ "test:acceptance:setup": "cd ../.. && make login_test_acceptance_setup_env && NODE_ENV=test turbo run test:acceptance:setup:dev",
"test:acceptance:setup:dev": "cd ../.. && make login_test_acceptance_setup_dev"
},
"devDependencies": {
@@ -12,6 +12,7 @@
"@otplib/plugin-crypto": "^12.0.0",
"@otplib/plugin-thirty-two": "^12.0.0",
"@playwright/test": "^1.52.0",
+ "dotenv-cli": "^8.0.0",
"gaxios": "^7.1.0",
"typescript": "^5.8.3"
}
diff --git a/login/apps/login-test-acceptance/test-results/.gitignore b/apps/login/acceptance/pat/.gitignore
similarity index 50%
rename from login/apps/login-test-acceptance/test-results/.gitignore
rename to apps/login/acceptance/pat/.gitignore
index 377ccd3fdf..bf27f3114d 100644
--- a/login/apps/login-test-acceptance/test-results/.gitignore
+++ b/apps/login/acceptance/pat/.gitignore
@@ -1,2 +1,3 @@
*
+!.gitignore
!.gitkeep
diff --git a/console/src/assets/.gitkeep b/apps/login/acceptance/pat/.gitkeep
similarity index 100%
rename from console/src/assets/.gitkeep
rename to apps/login/acceptance/pat/.gitkeep
diff --git a/login/apps/login-test-acceptance/pat/.gitignore b/apps/login/acceptance/playwright-report/.gitignore
similarity index 50%
rename from login/apps/login-test-acceptance/pat/.gitignore
rename to apps/login/acceptance/playwright-report/.gitignore
index 377ccd3fdf..bf27f3114d 100644
--- a/login/apps/login-test-acceptance/pat/.gitignore
+++ b/apps/login/acceptance/playwright-report/.gitignore
@@ -1,2 +1,3 @@
*
+!.gitignore
!.gitkeep
diff --git a/login/apps/login-test-acceptance/pat/.gitkeep b/apps/login/acceptance/playwright-report/.gitkeep
similarity index 100%
rename from login/apps/login-test-acceptance/pat/.gitkeep
rename to apps/login/acceptance/playwright-report/.gitkeep
diff --git a/login/apps/login-test-acceptance/playwright.config.ts b/apps/login/acceptance/playwright.config.ts
similarity index 100%
rename from login/apps/login-test-acceptance/playwright.config.ts
rename to apps/login/acceptance/playwright.config.ts
diff --git a/login/apps/login-test-acceptance/samlsp/go.mod b/apps/login/acceptance/samlsp/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/samlsp/go.mod
rename to apps/login/acceptance/samlsp/go.mod
diff --git a/login/apps/login-test-acceptance/samlsp/go.sum b/apps/login/acceptance/samlsp/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/samlsp/go.sum
rename to apps/login/acceptance/samlsp/go.sum
diff --git a/login/apps/login-test-acceptance/samlsp/main.go b/apps/login/acceptance/samlsp/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/samlsp/main.go
rename to apps/login/acceptance/samlsp/main.go
diff --git a/login/apps/login-test-acceptance/setup/go.mod b/apps/login/acceptance/setup/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/setup/go.mod
rename to apps/login/acceptance/setup/go.mod
diff --git a/login/apps/login-test-acceptance/setup/go.sum b/apps/login/acceptance/setup/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/setup/go.sum
rename to apps/login/acceptance/setup/go.sum
diff --git a/login/apps/login-test-acceptance/setup/main.go b/apps/login/acceptance/setup/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/setup/main.go
rename to apps/login/acceptance/setup/main.go
diff --git a/login/apps/login-test-acceptance/setup/setup.sh b/apps/login/acceptance/setup/setup.sh
similarity index 100%
rename from login/apps/login-test-acceptance/setup/setup.sh
rename to apps/login/acceptance/setup/setup.sh
diff --git a/login/apps/login-test-acceptance/sink/go.mod b/apps/login/acceptance/sink/go.mod
similarity index 100%
rename from login/apps/login-test-acceptance/sink/go.mod
rename to apps/login/acceptance/sink/go.mod
diff --git a/login/apps/login-test-acceptance/sink/go.sum b/apps/login/acceptance/sink/go.sum
similarity index 100%
rename from login/apps/login-test-acceptance/sink/go.sum
rename to apps/login/acceptance/sink/go.sum
diff --git a/login/apps/login-test-acceptance/sink/main.go b/apps/login/acceptance/sink/main.go
similarity index 100%
rename from login/apps/login-test-acceptance/sink/main.go
rename to apps/login/acceptance/sink/main.go
diff --git a/login/apps/login-test-acceptance/playwright-report/.gitignore b/apps/login/acceptance/test-results/.gitignore
similarity index 50%
rename from login/apps/login-test-acceptance/playwright-report/.gitignore
rename to apps/login/acceptance/test-results/.gitignore
index 377ccd3fdf..bf27f3114d 100644
--- a/login/apps/login-test-acceptance/playwright-report/.gitignore
+++ b/apps/login/acceptance/test-results/.gitignore
@@ -1,2 +1,3 @@
*
+!.gitignore
!.gitkeep
diff --git a/login/apps/login-test-acceptance/playwright-report/.gitkeep b/apps/login/acceptance/test-results/.gitkeep
similarity index 100%
rename from login/apps/login-test-acceptance/playwright-report/.gitkeep
rename to apps/login/acceptance/test-results/.gitkeep
diff --git a/login/apps/login-test-acceptance/tests/admin.spec.ts b/apps/login/acceptance/tests/admin.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/admin.spec.ts
rename to apps/login/acceptance/tests/admin.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/code-screen.ts b/apps/login/acceptance/tests/code-screen.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/code-screen.ts
rename to apps/login/acceptance/tests/code-screen.ts
diff --git a/login/apps/login-test-acceptance/tests/code.ts b/apps/login/acceptance/tests/code.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/code.ts
rename to apps/login/acceptance/tests/code.ts
diff --git a/login/apps/login-test-acceptance/tests/email-verify-screen.ts b/apps/login/acceptance/tests/email-verify-screen.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/email-verify-screen.ts
rename to apps/login/acceptance/tests/email-verify-screen.ts
diff --git a/login/apps/login-test-acceptance/tests/email-verify.spec.ts b/apps/login/acceptance/tests/email-verify.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/email-verify.spec.ts
rename to apps/login/acceptance/tests/email-verify.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/email-verify.ts b/apps/login/acceptance/tests/email-verify.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/email-verify.ts
rename to apps/login/acceptance/tests/email-verify.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-apple.spec.ts b/apps/login/acceptance/tests/idp-apple.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-apple.spec.ts
rename to apps/login/acceptance/tests/idp-apple.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-generic-jwt.spec.ts b/apps/login/acceptance/tests/idp-generic-jwt.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-generic-jwt.spec.ts
rename to apps/login/acceptance/tests/idp-generic-jwt.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-generic-oauth.spec.ts b/apps/login/acceptance/tests/idp-generic-oauth.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-generic-oauth.spec.ts
rename to apps/login/acceptance/tests/idp-generic-oauth.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-generic-oidc.spec.ts b/apps/login/acceptance/tests/idp-generic-oidc.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-generic-oidc.spec.ts
rename to apps/login/acceptance/tests/idp-generic-oidc.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-github-enterprise.spec.ts b/apps/login/acceptance/tests/idp-github-enterprise.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-github-enterprise.spec.ts
rename to apps/login/acceptance/tests/idp-github-enterprise.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-github.spec.ts b/apps/login/acceptance/tests/idp-github.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-github.spec.ts
rename to apps/login/acceptance/tests/idp-github.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-gitlab-self-hosted.spec.ts b/apps/login/acceptance/tests/idp-gitlab-self-hosted.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-gitlab-self-hosted.spec.ts
rename to apps/login/acceptance/tests/idp-gitlab-self-hosted.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-gitlab.spec.ts b/apps/login/acceptance/tests/idp-gitlab.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-gitlab.spec.ts
rename to apps/login/acceptance/tests/idp-gitlab.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-google.spec.ts b/apps/login/acceptance/tests/idp-google.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-google.spec.ts
rename to apps/login/acceptance/tests/idp-google.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-ldap.spec.ts b/apps/login/acceptance/tests/idp-ldap.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-ldap.spec.ts
rename to apps/login/acceptance/tests/idp-ldap.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-microsoft.spec.ts b/apps/login/acceptance/tests/idp-microsoft.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-microsoft.spec.ts
rename to apps/login/acceptance/tests/idp-microsoft.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/idp-saml.spec.ts b/apps/login/acceptance/tests/idp-saml.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/idp-saml.spec.ts
rename to apps/login/acceptance/tests/idp-saml.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/login-configuration-possiblities.spec.ts b/apps/login/acceptance/tests/login-configuration-possiblities.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/login-configuration-possiblities.spec.ts
rename to apps/login/acceptance/tests/login-configuration-possiblities.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/login.ts b/apps/login/acceptance/tests/login.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/login.ts
rename to apps/login/acceptance/tests/login.ts
diff --git a/login/apps/login-test-acceptance/tests/loginname-screen.ts b/apps/login/acceptance/tests/loginname-screen.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/loginname-screen.ts
rename to apps/login/acceptance/tests/loginname-screen.ts
diff --git a/login/apps/login-test-acceptance/tests/loginname.ts b/apps/login/acceptance/tests/loginname.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/loginname.ts
rename to apps/login/acceptance/tests/loginname.ts
diff --git a/login/apps/login-test-acceptance/tests/passkey.ts b/apps/login/acceptance/tests/passkey.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/passkey.ts
rename to apps/login/acceptance/tests/passkey.ts
diff --git a/login/apps/login-test-acceptance/tests/password-screen.ts b/apps/login/acceptance/tests/password-screen.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/password-screen.ts
rename to apps/login/acceptance/tests/password-screen.ts
diff --git a/login/apps/login-test-acceptance/tests/password.ts b/apps/login/acceptance/tests/password.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/password.ts
rename to apps/login/acceptance/tests/password.ts
diff --git a/login/apps/login-test-acceptance/tests/register-screen.ts b/apps/login/acceptance/tests/register-screen.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/register-screen.ts
rename to apps/login/acceptance/tests/register-screen.ts
diff --git a/login/apps/login-test-acceptance/tests/register.spec.ts b/apps/login/acceptance/tests/register.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/register.spec.ts
rename to apps/login/acceptance/tests/register.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/register.ts b/apps/login/acceptance/tests/register.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/register.ts
rename to apps/login/acceptance/tests/register.ts
diff --git a/login/apps/login-test-acceptance/tests/select-account.ts b/apps/login/acceptance/tests/select-account.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/select-account.ts
rename to apps/login/acceptance/tests/select-account.ts
diff --git a/login/apps/login-test-acceptance/tests/sink.ts b/apps/login/acceptance/tests/sink.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/sink.ts
rename to apps/login/acceptance/tests/sink.ts
diff --git a/login/apps/login-test-acceptance/tests/user.ts b/apps/login/acceptance/tests/user.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/user.ts
rename to apps/login/acceptance/tests/user.ts
diff --git a/login/apps/login-test-acceptance/tests/username-passkey.spec.ts b/apps/login/acceptance/tests/username-passkey.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-passkey.spec.ts
rename to apps/login/acceptance/tests/username-passkey.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-change-required.spec.ts b/apps/login/acceptance/tests/username-password-change-required.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-change-required.spec.ts
rename to apps/login/acceptance/tests/username-password-change-required.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-changed.spec.ts b/apps/login/acceptance/tests/username-password-changed.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-changed.spec.ts
rename to apps/login/acceptance/tests/username-password-changed.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-otp_email.spec.ts b/apps/login/acceptance/tests/username-password-otp_email.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-otp_email.spec.ts
rename to apps/login/acceptance/tests/username-password-otp_email.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-otp_sms.spec.ts b/apps/login/acceptance/tests/username-password-otp_sms.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-otp_sms.spec.ts
rename to apps/login/acceptance/tests/username-password-otp_sms.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-set.spec.ts b/apps/login/acceptance/tests/username-password-set.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-set.spec.ts
rename to apps/login/acceptance/tests/username-password-set.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-totp.spec.ts b/apps/login/acceptance/tests/username-password-totp.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-totp.spec.ts
rename to apps/login/acceptance/tests/username-password-totp.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password-u2f.spec.ts b/apps/login/acceptance/tests/username-password-u2f.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password-u2f.spec.ts
rename to apps/login/acceptance/tests/username-password-u2f.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/username-password.spec.ts b/apps/login/acceptance/tests/username-password.spec.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/username-password.spec.ts
rename to apps/login/acceptance/tests/username-password.spec.ts
diff --git a/login/apps/login-test-acceptance/tests/welcome.ts b/apps/login/acceptance/tests/welcome.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/welcome.ts
rename to apps/login/acceptance/tests/welcome.ts
diff --git a/login/apps/login-test-acceptance/tests/zitadel.ts b/apps/login/acceptance/tests/zitadel.ts
similarity index 100%
rename from login/apps/login-test-acceptance/tests/zitadel.ts
rename to apps/login/acceptance/tests/zitadel.ts
diff --git a/login/apps/login-test-acceptance/zitadel.yaml b/apps/login/acceptance/zitadel.yaml
similarity index 80%
rename from login/apps/login-test-acceptance/zitadel.yaml
rename to apps/login/acceptance/zitadel.yaml
index 3ddeaf67f0..986574fed2 100644
--- a/login/apps/login-test-acceptance/zitadel.yaml
+++ b/apps/login/acceptance/zitadel.yaml
@@ -1,6 +1,4 @@
-ExternalDomain: 127.0.0.1.sslip.io
-ExternalSecure: true
-ExternalPort: 443
+ExternalSecure: false
TLS.Enabled: false
FirstInstance:
@@ -17,8 +15,12 @@ FirstInstance:
Machine:
Username: zitadel-admin-sa
Name: Admin
- Pat:
- ExpirationDate: 2099-01-01T00:00:00Z
+ Pat.ExpirationDate: 2099-01-01T00:00:00Z
+ LoginClient:
+ Machine:
+ Username: login-client-sa
+ Name: Login Client
+ Pat.ExpirationDate: 2099-01-01T00:00:00Z
DefaultInstance:
LoginPolicy:
@@ -47,37 +49,17 @@ DefaultInstance:
HelpLink: "https://zitadel.com/docs"
SupportEmail: "support@zitadel.com"
DocsLink: "https://zitadel.com/docs"
- Features:
- LoginV2:
- Required: true
-
-OIDC:
- DefaultLoginURLV2: "/ui/v2/login/login?authRequest="
-
-SAML:
- DefaultLoginURLV2: "/ui/v2/login/login?authRequest="
Database:
EventPushConnRatio: 0.2 # 4
ProjectionSpoolerConnRatio: 0.3 # 6
postgres:
Host: db
- Port: 5432
- Database: zitadel
MaxOpenConns: 20
MaxIdleConns: 20
MaxConnLifetime: 1h
MaxConnIdleTime: 5m
- User:
- Username: zitadel
- SSL:
- Mode: disable
- Admin:
- Username: zitadel
- SSL:
- Mode: disable
+ User.Password: zitadel
-Logstore:
- Access:
- Stdout:
- Enabled: true
+Logstore.Access.Stdout.Enabled: true
+Log.Formatter.Format: json
\ No newline at end of file
diff --git a/login/apps/login/constants/csp.js b/apps/login/constants/csp.js
similarity index 100%
rename from login/apps/login/constants/csp.js
rename to apps/login/constants/csp.js
diff --git a/login/docker-bake-release.hcl b/apps/login/docker-bake-release.hcl
similarity index 100%
rename from login/docker-bake-release.hcl
rename to apps/login/docker-bake-release.hcl
diff --git a/apps/login/docker-bake.hcl b/apps/login/docker-bake.hcl
new file mode 100644
index 0000000000..e09d1176e0
--- /dev/null
+++ b/apps/login/docker-bake.hcl
@@ -0,0 +1,25 @@
+variable "LOGIN_TAG" {
+ default = "zitadel-login:local"
+}
+
+group "default" {
+ targets = ["login-standalone"]
+}
+
+# The release target is overwritten in docker-bake-release.hcl
+# It makes sure the image is built for multiple platforms.
+# By default the platforms property is empty, so images are only built for the current bake runtime platform.
+target "release" {}
+
+target "docker-metadata-action" {
+ # In the pipeline, this target is overwritten by the docker metadata action.
+ tags = ["${LOGIN_TAG}"]
+}
+
+# We run integration and acceptance tests against the next standalone server for docker.
+target "login-standalone" {
+ inherits = [
+ "docker-metadata-action",
+ "release",
+ ]
+}
diff --git a/apps/login/integration/.eslintrc.cjs b/apps/login/integration/.eslintrc.cjs
new file mode 100644
index 0000000000..84711c5881
--- /dev/null
+++ b/apps/login/integration/.eslintrc.cjs
@@ -0,0 +1,10 @@
+module.exports = {
+ root: true,
+ // Use basic ESLint config since the login app has its own detailed config
+ extends: ["eslint:recommended"],
+ settings: {
+ next: {
+ rootDir: ["apps/*/"],
+ },
+ },
+};
diff --git a/login/apps/login-test-integration/.gitignore b/apps/login/integration/.gitignore
similarity index 100%
rename from login/apps/login-test-integration/.gitignore
rename to apps/login/integration/.gitignore
diff --git a/apps/login/integration/.npmrc b/apps/login/integration/.npmrc
new file mode 100644
index 0000000000..bc63bba6e3
--- /dev/null
+++ b/apps/login/integration/.npmrc
@@ -0,0 +1 @@
+side-effects-cache=false
diff --git a/apps/login/integration/core-mock/Dockerfile b/apps/login/integration/core-mock/Dockerfile
new file mode 100644
index 0000000000..447c73b534
--- /dev/null
+++ b/apps/login/integration/core-mock/Dockerfile
@@ -0,0 +1,15 @@
+FROM bufbuild/buf:1.54.0 AS proto-files
+RUN buf export https://github.com/envoyproxy/protoc-gen-validate.git --path validate --output /proto-files && \
+ buf export https://github.com/grpc-ecosystem/grpc-gateway.git --path protoc-gen-openapiv2 --output /proto-files && \
+ buf export https://github.com/googleapis/googleapis.git --path protos/zitadelgoogle/api/annotations.proto --path google/api/http.proto --path google/api/field_behavior.proto --output /proto-files && \
+ buf export https://github.com/zitadel/zitadel.git --path ./proto/zitadel --output /proto-files
+
+FROM golang:1.20.5-alpine3.18 AS mock-zitadel
+
+RUN go install github.com/eliobischof/grpc-mock/cmd/grpc-mock@01b09f60db1b501178af59bed03b2c22661df48c
+
+COPY mocked-services.cfg .
+COPY initial-stubs initial-stubs
+COPY --from=proto-files /proto-files/ ./
+
+ENTRYPOINT [ "sh", "-c", "grpc-mock -v 1 -proto $(tr '\n' ',' < ./mocked-services.cfg) -stub-dir ./initial-stubs -mock-addr :22222" ]
diff --git a/login/apps/login-test-integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json b/apps/login/integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json
similarity index 89%
rename from login/apps/login-test-integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json
rename to apps/login/integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json
index 3da4ae999f..ebfaaadb85 100644
--- a/login/apps/login-test-integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json
+++ b/apps/login/integration/core-mock/initial-stubs/zitadel.settings.v2.SettingsService.json
@@ -55,5 +55,12 @@
}
}
}
+ },
+ {
+ "service": "zitadel.settings.v2.SettingsService",
+ "method": "GetHostedLoginTranslation",
+ "out": {
+ "data": {}
+ }
}
]
diff --git a/login/apps/login-test-integration/core-mock/mocked-services.cfg b/apps/login/integration/core-mock/mocked-services.cfg
similarity index 100%
rename from login/apps/login-test-integration/core-mock/mocked-services.cfg
rename to apps/login/integration/core-mock/mocked-services.cfg
diff --git a/login/apps/login-test-integration/cypress.config.ts b/apps/login/integration/cypress.config.ts
similarity index 95%
rename from login/apps/login-test-integration/cypress.config.ts
rename to apps/login/integration/cypress.config.ts
index 080cb31bc6..a115cd9d1a 100644
--- a/login/apps/login-test-integration/cypress.config.ts
+++ b/apps/login/integration/cypress.config.ts
@@ -4,7 +4,7 @@ export default defineConfig({
reporter: "list",
e2e: {
- baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3000",
+ baseUrl: process.env.LOGIN_BASE_URL || "http://localhost:3001/ui/v2/login",
specPattern: "integration/**/*.cy.{js,jsx,ts,tsx}",
supportFile: "support/e2e.{js,jsx,ts,tsx}",
setupNodeEvents(on, config) {
diff --git a/login/apps/login-test-integration/fixtures/example.json b/apps/login/integration/fixtures/example.json
similarity index 100%
rename from login/apps/login-test-integration/fixtures/example.json
rename to apps/login/integration/fixtures/example.json
diff --git a/login/apps/login-test-integration/integration/invite.cy.ts b/apps/login/integration/integration/invite.cy.ts
similarity index 100%
rename from login/apps/login-test-integration/integration/invite.cy.ts
rename to apps/login/integration/integration/invite.cy.ts
diff --git a/login/apps/login-test-integration/integration/login.cy.ts b/apps/login/integration/integration/login.cy.ts
similarity index 100%
rename from login/apps/login-test-integration/integration/login.cy.ts
rename to apps/login/integration/integration/login.cy.ts
diff --git a/login/apps/login-test-integration/integration/register-idp.cy.ts b/apps/login/integration/integration/register-idp.cy.ts
similarity index 100%
rename from login/apps/login-test-integration/integration/register-idp.cy.ts
rename to apps/login/integration/integration/register-idp.cy.ts
diff --git a/login/apps/login-test-integration/integration/register.cy.ts b/apps/login/integration/integration/register.cy.ts
similarity index 100%
rename from login/apps/login-test-integration/integration/register.cy.ts
rename to apps/login/integration/integration/register.cy.ts
diff --git a/login/apps/login-test-integration/integration/verify.cy.ts b/apps/login/integration/integration/verify.cy.ts
similarity index 100%
rename from login/apps/login-test-integration/integration/verify.cy.ts
rename to apps/login/integration/integration/verify.cy.ts
diff --git a/login/apps/login-test-integration/support/e2e.ts b/apps/login/integration/support/e2e.ts
similarity index 83%
rename from login/apps/login-test-integration/support/e2e.ts
rename to apps/login/integration/support/e2e.ts
index 58056c973e..1ac0eb3948 100644
--- a/login/apps/login-test-integration/support/e2e.ts
+++ b/apps/login/integration/support/e2e.ts
@@ -1,4 +1,4 @@
-const url = Cypress.env("CORE_MOCK_STUBS_URL") || "http://localhost:22220/v1/stubs";
+const url = Cypress.env("CORE_MOCK_STUBS_URL") || "http://mock-zitadel:22220/v1/stubs";
function removeStub(service: string, method: string) {
return cy.request({
diff --git a/login/apps/login-test-integration/tsconfig.json b/apps/login/integration/tsconfig.json
similarity index 100%
rename from login/apps/login-test-integration/tsconfig.json
rename to apps/login/integration/tsconfig.json
diff --git a/login/apps/login/locales/de.json b/apps/login/locales/de.json
similarity index 85%
rename from login/apps/login/locales/de.json
rename to apps/login/locales/de.json
index 75897a628e..7b2a507fe4 100644
--- a/login/apps/login/locales/de.json
+++ b/apps/login/locales/de.json
@@ -6,7 +6,9 @@
"title": "Konten",
"description": "Wählen Sie das Konto aus, das Sie verwenden möchten.",
"addAnother": "Ein weiteres Konto hinzufügen",
- "noResults": "Keine Konten gefunden"
+ "noResults": "Keine Konten gefunden",
+ "verified": "verifiziert",
+ "expired": "abgelaufen"
},
"logout": {
"title": "Logout",
@@ -23,14 +25,20 @@
"title": "Willkommen zurück!",
"description": "Geben Sie Ihre Anmeldedaten ein.",
"register": "Neuen Benutzer registrieren",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "loginName": "Dieses Feld ist erforderlich"
+ }
},
"password": {
"verify": {
"title": "Passwort",
"description": "Geben Sie Ihr Passwort ein.",
"resetPassword": "Passwort zurücksetzen",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "password": "Dieses Feld ist erforderlich"
+ }
},
"set": {
"title": "Passwort festlegen",
@@ -38,12 +46,21 @@
"codeSent": "Ein Code wurde an Ihre E-Mail-Adresse gesendet.",
"noCodeReceived": "Keinen Code erhalten?",
"resend": "Erneut senden",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "code": "Dieses Feld ist erforderlich",
+ "newPassword": "Bitte geben Sie ein Passwort ein!",
+ "confirmPassword": "Dieses Feld ist erforderlich"
+ }
},
"change": {
"title": "Passwort ändern",
"description": "Legen Sie das Passwort für Ihr Konto fest",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "newPassword": "Bitte geben Sie ein neues Passwort ein!",
+ "confirmPassword": "Dieses Feld ist erforderlich"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Geben Sie Ihre LDAP-Anmeldedaten ein.",
"username": "Benutzername",
"password": "Passwort",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "username": "Dieses Feld ist erforderlich",
+ "password": "Dieses Feld ist erforderlich"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Geben Sie den Code ein, den Sie per E-Mail erhalten haben.",
"noCodeReceived": "Keinen Code erhalten?",
"resendCode": "Code erneut senden",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "code": "Dieses Feld ist erforderlich"
+ }
},
"set": {
"title": "2-Faktor einrichten",
@@ -115,7 +139,10 @@
"smsDescription": "Geben Sie Ihre Telefonnummer ein, um einen Code per SMS zu erhalten.",
"emailDescription": "Geben Sie Ihre E-Mail-Adresse ein, um einen Code per E-Mail zu erhalten.",
"totpRegisterDescription": "Scannen Sie den QR-Code oder navigieren Sie manuell zur URL.",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "code": "Dieses Feld ist erforderlich"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Passwort festlegen",
"description": "Legen Sie das Passwort für Ihr Konto fest",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "password": "Bitte geben Sie ein Passwort ein!",
+ "confirmPassword": "Dieses Feld ist erforderlich"
+ }
+ },
+ "required": {
+ "firstname": "Dieses Feld ist erforderlich",
+ "lastname": "Dieses Feld ist erforderlich",
+ "email": "Dieses Feld ist erforderlich"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "Keinen Code erhalten?",
"resendCode": "Code erneut senden",
"codeSent": "Ein Code wurde gerade an Ihre E-Mail-Adresse gesendet.",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "code": "Dieses Feld ist erforderlich"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Gerätecode",
"description": "Geben Sie den Code ein.",
- "submit": "Weiter"
+ "submit": "Weiter",
+ "required": {
+ "code": "Dieses Feld ist erforderlich"
+ }
},
"request": {
"title": "{appName} möchte eine Verbindung herstellen:",
diff --git a/login/apps/login/locales/en.json b/apps/login/locales/en.json
similarity index 84%
rename from login/apps/login/locales/en.json
rename to apps/login/locales/en.json
index 9f95403063..e1b7e4e82c 100644
--- a/login/apps/login/locales/en.json
+++ b/apps/login/locales/en.json
@@ -6,7 +6,9 @@
"title": "Accounts",
"description": "Select the account you want to use.",
"addAnother": "Add another account",
- "noResults": "No accounts found"
+ "noResults": "No accounts found",
+ "verified": "verified",
+ "expired": "expired"
},
"logout": {
"title": "Logout",
@@ -23,14 +25,20 @@
"title": "Welcome back!",
"description": "Enter your login data.",
"register": "Register new user",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "loginName": "This field is required"
+ }
},
"password": {
"verify": {
"title": "Password",
"description": "Enter your password.",
"resetPassword": "Reset Password",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "password": "This field is required"
+ }
},
"set": {
"title": "Set Password",
@@ -38,12 +46,21 @@
"codeSent": "A code has been sent to your email address.",
"noCodeReceived": "Didn't receive a code?",
"resend": "Resend code",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "code": "This field is required",
+ "newPassword": "You have to provide a password!",
+ "confirmPassword": "This field is required"
+ }
},
"change": {
"title": "Change Password",
"description": "Set the password for your account",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "newPassword": "You have to provide a new password!",
+ "confirmPassword": "This field is required"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Enter your LDAP credentials.",
"username": "Username",
"password": "Password",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "username": "This field is required",
+ "password": "This field is required"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Enter the code you received via email.",
"noCodeReceived": "Didn't receive a code?",
"resendCode": "Resend code",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "code": "This field is required"
+ }
},
"set": {
"title": "Set up 2-Factor",
@@ -115,7 +139,10 @@
"smsDescription": "Enter your phone number to receive a code via SMS.",
"emailDescription": "Enter your email address to receive a code via email.",
"totpRegisterDescription": "Scan the QR Code or navigate to the URL manually.",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "code": "This field is required"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Set Password",
"description": "Set the password for your account",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "password": "You have to provide a password!",
+ "confirmPassword": "This field is required"
+ }
+ },
+ "required": {
+ "firstname": "This field is required",
+ "lastname": "This field is required",
+ "email": "This field is required"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "Didn't receive a code?",
"resendCode": "Resend code",
"codeSent": "A code has just been sent to your email address.",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "code": "This field is required"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Device code",
"description": "Enter the code displayed on your app or device.",
- "submit": "Continue"
+ "submit": "Continue",
+ "required": {
+ "code": "This field is required"
+ }
},
"request": {
"title": "{appName} would like to connect",
diff --git a/login/apps/login/locales/es.json b/apps/login/locales/es.json
similarity index 84%
rename from login/apps/login/locales/es.json
rename to apps/login/locales/es.json
index fe88bb94c6..b1c63583a7 100644
--- a/login/apps/login/locales/es.json
+++ b/apps/login/locales/es.json
@@ -4,9 +4,11 @@
},
"accounts": {
"title": "Cuentas",
- "description": "Selecciona la cuenta que deseas usar.",
+ "description": "Seleccione la cuenta que desea utilizar.",
"addAnother": "Agregar otra cuenta",
- "noResults": "No se encontraron cuentas"
+ "noResults": "No se encontraron cuentas",
+ "verified": "verificado",
+ "expired": "expirado"
},
"logout": {
"title": "Cerrar sesión",
@@ -23,14 +25,20 @@
"title": "¡Bienvenido de nuevo!",
"description": "Introduce tus datos de acceso.",
"register": "Registrar nuevo usuario",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "loginName": "Este campo es obligatorio"
+ }
},
"password": {
"verify": {
"title": "Contraseña",
"description": "Introduce tu contraseña.",
"resetPassword": "Restablecer contraseña",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "password": "Este campo es obligatorio"
+ }
},
"set": {
"title": "Establecer Contraseña",
@@ -38,12 +46,21 @@
"codeSent": "Se ha enviado un código a su correo electrónico.",
"noCodeReceived": "¿No recibiste un código?",
"resend": "Reenviar código",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "code": "Este campo es obligatorio",
+ "newPassword": "¡Debes proporcionar una contraseña!",
+ "confirmPassword": "Este campo es obligatorio"
+ }
},
"change": {
"title": "Cambiar Contraseña",
"description": "Establece la contraseña para tu cuenta",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "newPassword": "¡Debes proporcionar una nueva contraseña!",
+ "confirmPassword": "Este campo es obligatorio"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Introduce tus credenciales LDAP.",
"username": "Nombre de usuario",
"password": "Contraseña",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "username": "Este campo es obligatorio",
+ "password": "Este campo es obligatorio"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Introduce el código que recibiste por correo electrónico.",
"noCodeReceived": "¿No recibiste un código?",
"resendCode": "Reenviar código",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "code": "Este campo es obligatorio"
+ }
},
"set": {
"title": "Configurar autenticación de 2 factores",
@@ -115,7 +139,10 @@
"smsDescription": "Introduce tu número de teléfono para recibir un código por SMS.",
"emailDescription": "Introduce tu dirección de correo electrónico para recibir un código por correo electrónico.",
"totpRegisterDescription": "Escanea el código QR o navega manualmente a la URL.",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "code": "Este campo es obligatorio"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Establecer Contraseña",
"description": "Establece la contraseña para tu cuenta",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "password": "¡Debes proporcionar una contraseña!",
+ "confirmPassword": "Este campo es obligatorio"
+ }
+ },
+ "required": {
+ "firstname": "Este campo es obligatorio",
+ "lastname": "Este campo es obligatorio",
+ "email": "Este campo es obligatorio"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "¿No recibiste un código?",
"resendCode": "Reenviar código",
"codeSent": "Se ha enviado un código a tu dirección de correo electrónico.",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "code": "Este campo es obligatorio"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Código del dispositivo",
"description": "Introduce el código.",
- "submit": "Continuar"
+ "submit": "Continuar",
+ "required": {
+ "code": "Este campo es obligatorio"
+ }
},
"request": {
"title": "{appName} desea conectarse:",
diff --git a/login/apps/login/locales/it.json b/apps/login/locales/it.json
similarity index 84%
rename from login/apps/login/locales/it.json
rename to apps/login/locales/it.json
index 1229a1a4c0..a71b48ed04 100644
--- a/login/apps/login/locales/it.json
+++ b/apps/login/locales/it.json
@@ -4,9 +4,11 @@
},
"accounts": {
"title": "Account",
- "description": "Seleziona l'account che desideri utilizzare.",
+ "description": "Seleziona l'account che vuoi utilizzare.",
"addAnother": "Aggiungi un altro account",
- "noResults": "Nessun account trovato"
+ "noResults": "Nessun account trovato",
+ "verified": "verificato",
+ "expired": "scaduto"
},
"logout": {
"title": "Esci",
@@ -23,14 +25,20 @@
"title": "Bentornato!",
"description": "Inserisci i tuoi dati di accesso.",
"register": "Registrati come nuovo utente",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "loginName": "Questo campo è obbligatorio"
+ }
},
"password": {
"verify": {
"title": "Password",
"description": "Inserisci la tua password.",
"resetPassword": "Reimposta Password",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "password": "Questo campo è obbligatorio"
+ }
},
"set": {
"title": "Imposta Password",
@@ -38,12 +46,21 @@
"codeSent": "Un codice è stato inviato al tuo indirizzo email.",
"noCodeReceived": "Non hai ricevuto un codice?",
"resend": "Invia di nuovo",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "code": "Questo campo è obbligatorio",
+ "newPassword": "Devi fornire una password!",
+ "confirmPassword": "Questo campo è obbligatorio"
+ }
},
"change": {
"title": "Cambia Password",
"description": "Imposta la password per il tuo account",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "newPassword": "Devi fornire una nuova password!",
+ "confirmPassword": "Questo campo è obbligatorio"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Inserisci le tue credenziali LDAP.",
"username": "Nome utente",
"password": "Password",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "username": "Questo campo è obbligatorio",
+ "password": "Questo campo è obbligatorio"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Inserisci il codice ricevuto via email.",
"noCodeReceived": "Non hai ricevuto un codice?",
"resendCode": "Invia di nuovo il codice",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "code": "Questo campo è obbligatorio"
+ }
},
"set": {
"title": "Configura l'autenticazione a 2 fattori",
@@ -115,7 +139,10 @@
"smsDescription": "Inserisci il tuo numero di telefono per ricevere un codice via SMS.",
"emailDescription": "Inserisci il tuo indirizzo email per ricevere un codice via email.",
"totpRegisterDescription": "Scansiona il codice QR o naviga manualmente all'URL.",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "code": "Questo campo è obbligatorio"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Imposta Password",
"description": "Imposta la password per il tuo account",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "password": "Devi fornire una password!",
+ "confirmPassword": "Questo campo è obbligatorio"
+ }
+ },
+ "required": {
+ "firstname": "Questo campo è obbligatorio",
+ "lastname": "Questo campo è obbligatorio",
+ "email": "Questo campo è obbligatorio"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "Non hai ricevuto un codice?",
"resendCode": "Invia di nuovo il codice",
"codeSent": "Un codice è stato appena inviato al tuo indirizzo email.",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "code": "Questo campo è obbligatorio"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Codice dispositivo",
"description": "Inserisci il codice.",
- "submit": "Continua"
+ "submit": "Continua",
+ "required": {
+ "code": "Questo campo è obbligatorio"
+ }
},
"request": {
"title": "{appName} desidera connettersi:",
diff --git a/login/apps/login/locales/pl.json b/apps/login/locales/pl.json
similarity index 86%
rename from login/apps/login/locales/pl.json
rename to apps/login/locales/pl.json
index 9fea6a19fa..3e8562a220 100644
--- a/login/apps/login/locales/pl.json
+++ b/apps/login/locales/pl.json
@@ -6,7 +6,9 @@
"title": "Konta",
"description": "Wybierz konto, którego chcesz użyć.",
"addAnother": "Dodaj kolejne konto",
- "noResults": "Nie znaleziono kont"
+ "noResults": "Nie znaleziono kont",
+ "verified": "zweryfikowany",
+ "expired": "wygasł"
},
"logout": {
"title": "Wyloguj się",
@@ -23,14 +25,20 @@
"title": "Witamy ponownie!",
"description": "Wprowadź dane logowania.",
"register": "Zarejestruj nowego użytkownika",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "loginName": "To pole jest wymagane"
+ }
},
"password": {
"verify": {
"title": "Hasło",
"description": "Wprowadź swoje hasło.",
"resetPassword": "Zresetuj hasło",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "password": "To pole jest wymagane"
+ }
},
"set": {
"title": "Ustaw hasło",
@@ -38,12 +46,21 @@
"codeSent": "Kod został wysłany na twój adres e-mail.",
"noCodeReceived": "Nie otrzymałeś kodu?",
"resend": "Wyślij kod ponownie",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "code": "To pole jest wymagane",
+ "newPassword": "Musisz podać hasło!",
+ "confirmPassword": "To pole jest wymagane"
+ }
},
"change": {
"title": "Zmień hasło",
"description": "Ustaw nowe hasło dla swojego konta",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "newPassword": "Musisz podać nowe hasło!",
+ "confirmPassword": "To pole jest wymagane"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Wprowadź swoje dane logowania LDAP.",
"username": "Nazwa użytkownika",
"password": "Hasło",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "username": "To pole jest wymagane",
+ "password": "To pole jest wymagane"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Wprowadź kod otrzymany e-mailem.",
"noCodeReceived": "Nie otrzymałeś kodu?",
"resendCode": "Wyślij kod ponownie",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "code": "To pole jest wymagane"
+ }
},
"set": {
"title": "Skonfiguruj uwierzytelnianie dwuskładnikowe",
@@ -115,7 +139,10 @@
"smsDescription": "Wprowadź swój numer telefonu, aby otrzymać kod SMS-em.",
"emailDescription": "Wprowadź swój adres e-mail, aby otrzymać kod e-mailem.",
"totpRegisterDescription": "Zeskanuj kod QR lub otwórz adres URL ręcznie.",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "code": "To pole jest wymagane"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Ustaw hasło",
"description": "Ustaw hasło dla swojego konta",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "password": "Musisz podać hasło!",
+ "confirmPassword": "To pole jest wymagane"
+ }
+ },
+ "required": {
+ "firstname": "To pole jest wymagane",
+ "lastname": "To pole jest wymagane",
+ "email": "To pole jest wymagane"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "Nie otrzymałeś kodu?",
"resendCode": "Wyślij kod ponownie",
"codeSent": "Kod został właśnie wysłany na twój adres e-mail.",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "code": "To pole jest wymagane"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Kod urządzenia",
"description": "Wprowadź kod.",
- "submit": "Kontynuuj"
+ "submit": "Kontynuuj",
+ "required": {
+ "code": "To pole jest wymagane"
+ }
},
"request": {
"title": "{appName} chce się połączyć:",
diff --git a/login/apps/login/locales/ru.json b/apps/login/locales/ru.json
similarity index 83%
rename from login/apps/login/locales/ru.json
rename to apps/login/locales/ru.json
index e745f1ae59..6ba2917e16 100644
--- a/login/apps/login/locales/ru.json
+++ b/apps/login/locales/ru.json
@@ -6,7 +6,9 @@
"title": "Аккаунты",
"description": "Выберите аккаунт, который хотите использовать.",
"addAnother": "Добавить другой аккаунт",
- "noResults": "Аккаунты не найдены"
+ "noResults": "Аккаунты не найдены",
+ "verified": "проверенный",
+ "expired": "истёк"
},
"logout": {
"title": "Выход",
@@ -23,14 +25,20 @@
"title": "С возвращением!",
"description": "Введите свои данные для входа.",
"register": "Зарегистрировать нового пользователя",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "loginName": "Это поле обязательно для заполнения"
+ }
},
"password": {
"verify": {
"title": "Пароль",
"description": "Введите ваш пароль.",
"resetPassword": "Сбросить пароль",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "password": "Это поле обязательно для заполнения"
+ }
},
"set": {
"title": "Установить пароль",
@@ -38,12 +46,21 @@
"codeSent": "Код отправлен на ваш адрес электронной почты.",
"noCodeReceived": "Не получили код?",
"resend": "Отправить код повторно",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "code": "Это поле обязательно для заполнения",
+ "newPassword": "Вы должны указать пароль!",
+ "confirmPassword": "Это поле обязательно для заполнения"
+ }
},
"change": {
"title": "Изменить пароль",
"description": "Установите пароль для вашего аккаунта",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "newPassword": "Вы должны указать новый пароль!",
+ "confirmPassword": "Это поле обязательно для заполнения"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "Введите ваши учетные данные LDAP.",
"username": "Имя пользователя",
"password": "Пароль",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "username": "Это поле обязательно для заполнения",
+ "password": "Это поле обязательно для заполнения"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "Введите код, полученный по email.",
"noCodeReceived": "Не получили код?",
"resendCode": "Отправить код повторно",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "code": "Это поле обязательно для заполнения"
+ }
},
"set": {
"title": "Настройка двухфакторной аутентификации",
@@ -115,7 +139,10 @@
"smsDescription": "Введите номер телефона для получения кода по SMS.",
"emailDescription": "Введите email для получения кода.",
"totpRegisterDescription": "Отсканируйте QR-код или перейдите по ссылке вручную.",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "code": "Это поле обязательно для заполнения"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "Установить пароль",
"description": "Установите пароль для вашего аккаунта",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "password": "Вы должны указать пароль!",
+ "confirmPassword": "Это поле обязательно для заполнения"
+ }
+ },
+ "required": {
+ "firstname": "Это поле обязательно для заполнения",
+ "lastname": "Это поле обязательно для заполнения",
+ "email": "Это поле обязательно для заполнения"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "Не получили код?",
"resendCode": "Отправить код повторно",
"codeSent": "Код отправлен на ваш email.",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "code": "Это поле обязательно для заполнения"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "Код устройства",
"description": "Введите код.",
- "submit": "Продолжить"
+ "submit": "Продолжить",
+ "required": {
+ "code": "Это поле обязательно для заполнения"
+ }
},
"request": {
"title": "{appName} хочет подключиться:",
diff --git a/login/apps/login/locales/zh.json b/apps/login/locales/zh.json
similarity index 83%
rename from login/apps/login/locales/zh.json
rename to apps/login/locales/zh.json
index 5a9cb3a4eb..fe5f2d1867 100644
--- a/login/apps/login/locales/zh.json
+++ b/apps/login/locales/zh.json
@@ -4,9 +4,11 @@
},
"accounts": {
"title": "账户",
- "description": "选择您想使用的账户。",
+ "description": "选择您要使用的账户。",
"addAnother": "添加另一个账户",
- "noResults": "未找到账户"
+ "noResults": "未找到账户",
+ "verified": "已验证",
+ "expired": "已过期"
},
"logout": {
"title": "注销",
@@ -23,14 +25,20 @@
"title": "欢迎回来!",
"description": "请输入您的登录信息。",
"register": "注册新用户",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "loginName": "此字段为必填项"
+ }
},
"password": {
"verify": {
"title": "密码",
"description": "请输入您的密码。",
"resetPassword": "重置密码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "password": "此字段为必填项"
+ }
},
"set": {
"title": "设置密码",
@@ -38,12 +46,21 @@
"codeSent": "验证码已发送到您的邮箱。",
"noCodeReceived": "没有收到验证码?",
"resend": "重发验证码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "code": "此字段为必填项",
+ "newPassword": "必须提供密码!",
+ "confirmPassword": "此字段为必填项"
+ }
},
"change": {
"title": "更改密码",
"description": "为您的账户设置密码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "newPassword": "必须提供新密码!",
+ "confirmPassword": "此字段为必填项"
+ }
}
},
"idp": {
@@ -85,7 +102,11 @@
"description": "请输入您的 LDAP 凭据。",
"username": "用户名",
"password": "密码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "username": "此字段为必填项",
+ "password": "此字段为必填项"
+ }
},
"mfa": {
"verify": {
@@ -107,7 +128,10 @@
"emailDescription": "输入通过电子邮件收到的验证码。",
"noCodeReceived": "没有收到验证码?",
"resendCode": "重发验证码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "code": "此字段为必填项"
+ }
},
"set": {
"title": "设置双因素认证",
@@ -115,7 +139,10 @@
"smsDescription": "输入您的电话号码以接收短信验证码。",
"emailDescription": "输入您的电子邮箱地址以接收电子邮件验证码。",
"totpRegisterDescription": "扫描二维码或手动导航到URL。",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "code": "此字段为必填项"
+ }
}
},
"passkey": {
@@ -172,7 +199,16 @@
"password": {
"title": "设置密码",
"description": "为您的账户设置密码",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "password": "必须提供密码!",
+ "confirmPassword": "此字段为必填项"
+ }
+ },
+ "required": {
+ "firstname": "此字段为必填项",
+ "lastname": "此字段为必填项",
+ "email": "此字段为必填项"
}
},
"invite": {
@@ -209,7 +245,10 @@
"noCodeReceived": "没有收到验证码?",
"resendCode": "重发验证码",
"codeSent": "刚刚发送了一封包含验证码的电子邮件。",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "code": "此字段为必填项"
+ }
}
},
"authenticator": {
@@ -223,7 +262,10 @@
"usercode": {
"title": "设备代码",
"description": "输入代码。",
- "submit": "继续"
+ "submit": "继续",
+ "required": {
+ "code": "此字段为必填项"
+ }
},
"request": {
"title": "{appName} 想要连接:",
diff --git a/login/apps/login/next-env-vars.d.ts b/apps/login/next-env-vars.d.ts
similarity index 100%
rename from login/apps/login/next-env-vars.d.ts
rename to apps/login/next-env-vars.d.ts
diff --git a/login/apps/login/next-env.d.ts b/apps/login/next-env.d.ts
similarity index 100%
rename from login/apps/login/next-env.d.ts
rename to apps/login/next-env.d.ts
diff --git a/login/apps/login/next.config.mjs b/apps/login/next.config.mjs
similarity index 100%
rename from login/apps/login/next.config.mjs
rename to apps/login/next.config.mjs
diff --git a/login/apps/login/package.json b/apps/login/package.json
similarity index 60%
rename from login/apps/login/package.json
rename to apps/login/package.json
index 655aeb8f28..a4e02922ee 100644
--- a/login/apps/login/package.json
+++ b/apps/login/package.json
@@ -1,20 +1,25 @@
{
+ "packageManager": "pnpm@9.1.2+sha256.19c17528f9ca20bd442e4ca42f00f1b9808a9cb419383cd04ba32ef19322aba7",
"name": "@zitadel/login",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
- "dev:turbo": "next dev --turbopack",
- "test:unit": "pnpm vitest --run",
- "test:unit:standalone": "pnpm test:unit",
- "lint": "pnpm exec next lint && pnpm exec prettier --check .",
- "lint:fix": "pnpm exec prettier --write .",
+ "build": "next build",
+ "build:login:standalone": "NEXT_PUBLIC_BASE_PATH=/ui/v2/login NEXT_OUTPUT_MODE=standalone next build",
+ "start": "next start",
+ "lint": "pnpm run '/^lint:check:.*$/'",
+ "lint:check:next": "next lint",
+ "lint:check:prettier": "prettier --check .",
+ "lint:fix": "prettier --write .",
+ "test:unit": "vitest --run",
"lint-staged": "lint-staged",
- "build": "pnpm exec next build",
- "build:login:standalone": "NEXT_PUBLIC_BASE_PATH=/ui/v2/login NEXT_OUTPUT_MODE=standalone pnpm build",
- "start": "pnpm build && pnpm exec next start",
- "start:built": "pnpm exec next start",
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next"
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
+ "test:integration:login": "cypress run",
+ "test:integration:login:debug": "cypress open",
+ "test:acceptance": "dotenv -e ../login/.env.test.local playwright",
+ "test:acceptance:setup": "cd ../.. && make login_test_acceptance_setup_env && NODE_ENV=test turbo run test:acceptance:setup:dev",
+ "test:acceptance:setup:dev": "cd ../.. && make login_test_acceptance_setup_dev"
},
"git": {
"pre-commit": "lint-staged"
@@ -25,6 +30,7 @@
"dependencies": {
"@headlessui/react": "^2.1.9",
"@heroicons/react": "2.1.3",
+ "@radix-ui/react-tooltip": "^1.2.7",
"@tailwindcss/forms": "0.5.7",
"@vercel/analytics": "^1.2.2",
"@zitadel/client": "latest",
@@ -59,6 +65,7 @@
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vercel/git-hooks": "1.0.0",
+ "@vitejs/plugin-react": "^4.4.1",
"autoprefixer": "10.4.21",
"eslint": "^8.57.0",
"eslint-config-next": "15.4.0-canary.86",
@@ -75,6 +82,19 @@
"tailwindcss": "3.4.14",
"ts-proto": "^2.7.0",
"typescript": "^5.8.3",
- "vitest": "^2.0.0"
+ "vite-tsconfig-paths": "^5.1.4",
+ "vitest": "^2.0.0",
+ "concurrently": "^9.1.2",
+ "cypress": "^14.5.2",
+ "dotenv-cli": "^8.0.0",
+ "env-cmd": "^10.0.0",
+ "nodemon": "^3.1.9",
+ "start-server-and-test": "^2.0.11",
+ "@faker-js/faker": "^9.7.0",
+ "@otplib/core": "^12.0.0",
+ "@otplib/plugin-crypto": "^12.0.0",
+ "@otplib/plugin-thirty-two": "^12.0.0",
+ "@playwright/test": "^1.52.0",
+ "gaxios": "^7.1.0"
}
}
diff --git a/login/apps/login/postcss.config.cjs b/apps/login/postcss.config.cjs
similarity index 100%
rename from login/apps/login/postcss.config.cjs
rename to apps/login/postcss.config.cjs
diff --git a/login/apps/login/prettier.config.mjs b/apps/login/prettier.config.mjs
similarity index 100%
rename from login/apps/login/prettier.config.mjs
rename to apps/login/prettier.config.mjs
diff --git a/login/apps/login/public/checkbox.svg b/apps/login/public/checkbox.svg
similarity index 100%
rename from login/apps/login/public/checkbox.svg
rename to apps/login/public/checkbox.svg
diff --git a/login/apps/login/public/favicon.ico b/apps/login/public/favicon.ico
similarity index 100%
rename from login/apps/login/public/favicon.ico
rename to apps/login/public/favicon.ico
diff --git a/login/apps/login/public/favicon/android-chrome-192x192.png b/apps/login/public/favicon/android-chrome-192x192.png
similarity index 100%
rename from login/apps/login/public/favicon/android-chrome-192x192.png
rename to apps/login/public/favicon/android-chrome-192x192.png
diff --git a/login/apps/login/public/favicon/android-chrome-512x512.png b/apps/login/public/favicon/android-chrome-512x512.png
similarity index 100%
rename from login/apps/login/public/favicon/android-chrome-512x512.png
rename to apps/login/public/favicon/android-chrome-512x512.png
diff --git a/login/apps/login/public/favicon/apple-touch-icon.png b/apps/login/public/favicon/apple-touch-icon.png
similarity index 100%
rename from login/apps/login/public/favicon/apple-touch-icon.png
rename to apps/login/public/favicon/apple-touch-icon.png
diff --git a/login/apps/login/public/favicon/browserconfig.xml b/apps/login/public/favicon/browserconfig.xml
similarity index 100%
rename from login/apps/login/public/favicon/browserconfig.xml
rename to apps/login/public/favicon/browserconfig.xml
diff --git a/login/apps/login/public/favicon/favicon-16x16.png b/apps/login/public/favicon/favicon-16x16.png
similarity index 100%
rename from login/apps/login/public/favicon/favicon-16x16.png
rename to apps/login/public/favicon/favicon-16x16.png
diff --git a/login/apps/login/public/favicon/favicon-32x32.png b/apps/login/public/favicon/favicon-32x32.png
similarity index 100%
rename from login/apps/login/public/favicon/favicon-32x32.png
rename to apps/login/public/favicon/favicon-32x32.png
diff --git a/login/apps/login/public/favicon/favicon.ico b/apps/login/public/favicon/favicon.ico
similarity index 100%
rename from login/apps/login/public/favicon/favicon.ico
rename to apps/login/public/favicon/favicon.ico
diff --git a/login/apps/login/public/favicon/mstile-150x150.png b/apps/login/public/favicon/mstile-150x150.png
similarity index 100%
rename from login/apps/login/public/favicon/mstile-150x150.png
rename to apps/login/public/favicon/mstile-150x150.png
diff --git a/login/apps/login/public/favicon/site.webmanifest b/apps/login/public/favicon/site.webmanifest
similarity index 100%
rename from login/apps/login/public/favicon/site.webmanifest
rename to apps/login/public/favicon/site.webmanifest
diff --git a/login/apps/login/public/grid-dark.svg b/apps/login/public/grid-dark.svg
similarity index 100%
rename from login/apps/login/public/grid-dark.svg
rename to apps/login/public/grid-dark.svg
diff --git a/login/apps/login/public/grid-light.svg b/apps/login/public/grid-light.svg
similarity index 100%
rename from login/apps/login/public/grid-light.svg
rename to apps/login/public/grid-light.svg
diff --git a/login/apps/login/public/logo/zitadel-logo-solo-darkdesign.svg b/apps/login/public/logo/zitadel-logo-solo-darkdesign.svg
similarity index 100%
rename from login/apps/login/public/logo/zitadel-logo-solo-darkdesign.svg
rename to apps/login/public/logo/zitadel-logo-solo-darkdesign.svg
diff --git a/login/apps/login/public/logo/zitadel-logo-solo-lightdesign.svg b/apps/login/public/logo/zitadel-logo-solo-lightdesign.svg
similarity index 100%
rename from login/apps/login/public/logo/zitadel-logo-solo-lightdesign.svg
rename to apps/login/public/logo/zitadel-logo-solo-lightdesign.svg
diff --git a/login/apps/login/public/zitadel-logo-dark.svg b/apps/login/public/zitadel-logo-dark.svg
similarity index 100%
rename from login/apps/login/public/zitadel-logo-dark.svg
rename to apps/login/public/zitadel-logo-dark.svg
diff --git a/login/apps/login/public/zitadel-logo-light.svg b/apps/login/public/zitadel-logo-light.svg
similarity index 100%
rename from login/apps/login/public/zitadel-logo-light.svg
rename to apps/login/public/zitadel-logo-light.svg
diff --git a/apps/login/readme.md b/apps/login/readme.md
new file mode 100644
index 0000000000..cdde703f48
--- /dev/null
+++ b/apps/login/readme.md
@@ -0,0 +1,263 @@
+# ZITADEL TypeScript with Turborepo
+
+This repository contains all TypeScript and JavaScript packages and applications you need to create your own ZITADEL
+Login UI.
+
+
+
+[](https://www.npmjs.com/package/@zitadel/proto)
+[](https://www.npmjs.com/package/@zitadel/client)
+
+**⚠️ This repo and packages are in beta state and subject to change ⚠️**
+
+The scope of functionality of this repo and packages is under active development.
+
+The `@zitadel/client` package is using [@connectrpc/connect](https://github.com/connectrpc/connect-es#readme).
+
+You can read the [contribution guide](/CONTRIBUTING.md) on how to contribute.
+Questions can be raised in our [Discord channel](https://discord.gg/erh5Brh7jE) or as
+a [GitHub issue](https://github.com/zitadel/typescript/issues).
+
+## Developing Your Own ZITADEL Login UI
+
+We think the easiest path of getting up and running, is the following:
+
+1. Fork and clone this repository
+1. Rename the file .github/dependabot.example.yml to .github/dependabot.yml so you don't miss version and security updates.
+1. [Run the ZITADEL Cloud login UI locally](#run-login-ui)
+1. Make changes to the code and see the effects live on your local machine
+1. Study the rest of this README.md and get familiar and comfortable with how everything works.
+1. Decide on a way of how you want to build and run your login UI.
+ You can reuse ZITADEL Clouds way.
+ But if you need more freedom, you can also import the packages you need into your self built application.
+
+## Included Apps And Packages
+
+- `login`: The login UI used by ZITADEL Cloud, powered by Next.js
+- `@zitadel/client`: shared client utilities for node and browser environments
+- `@zitadel/proto`: Protocol Buffers (proto) definitions used by ZITADEL projects
+
+Each package and app is 100% [TypeScript](https://www.typescriptlang.org/).
+
+### Login
+
+The login is currently in a work in progress state.
+The goal is to implement a login UI, using the session API of ZITADEL, which also implements the OIDC Standard and is
+ready to use for everyone.
+
+In the first phase we want to have a MVP login ready with the OIDC Standard and a basic feature set. In a second step
+the features will be extended.
+
+This list should show the current implementation state, and also what is missing.
+You can already use the current state, and extend it with your needs.
+
+#### Features list
+
+- [x] Local User Registration (with Password)
+- [x] User Registration and Login with external Provider
+ - [x] Google
+ - [x] GitHub
+ - [x] GitHub Enterprise
+ - [x] GitLab
+ - [x] GitLab Enterprise
+ - [x] Azure
+ - [x] Apple
+ - [x] Generic OIDC
+ - [x] Generic OAuth
+ - [x] Generic JWT
+ - [x] LDAP
+ - [x] SAML SP
+- Multifactor Registration an Login
+ - [x] Passkeys
+ - [x] TOTP
+ - [x] OTP: Email Code
+ - [x] OTP: SMS Code
+- [x] Password Change/Reset
+- [x] Domain Discovery
+- [x] Branding
+- OIDC Standard
+
+ - [x] Authorization Code Flow with PKCE
+ - [x] AuthRequest `hintUserId`
+ - [x] AuthRequest `loginHint`
+ - [x] AuthRequest `prompt`
+ - [x] Login
+ - [x] Select Account
+ - [ ] Consent
+ - [x] Create
+ - Scopes
+ - [x] `openid email profile address``
+ - [x] `offline access`
+ - [x] `urn:zitadel:iam:org:idp:id:{idp_id}`
+ - [x] `urn:zitadel:iam:org:project:id:zitadel:aud`
+ - [x] `urn:zitadel:iam:org:id:{orgid}`
+ - [x] `urn:zitadel:iam:org:domain:primary:{domain}`
+ - [ ] AuthRequest UI locales
+
+ #### Flow diagram
+
+ This diagram shows the available pages and flows.
+
+ > Note that back navigation or retries are not displayed.
+
+```mermaid
+ flowchart TD
+ A[Start] --> register
+ A[Start] --> accounts
+ A[Start] --> loginname
+ loginname -- signInWithIDP --> idp-success
+ loginname -- signInWithIDP --> idp-failure
+ idp-success --> B[signedin]
+ loginname --> password
+ loginname -- hasPasskey --> passkey
+ loginname -- allowRegister --> register
+ passkey-add --passwordAllowed --> password
+ passkey -- hasPassword --> password
+ passkey --> B[signedin]
+ password -- hasMFA --> mfa
+ password -- allowPasskeys --> passkey-add
+ password -- reset --> password-set
+ email -- reset --> password-set
+ password-set --> B[signedin]
+ password-change --> B[signedin]
+ password -- userstate=initial --> password-change
+
+ mfa --> otp
+ otp --> B[signedin]
+ mfa--> u2f
+ u2f -->B[signedin]
+ register -- password/passkey --> B[signedin]
+ password --> B[signedin]
+ password-- forceMFA -->mfaset
+ mfaset --> u2fset
+ mfaset --> otpset
+ u2fset --> B[signedin]
+ otpset --> B[signedin]
+ accounts--> loginname
+ password -- not verified yet -->verify
+ register-- withpassword -->verify
+ passkey-- notVerified --> verify
+ verify --> B[signedin]
+```
+
+You can find a more detailed documentation of the different pages [here](./apps/login/readme.md).
+
+#### Custom translations
+
+The new login uses the [SettingsApi](https://zitadel.com/docs/apis/resources/settings_service_v2/settings-service-get-hosted-login-translation) to load custom translations.
+Translations can be overriden at both the instance and organization levels.
+To find the keys more easily, you can inspect the HTML and search for a `data-i18n-key` attribute, or look at the defaults in `/apps/login/locales/[locale].ts`.
+
+
+## Tooling
+
+- [TypeScript](https://www.typescriptlang.org/) for static type checking
+- [ESLint](https://eslint.org/) for code linting
+- [Prettier](https://prettier.io) for code formatting
+
+## Useful Commands
+
+- `make login-quality` - Check the quality of your code against a production build without installing any dependencies besides Docker
+- `pnpm generate` - Build proto stubs for the client package
+- `pnpm dev` - Develop all packages and the login app
+- `pnpm build` - Build all packages and the login app
+- `pnpm clean` - Clean up all `node_modules` and `dist` folders (runs each package's clean script)
+
+Learn more about developing the login UI in the [contribution guide](/CONTRIBUTING.md).
+
+## Versioning And Publishing Packages
+
+Package publishing has been configured using [Changesets](https://github.com/changesets/changesets).
+Here is their [documentation](https://github.com/changesets/changesets#documentation) for more information about the
+workflow.
+
+The [GitHub Action](https://github.com/changesets/action) needs an `NPM_TOKEN` and `GITHUB_TOKEN` in the repository
+settings. The [Changesets bot](https://github.com/apps/changeset-bot) should also be installed on the GitHub repository.
+
+Read the [changesets documentation](https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md)
+for more information about this automation
+
+### Run Login UI
+
+To run the application make sure to install the dependencies with
+
+```sh
+pnpm install
+```
+
+then generate the GRPC stubs with
+
+```sh
+pnpm generate
+```
+
+To run the application against a local ZITADEL instance, run the following command:
+
+```sh
+pnpm run-zitadel
+```
+
+This sets up ZITADEL using docker compose and writes the configuration to the file `apps/login/.env.local`.
+
+
+Alternatively, use another environment
+You can develop against any ZITADEL instance in which you have sufficient rights to execute the following steps.
+Just create or overwrite the file `apps/login/.env.local` yourself.
+Add your instances base URL to the file at the key `ZITADEL_API_URL`.
+Go to your instance and create a service user for the login application.
+The login application creates users on your primary organization and reads policy data.
+For the sake of simplicity, just make the service user an instance member with the role `IAM_OWNER`.
+Create a PAT and copy it to the file `apps/login/.env.local` using the key `ZITADEL_SERVICE_USER_TOKEN`.
+
+The file should look similar to this:
+
+```
+ZITADEL_API_URL=https://zitadel-tlx3du.us1.zitadel.cloud
+ZITADEL_SERVICE_USER_TOKEN=1S6w48thfWFI2klgfwkCnhXJLf9FQ457E-_3H74ePQxfO3Af0Tm4V5Xi-ji7urIl_xbn-Rk
+```
+
+
+
+Start the login application in dev mode:
+
+```sh
+pnpm dev
+```
+
+Open the login application with your favorite browser at `localhost:3000`.
+Change the source code and see the changes live in your browser.
+
+Make sure the application still behaves as expected by running all tests
+
+```sh
+pnpm test
+```
+
+To satisfy your unique workflow requirements, check out the package.json in the root directory for more detailed scripts.
+
+### Run Login UI Acceptance tests
+
+To run the acceptance tests you need a running ZITADEL environment and a component which receives HTTP requests for the emails and sms's.
+This component should also be able to return the content of these notifications, as the codes and links are used in the login flows.
+There is a basic implementation in Golang available under [the sink package](./acceptance/sink).
+
+To setup ZITADEL with the additional Sink container for handling the notifications:
+
+```sh
+pnpm run-sink
+```
+
+Then you can start the acceptance tests with:
+
+```sh
+pnpm test:acceptance
+```
+
+### Deploy to Vercel
+
+To deploy your own version on Vercel, navigate to your instance and create a service user.
+Then create a personal access token (PAT), copy and set it as ZITADEL_SERVICE_USER_TOKEN, then navigate to your instance
+settings and make sure it gets IAM_OWNER permissions.
+Finally set your instance url as ZITADEL_API_URL. Make sure to set it without trailing slash.
+
+[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzitadel%2Ftypescript&env=ZITADEL_API_URL,ZITADEL_SERVICE_USER_TOKEN&root-directory=apps/login&envDescription=Setup%20a%20service%20account%20with%20IAM_LOGIN_CLIENT%20membership%20on%20your%20instance%20and%20provide%20its%20personal%20access%20token.&project-name=zitadel-login&repository-name=zitadel-login)
diff --git a/login/apps/login/screenshots/accounts.png b/apps/login/screenshots/accounts.png
similarity index 100%
rename from login/apps/login/screenshots/accounts.png
rename to apps/login/screenshots/accounts.png
diff --git a/login/apps/login/screenshots/accounts_jumpto.png b/apps/login/screenshots/accounts_jumpto.png
similarity index 100%
rename from login/apps/login/screenshots/accounts_jumpto.png
rename to apps/login/screenshots/accounts_jumpto.png
diff --git a/login/apps/login/screenshots/collage.png b/apps/login/screenshots/collage.png
similarity index 100%
rename from login/apps/login/screenshots/collage.png
rename to apps/login/screenshots/collage.png
diff --git a/login/apps/login/screenshots/idp.png b/apps/login/screenshots/idp.png
similarity index 100%
rename from login/apps/login/screenshots/idp.png
rename to apps/login/screenshots/idp.png
diff --git a/login/apps/login/screenshots/loginname.png b/apps/login/screenshots/loginname.png
similarity index 100%
rename from login/apps/login/screenshots/loginname.png
rename to apps/login/screenshots/loginname.png
diff --git a/login/apps/login/screenshots/mfa.png b/apps/login/screenshots/mfa.png
similarity index 100%
rename from login/apps/login/screenshots/mfa.png
rename to apps/login/screenshots/mfa.png
diff --git a/login/apps/login/screenshots/mfaset.png b/apps/login/screenshots/mfaset.png
similarity index 100%
rename from login/apps/login/screenshots/mfaset.png
rename to apps/login/screenshots/mfaset.png
diff --git a/login/apps/login/screenshots/otp.png b/apps/login/screenshots/otp.png
similarity index 100%
rename from login/apps/login/screenshots/otp.png
rename to apps/login/screenshots/otp.png
diff --git a/login/apps/login/screenshots/otpset.png b/apps/login/screenshots/otpset.png
similarity index 100%
rename from login/apps/login/screenshots/otpset.png
rename to apps/login/screenshots/otpset.png
diff --git a/login/apps/login/screenshots/passkey.png b/apps/login/screenshots/passkey.png
similarity index 100%
rename from login/apps/login/screenshots/passkey.png
rename to apps/login/screenshots/passkey.png
diff --git a/login/apps/login/screenshots/password.png b/apps/login/screenshots/password.png
similarity index 100%
rename from login/apps/login/screenshots/password.png
rename to apps/login/screenshots/password.png
diff --git a/login/apps/login/screenshots/password_change.png b/apps/login/screenshots/password_change.png
similarity index 100%
rename from login/apps/login/screenshots/password_change.png
rename to apps/login/screenshots/password_change.png
diff --git a/login/apps/login/screenshots/password_set.png b/apps/login/screenshots/password_set.png
similarity index 100%
rename from login/apps/login/screenshots/password_set.png
rename to apps/login/screenshots/password_set.png
diff --git a/login/apps/login/screenshots/register.png b/apps/login/screenshots/register.png
similarity index 100%
rename from login/apps/login/screenshots/register.png
rename to apps/login/screenshots/register.png
diff --git a/login/apps/login/screenshots/register_password.png b/apps/login/screenshots/register_password.png
similarity index 100%
rename from login/apps/login/screenshots/register_password.png
rename to apps/login/screenshots/register_password.png
diff --git a/login/apps/login/screenshots/signedin.png b/apps/login/screenshots/signedin.png
similarity index 100%
rename from login/apps/login/screenshots/signedin.png
rename to apps/login/screenshots/signedin.png
diff --git a/login/apps/login/screenshots/u2f.png b/apps/login/screenshots/u2f.png
similarity index 100%
rename from login/apps/login/screenshots/u2f.png
rename to apps/login/screenshots/u2f.png
diff --git a/login/apps/login/screenshots/u2fset.png b/apps/login/screenshots/u2fset.png
similarity index 100%
rename from login/apps/login/screenshots/u2fset.png
rename to apps/login/screenshots/u2fset.png
diff --git a/login/apps/login/screenshots/verify.png b/apps/login/screenshots/verify.png
similarity index 100%
rename from login/apps/login/screenshots/verify.png
rename to apps/login/screenshots/verify.png
diff --git a/login/scripts/entrypoint.sh b/apps/login/scripts/entrypoint.sh
similarity index 88%
rename from login/scripts/entrypoint.sh
rename to apps/login/scripts/entrypoint.sh
index c537e8b8fb..123612d1cb 100755
--- a/login/scripts/entrypoint.sh
+++ b/apps/login/scripts/entrypoint.sh
@@ -8,4 +8,6 @@ if [ -n "${ZITADEL_SERVICE_USER_TOKEN_FILE}" ] && [ -f "${ZITADEL_SERVICE_USER_T
export ZITADEL_SERVICE_USER_TOKEN=$(cat "${ZITADEL_SERVICE_USER_TOKEN_FILE}")
fi
-exec node apps/login/server.js
+
+
+exec node /runtime/apps/login/apps/login/server.js
diff --git a/apps/login/scripts/healthcheck.js b/apps/login/scripts/healthcheck.js
new file mode 100644
index 0000000000..652524154a
--- /dev/null
+++ b/apps/login/scripts/healthcheck.js
@@ -0,0 +1,14 @@
+const url = process.argv[2];
+
+if (!url) {
+ console.error("❌ No URL provided as command line argument.");
+ process.exit(1);
+}
+
+try {
+ const res = await fetch(url);
+ if (!res.ok) process.exit(1);
+ process.exit(0);
+} catch (e) {
+ process.exit(1);
+}
diff --git a/login/apps/login/src/app/(login)/accounts/page.tsx b/apps/login/src/app/(login)/accounts/page.tsx
similarity index 95%
rename from login/apps/login/src/app/(login)/accounts/page.tsx
rename to apps/login/src/app/(login)/accounts/page.tsx
index cebcd014bb..e4e6b387dc 100644
--- a/login/apps/login/src/app/(login)/accounts/page.tsx
+++ b/apps/login/src/app/(login)/accounts/page.tsx
@@ -15,12 +15,12 @@ import { headers } from "next/headers";
import Link from "next/link";
async function loadSessions({ serviceUrl }: { serviceUrl: string }) {
- const ids: (string | undefined)[] = await getAllSessionCookieIds();
+ const cookieIds = await getAllSessionCookieIds();
- if (ids && ids.length) {
+ if (cookieIds && cookieIds.length) {
const response = await listSessions({
serviceUrl,
- ids: ids.filter((id) => !!id) as string[],
+ ids: cookieIds.filter((id) => !!id) as string[],
});
return response?.sessions ?? [];
} else {
diff --git a/login/apps/login/src/app/(login)/authenticator/set/page.tsx b/apps/login/src/app/(login)/authenticator/set/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/authenticator/set/page.tsx
rename to apps/login/src/app/(login)/authenticator/set/page.tsx
diff --git a/login/apps/login/src/app/(login)/device/consent/page.tsx b/apps/login/src/app/(login)/device/consent/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/device/consent/page.tsx
rename to apps/login/src/app/(login)/device/consent/page.tsx
diff --git a/login/apps/login/src/app/(login)/device/page.tsx b/apps/login/src/app/(login)/device/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/device/page.tsx
rename to apps/login/src/app/(login)/device/page.tsx
diff --git a/login/apps/login/src/app/(login)/error.tsx b/apps/login/src/app/(login)/error.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/error.tsx
rename to apps/login/src/app/(login)/error.tsx
diff --git a/login/apps/login/src/app/(login)/idp/[provider]/failure/page.tsx b/apps/login/src/app/(login)/idp/[provider]/failure/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/idp/[provider]/failure/page.tsx
rename to apps/login/src/app/(login)/idp/[provider]/failure/page.tsx
diff --git a/login/apps/login/src/app/(login)/idp/[provider]/success/page.tsx b/apps/login/src/app/(login)/idp/[provider]/success/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/idp/[provider]/success/page.tsx
rename to apps/login/src/app/(login)/idp/[provider]/success/page.tsx
diff --git a/login/apps/login/src/app/(login)/idp/ldap/page.tsx b/apps/login/src/app/(login)/idp/ldap/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/idp/ldap/page.tsx
rename to apps/login/src/app/(login)/idp/ldap/page.tsx
diff --git a/login/apps/login/src/app/(login)/idp/page.tsx b/apps/login/src/app/(login)/idp/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/idp/page.tsx
rename to apps/login/src/app/(login)/idp/page.tsx
diff --git a/apps/login/src/app/(login)/layout.tsx b/apps/login/src/app/(login)/layout.tsx
new file mode 100644
index 0000000000..dbce9804c9
--- /dev/null
+++ b/apps/login/src/app/(login)/layout.tsx
@@ -0,0 +1,65 @@
+import "@/styles/globals.scss";
+
+import { LanguageProvider } from "@/components/language-provider";
+import { LanguageSwitcher } from "@/components/language-switcher";
+import { Skeleton } from "@/components/skeleton";
+import { Theme } from "@/components/theme";
+import { ThemeProvider } from "@/components/theme-provider";
+import * as Tooltip from "@radix-ui/react-tooltip";
+import { Analytics } from "@vercel/analytics/react";
+import { Lato } from "next/font/google";
+import { ReactNode, Suspense } from "react";
+
+const lato = Lato({
+ weight: ["400", "700", "900"],
+ subsets: ["latin"],
+});
+
+export default async function RootLayout({
+ children,
+}: {
+ children: ReactNode;
+}) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ >
+
+
+
+ {children}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/login/apps/login/src/app/(login)/loginname/page.tsx b/apps/login/src/app/(login)/loginname/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/loginname/page.tsx
rename to apps/login/src/app/(login)/loginname/page.tsx
diff --git a/login/apps/login/src/app/(login)/logout/page.tsx b/apps/login/src/app/(login)/logout/page.tsx
similarity index 90%
rename from login/apps/login/src/app/(login)/logout/page.tsx
rename to apps/login/src/app/(login)/logout/page.tsx
index 853461d7d6..71371fc129 100644
--- a/login/apps/login/src/app/(login)/logout/page.tsx
+++ b/apps/login/src/app/(login)/logout/page.tsx
@@ -12,12 +12,12 @@ import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { headers } from "next/headers";
async function loadSessions({ serviceUrl }: { serviceUrl: string }) {
- const ids: (string | undefined)[] = await getAllSessionCookieIds();
+ const cookieIds = await getAllSessionCookieIds();
- if (ids && ids.length) {
+ if (cookieIds && cookieIds.length) {
const response = await listSessions({
serviceUrl,
- ids: ids.filter((id) => !!id) as string[],
+ ids: cookieIds.filter((id) => !!id) as string[],
});
return response?.sessions ?? [];
} else {
@@ -34,7 +34,8 @@ export default async function Page(props: {
const organization = searchParams?.organization;
const postLogoutRedirectUri = searchParams?.post_logout_redirect_uri;
const logoutHint = searchParams?.logout_hint;
- const UILocales = searchParams?.ui_locales; // TODO implement with new translation service
+ // TODO implement with new translation service
+ // const UILocales = searchParams?.ui_locales;
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
diff --git a/login/apps/login/src/app/(login)/logout/success/page.tsx b/apps/login/src/app/(login)/logout/success/page.tsx
similarity index 70%
rename from login/apps/login/src/app/(login)/logout/success/page.tsx
rename to apps/login/src/app/(login)/logout/success/page.tsx
index e7ec459f03..a13564664c 100644
--- a/login/apps/login/src/app/(login)/logout/success/page.tsx
+++ b/apps/login/src/app/(login)/logout/success/page.tsx
@@ -1,8 +1,7 @@
import { DynamicTheme } from "@/components/dynamic-theme";
import { Translated } from "@/components/translated";
import { getServiceUrlFromHeaders } from "@/lib/service-url";
-import { getBrandingSettings, getDefaultOrg } from "@/lib/zitadel";
-import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
+import { getBrandingSettings } from "@/lib/zitadel";
import { headers } from "next/headers";
export default async function Page(props: { searchParams: Promise }) {
@@ -11,17 +10,7 @@ export default async function Page(props: { searchParams: Promise }) {
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
- const { login_hint, organization } = searchParams;
-
- let defaultOrganization;
- if (!organization) {
- const org: Organization | null = await getDefaultOrg({
- serviceUrl,
- });
- if (org) {
- defaultOrganization = org.id;
- }
- }
+ const { organization } = searchParams;
const branding = await getBrandingSettings({
serviceUrl,
diff --git a/login/apps/login/src/app/(login)/mfa/page.tsx b/apps/login/src/app/(login)/mfa/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/mfa/page.tsx
rename to apps/login/src/app/(login)/mfa/page.tsx
diff --git a/login/apps/login/src/app/(login)/mfa/set/page.tsx b/apps/login/src/app/(login)/mfa/set/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/mfa/set/page.tsx
rename to apps/login/src/app/(login)/mfa/set/page.tsx
diff --git a/login/apps/login/src/app/(login)/otp/[method]/page.tsx b/apps/login/src/app/(login)/otp/[method]/page.tsx
similarity index 94%
rename from login/apps/login/src/app/(login)/otp/[method]/page.tsx
rename to apps/login/src/app/(login)/otp/[method]/page.tsx
index af4159d62e..1b1356315a 100644
--- a/login/apps/login/src/app/(login)/otp/[method]/page.tsx
+++ b/apps/login/src/app/(login)/otp/[method]/page.tsx
@@ -30,28 +30,22 @@ export default async function Page(props: {
const {
loginName, // send from password page
- userId, // send from email link
requestId,
sessionId,
organization,
code,
- submit,
} = searchParams;
const { method } = params;
const session = sessionId
- ? await loadSessionById(serviceUrl, sessionId, organization)
+ ? await loadSessionById(sessionId, organization)
: await loadMostRecentSession({
serviceUrl,
sessionParams: { loginName, organization },
});
- async function loadSessionById(
- host: string,
- sessionId: string,
- organization?: string,
- ) {
+ async function loadSessionById(sessionId: string, organization?: string) {
const recent = await getSessionCookieById({ sessionId, organization });
return getSession({
serviceUrl,
diff --git a/login/apps/login/src/app/(login)/otp/[method]/set/page.tsx b/apps/login/src/app/(login)/otp/[method]/set/page.tsx
similarity index 96%
rename from login/apps/login/src/app/(login)/otp/[method]/set/page.tsx
rename to apps/login/src/app/(login)/otp/[method]/set/page.tsx
index f74093ce8e..4624dc9eba 100644
--- a/login/apps/login/src/app/(login)/otp/[method]/set/page.tsx
+++ b/apps/login/src/app/(login)/otp/[method]/set/page.tsx
@@ -66,20 +66,20 @@ export default async function Page(props: {
error = err;
});
} else if (method === "sms") {
- // does not work
await addOTPSMS({
serviceUrl,
userId: session.factors.user.id,
- }).catch((error) => {
- error = new Error("Could not add OTP via SMS");
+ }).catch((_error) => {
+ // TODO: Throw this error?
+ new Error("Could not add OTP via SMS");
});
} else if (method === "email") {
- // works
await addOTPEmail({
serviceUrl,
userId: session.factors.user.id,
- }).catch((error) => {
- error = new Error("Could not add OTP via Email");
+ }).catch((_error) => {
+ // TODO: Throw this error?
+ new Error("Could not add OTP via Email");
});
} else {
throw new Error("Invalid method");
@@ -106,6 +106,7 @@ export default async function Page(props: {
paramsToContinue.append("requestId", requestId);
}
urlToContinue = `/otp/${method}?` + paramsToContinue;
+
// immediately check the OTP on the next page if sms or email was set up
if (["email", "sms"].includes(method)) {
return redirect(urlToContinue);
diff --git a/login/apps/login/src/app/(login)/page.tsx b/apps/login/src/app/(login)/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/page.tsx
rename to apps/login/src/app/(login)/page.tsx
diff --git a/login/apps/login/src/app/(login)/passkey/page.tsx b/apps/login/src/app/(login)/passkey/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/passkey/page.tsx
rename to apps/login/src/app/(login)/passkey/page.tsx
diff --git a/login/apps/login/src/app/(login)/passkey/set/page.tsx b/apps/login/src/app/(login)/passkey/set/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/passkey/set/page.tsx
rename to apps/login/src/app/(login)/passkey/set/page.tsx
diff --git a/login/apps/login/src/app/(login)/password/change/page.tsx b/apps/login/src/app/(login)/password/change/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/password/change/page.tsx
rename to apps/login/src/app/(login)/password/change/page.tsx
diff --git a/login/apps/login/src/app/(login)/password/page.tsx b/apps/login/src/app/(login)/password/page.tsx
similarity index 97%
rename from login/apps/login/src/app/(login)/password/page.tsx
rename to apps/login/src/app/(login)/password/page.tsx
index 461c095157..a9ab4091f9 100644
--- a/login/apps/login/src/app/(login)/password/page.tsx
+++ b/apps/login/src/app/(login)/password/page.tsx
@@ -17,7 +17,7 @@ export default async function Page(props: {
searchParams: Promise>;
}) {
const searchParams = await props.searchParams;
- let { loginName, organization, requestId, alt } = searchParams;
+ let { loginName, organization, requestId } = searchParams;
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
diff --git a/login/apps/login/src/app/(login)/password/set/page.tsx b/apps/login/src/app/(login)/password/set/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/password/set/page.tsx
rename to apps/login/src/app/(login)/password/set/page.tsx
diff --git a/login/apps/login/src/app/(login)/register/page.tsx b/apps/login/src/app/(login)/register/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/register/page.tsx
rename to apps/login/src/app/(login)/register/page.tsx
diff --git a/login/apps/login/src/app/(login)/register/password/page.tsx b/apps/login/src/app/(login)/register/password/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/register/password/page.tsx
rename to apps/login/src/app/(login)/register/password/page.tsx
diff --git a/login/apps/login/src/app/(login)/saml-post/route.ts b/apps/login/src/app/(login)/saml-post/route.ts
similarity index 100%
rename from login/apps/login/src/app/(login)/saml-post/route.ts
rename to apps/login/src/app/(login)/saml-post/route.ts
diff --git a/login/apps/login/src/app/(login)/signedin/page.tsx b/apps/login/src/app/(login)/signedin/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/signedin/page.tsx
rename to apps/login/src/app/(login)/signedin/page.tsx
diff --git a/login/apps/login/src/app/(login)/u2f/page.tsx b/apps/login/src/app/(login)/u2f/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/u2f/page.tsx
rename to apps/login/src/app/(login)/u2f/page.tsx
diff --git a/login/apps/login/src/app/(login)/u2f/set/page.tsx b/apps/login/src/app/(login)/u2f/set/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/u2f/set/page.tsx
rename to apps/login/src/app/(login)/u2f/set/page.tsx
diff --git a/login/apps/login/src/app/(login)/verify/page.tsx b/apps/login/src/app/(login)/verify/page.tsx
similarity index 100%
rename from login/apps/login/src/app/(login)/verify/page.tsx
rename to apps/login/src/app/(login)/verify/page.tsx
diff --git a/login/apps/login/src/app/(login)/verify/success/page.tsx b/apps/login/src/app/(login)/verify/success/page.tsx
similarity index 96%
rename from login/apps/login/src/app/(login)/verify/success/page.tsx
rename to apps/login/src/app/(login)/verify/success/page.tsx
index f216226f7c..5427ecd90e 100644
--- a/login/apps/login/src/app/(login)/verify/success/page.tsx
+++ b/apps/login/src/app/(login)/verify/success/page.tsx
@@ -13,7 +13,7 @@ export default async function Page(props: { searchParams: Promise }) {
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
- const { loginName, requestId, organization, userId } = searchParams;
+ const { loginName, organization, userId } = searchParams;
const branding = await getBrandingSettings({
serviceUrl,
diff --git a/login/apps/login/src/app/global-error.tsx b/apps/login/src/app/global-error.tsx
similarity index 100%
rename from login/apps/login/src/app/global-error.tsx
rename to apps/login/src/app/global-error.tsx
diff --git a/login/apps/login/src/app/healthy/route.ts b/apps/login/src/app/healthy/route.ts
similarity index 100%
rename from login/apps/login/src/app/healthy/route.ts
rename to apps/login/src/app/healthy/route.ts
diff --git a/login/apps/login/src/app/login/route.ts b/apps/login/src/app/login/route.ts
similarity index 100%
rename from login/apps/login/src/app/login/route.ts
rename to apps/login/src/app/login/route.ts
diff --git a/login/apps/login/src/app/security/route.ts b/apps/login/src/app/security/route.ts
similarity index 100%
rename from login/apps/login/src/app/security/route.ts
rename to apps/login/src/app/security/route.ts
diff --git a/login/apps/login/src/components/address-bar.tsx b/apps/login/src/components/address-bar.tsx
similarity index 100%
rename from login/apps/login/src/components/address-bar.tsx
rename to apps/login/src/components/address-bar.tsx
diff --git a/login/apps/login/src/components/alert.tsx b/apps/login/src/components/alert.tsx
similarity index 98%
rename from login/apps/login/src/components/alert.tsx
rename to apps/login/src/components/alert.tsx
index fa18b750f2..01f82627cd 100644
--- a/login/apps/login/src/components/alert.tsx
+++ b/apps/login/src/components/alert.tsx
@@ -17,7 +17,7 @@ export enum AlertType {
const yellow =
"border-yellow-600/40 dark:border-yellow-500/20 bg-yellow-200/30 text-yellow-600 dark:bg-yellow-700/20 dark:text-yellow-200";
-const red =
+// const red =
"border-red-600/40 dark:border-red-500/20 bg-red-200/30 text-red-600 dark:bg-red-700/20 dark:text-red-200";
const neutral =
"border-divider-light dark:border-divider-dark bg-black/5 text-gray-600 dark:bg-white/10 dark:text-gray-200";
diff --git a/login/apps/login/src/components/app-avatar.tsx b/apps/login/src/components/app-avatar.tsx
similarity index 100%
rename from login/apps/login/src/components/app-avatar.tsx
rename to apps/login/src/components/app-avatar.tsx
diff --git a/login/apps/login/src/components/auth-methods.tsx b/apps/login/src/components/auth-methods.tsx
similarity index 100%
rename from login/apps/login/src/components/auth-methods.tsx
rename to apps/login/src/components/auth-methods.tsx
diff --git a/login/apps/login/src/components/authentication-method-radio.tsx b/apps/login/src/components/authentication-method-radio.tsx
similarity index 99%
rename from login/apps/login/src/components/authentication-method-radio.tsx
rename to apps/login/src/components/authentication-method-radio.tsx
index 121e257485..93a42ab5f4 100644
--- a/login/apps/login/src/components/authentication-method-radio.tsx
+++ b/apps/login/src/components/authentication-method-radio.tsx
@@ -43,7 +43,7 @@ export function AuthenticationMethodRadio({
} boder-divider-light relative flex h-full flex-1 cursor-pointer rounded-lg border px-5 py-4 hover:shadow-lg focus:outline-none dark:border-divider-dark dark:hover:bg-white/10`
}
>
- {({ active, checked }) => (
+ {({ checked }) => (
<>
{method === "passkey" && (
diff --git a/login/apps/login/src/components/avatar.tsx b/apps/login/src/components/avatar.tsx
similarity index 100%
rename from login/apps/login/src/components/avatar.tsx
rename to apps/login/src/components/avatar.tsx
diff --git a/login/apps/login/src/components/back-button.tsx b/apps/login/src/components/back-button.tsx
similarity index 100%
rename from login/apps/login/src/components/back-button.tsx
rename to apps/login/src/components/back-button.tsx
diff --git a/login/apps/login/src/components/boundary.tsx b/apps/login/src/components/boundary.tsx
similarity index 100%
rename from login/apps/login/src/components/boundary.tsx
rename to apps/login/src/components/boundary.tsx
diff --git a/login/apps/login/src/components/button.tsx b/apps/login/src/components/button.tsx
similarity index 100%
rename from login/apps/login/src/components/button.tsx
rename to apps/login/src/components/button.tsx
diff --git a/login/apps/login/src/components/change-password-form.tsx b/apps/login/src/components/change-password-form.tsx
similarity index 96%
rename from login/apps/login/src/components/change-password-form.tsx
rename to apps/login/src/components/change-password-form.tsx
index 1c93e4ae23..6124812e27 100644
--- a/login/apps/login/src/components/change-password-form.tsx
+++ b/apps/login/src/components/change-password-form.tsx
@@ -15,6 +15,7 @@ import { ChecksSchema } from "@zitadel/proto/zitadel/session/v2/session_service_
import { PasswordComplexitySettings } from "@zitadel/proto/zitadel/settings/v2/password_settings_pb";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { useTranslations } from "next-intl";
import { FieldValues, useForm } from "react-hook-form";
import { Alert } from "./alert";
import { BackButton } from "./back-button";
@@ -56,6 +57,8 @@ export function ChangePasswordForm({
},
});
+ const t = useTranslations("password");
+
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
@@ -156,7 +159,7 @@ export function ChangePasswordForm({
autoComplete="new-password"
required
{...register("password", {
- required: "You have to provide a new password!",
+ required: t("change.required.newPassword"),
})}
label="New Password"
error={errors.password?.message as string}
@@ -169,7 +172,7 @@ export function ChangePasswordForm({
required
autoComplete="new-password"
{...register("confirmPassword", {
- required: "This field is required",
+ required: t("change.required.confirmPassword"),
})}
label="Confirm Password"
error={errors.confirmPassword?.message as string}
diff --git a/login/apps/login/src/components/checkbox.tsx b/apps/login/src/components/checkbox.tsx
similarity index 100%
rename from login/apps/login/src/components/checkbox.tsx
rename to apps/login/src/components/checkbox.tsx
diff --git a/login/apps/login/src/components/choose-authenticator-to-login.tsx b/apps/login/src/components/choose-authenticator-to-login.tsx
similarity index 100%
rename from login/apps/login/src/components/choose-authenticator-to-login.tsx
rename to apps/login/src/components/choose-authenticator-to-login.tsx
diff --git a/login/apps/login/src/components/choose-authenticator-to-setup.tsx b/apps/login/src/components/choose-authenticator-to-setup.tsx
similarity index 100%
rename from login/apps/login/src/components/choose-authenticator-to-setup.tsx
rename to apps/login/src/components/choose-authenticator-to-setup.tsx
diff --git a/login/apps/login/src/components/choose-second-factor-to-setup.tsx b/apps/login/src/components/choose-second-factor-to-setup.tsx
similarity index 100%
rename from login/apps/login/src/components/choose-second-factor-to-setup.tsx
rename to apps/login/src/components/choose-second-factor-to-setup.tsx
diff --git a/login/apps/login/src/components/choose-second-factor.tsx b/apps/login/src/components/choose-second-factor.tsx
similarity index 100%
rename from login/apps/login/src/components/choose-second-factor.tsx
rename to apps/login/src/components/choose-second-factor.tsx
diff --git a/login/apps/login/src/components/consent.tsx b/apps/login/src/components/consent.tsx
similarity index 100%
rename from login/apps/login/src/components/consent.tsx
rename to apps/login/src/components/consent.tsx
diff --git a/login/apps/login/src/components/copy-to-clipboard.tsx b/apps/login/src/components/copy-to-clipboard.tsx
similarity index 100%
rename from login/apps/login/src/components/copy-to-clipboard.tsx
rename to apps/login/src/components/copy-to-clipboard.tsx
diff --git a/login/apps/login/src/components/default-tags.tsx b/apps/login/src/components/default-tags.tsx
similarity index 100%
rename from login/apps/login/src/components/default-tags.tsx
rename to apps/login/src/components/default-tags.tsx
diff --git a/login/apps/login/src/components/device-code-form.tsx b/apps/login/src/components/device-code-form.tsx
similarity index 93%
rename from login/apps/login/src/components/device-code-form.tsx
rename to apps/login/src/components/device-code-form.tsx
index 7dd63b0f5c..9c5a28ca4f 100644
--- a/login/apps/login/src/components/device-code-form.tsx
+++ b/apps/login/src/components/device-code-form.tsx
@@ -4,6 +4,7 @@ import { Alert } from "@/components/alert";
import { getDeviceAuthorizationRequest } from "@/lib/server/oidc";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { useTranslations } from "next-intl";
import { useForm } from "react-hook-form";
import { BackButton } from "./back-button";
import { Button, ButtonVariants } from "./button";
@@ -25,6 +26,8 @@ export function DeviceCodeForm({ userCode }: { userCode?: string }) {
},
});
+ const t = useTranslations("device");
+
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
@@ -62,7 +65,7 @@ export function DeviceCodeForm({ userCode }: { userCode?: string }) {
diff --git a/login/apps/login/src/components/dynamic-theme.tsx b/apps/login/src/components/dynamic-theme.tsx
similarity index 100%
rename from login/apps/login/src/components/dynamic-theme.tsx
rename to apps/login/src/components/dynamic-theme.tsx
diff --git a/login/apps/login/src/components/external-link.tsx b/apps/login/src/components/external-link.tsx
similarity index 100%
rename from login/apps/login/src/components/external-link.tsx
rename to apps/login/src/components/external-link.tsx
diff --git a/login/apps/login/src/components/idp-signin.tsx b/apps/login/src/components/idp-signin.tsx
similarity index 100%
rename from login/apps/login/src/components/idp-signin.tsx
rename to apps/login/src/components/idp-signin.tsx
diff --git a/login/apps/login/src/components/idps/base-button.tsx b/apps/login/src/components/idps/base-button.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/base-button.tsx
rename to apps/login/src/components/idps/base-button.tsx
diff --git a/login/apps/login/src/components/idps/pages/complete-idp.tsx b/apps/login/src/components/idps/pages/complete-idp.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/pages/complete-idp.tsx
rename to apps/login/src/components/idps/pages/complete-idp.tsx
diff --git a/login/apps/login/src/components/idps/pages/linking-failed.tsx b/apps/login/src/components/idps/pages/linking-failed.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/pages/linking-failed.tsx
rename to apps/login/src/components/idps/pages/linking-failed.tsx
diff --git a/login/apps/login/src/components/idps/pages/linking-success.tsx b/apps/login/src/components/idps/pages/linking-success.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/pages/linking-success.tsx
rename to apps/login/src/components/idps/pages/linking-success.tsx
diff --git a/login/apps/login/src/components/idps/pages/login-failed.tsx b/apps/login/src/components/idps/pages/login-failed.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/pages/login-failed.tsx
rename to apps/login/src/components/idps/pages/login-failed.tsx
diff --git a/login/apps/login/src/components/idps/pages/login-success.tsx b/apps/login/src/components/idps/pages/login-success.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/pages/login-success.tsx
rename to apps/login/src/components/idps/pages/login-success.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-apple.tsx b/apps/login/src/components/idps/sign-in-with-apple.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-apple.tsx
rename to apps/login/src/components/idps/sign-in-with-apple.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-azure-ad.tsx b/apps/login/src/components/idps/sign-in-with-azure-ad.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-azure-ad.tsx
rename to apps/login/src/components/idps/sign-in-with-azure-ad.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-generic.tsx b/apps/login/src/components/idps/sign-in-with-generic.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-generic.tsx
rename to apps/login/src/components/idps/sign-in-with-generic.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-github.tsx b/apps/login/src/components/idps/sign-in-with-github.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-github.tsx
rename to apps/login/src/components/idps/sign-in-with-github.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-gitlab.test.tsx b/apps/login/src/components/idps/sign-in-with-gitlab.test.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-gitlab.test.tsx
rename to apps/login/src/components/idps/sign-in-with-gitlab.test.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-gitlab.tsx b/apps/login/src/components/idps/sign-in-with-gitlab.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-gitlab.tsx
rename to apps/login/src/components/idps/sign-in-with-gitlab.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-google.test.tsx b/apps/login/src/components/idps/sign-in-with-google.test.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-google.test.tsx
rename to apps/login/src/components/idps/sign-in-with-google.test.tsx
diff --git a/login/apps/login/src/components/idps/sign-in-with-google.tsx b/apps/login/src/components/idps/sign-in-with-google.tsx
similarity index 100%
rename from login/apps/login/src/components/idps/sign-in-with-google.tsx
rename to apps/login/src/components/idps/sign-in-with-google.tsx
diff --git a/login/apps/login/src/components/input.tsx b/apps/login/src/components/input.tsx
similarity index 100%
rename from login/apps/login/src/components/input.tsx
rename to apps/login/src/components/input.tsx
diff --git a/login/apps/login/src/components/language-provider.tsx b/apps/login/src/components/language-provider.tsx
similarity index 100%
rename from login/apps/login/src/components/language-provider.tsx
rename to apps/login/src/components/language-provider.tsx
diff --git a/login/apps/login/src/components/language-switcher.tsx b/apps/login/src/components/language-switcher.tsx
similarity index 98%
rename from login/apps/login/src/components/language-switcher.tsx
rename to apps/login/src/components/language-switcher.tsx
index 1b2ea9d727..db5df5e14c 100644
--- a/login/apps/login/src/components/language-switcher.tsx
+++ b/apps/login/src/components/language-switcher.tsx
@@ -55,7 +55,7 @@ export function LanguageSwitcher() {
"transition duration-100 ease-in data-[leave]:data-[closed]:opacity-0",
)}
>
- {LANGS.map((lang, index) => (
+ {LANGS.map((lang) => (
@@ -77,7 +77,7 @@ export function LDAPUsernamePasswordForm({ idpId, link }: Props) {
diff --git a/login/apps/login/src/components/login-otp.tsx b/apps/login/src/components/login-otp.tsx
similarity index 98%
rename from login/apps/login/src/components/login-otp.tsx
rename to apps/login/src/components/login-otp.tsx
index f2b7e903d7..ffaa5320b0 100644
--- a/login/apps/login/src/components/login-otp.tsx
+++ b/apps/login/src/components/login-otp.tsx
@@ -11,6 +11,7 @@ import { useEffect, useRef, useState } from "react";
import { useForm } from "react-hook-form";
import { Alert, AlertType } from "./alert";
import { BackButton } from "./back-button";
+import { useTranslations } from "next-intl";
import { Button, ButtonVariants } from "./button";
import { TextInput } from "./input";
import { Spinner } from "./spinner";
@@ -42,6 +43,8 @@ export function LoginOTP({
code,
loginSettings,
}: Props) {
+ const t = useTranslations("otp");
+
const [error, setError] = useState("");
const [loading, setLoading] = useState(false);
@@ -249,7 +252,7 @@ export function LoginOTP({
({
mode: "onBlur",
});
+
+ const t = useTranslations("password");
const [info, setInfo] = useState("");
const [error, setError] = useState("");
@@ -118,7 +121,7 @@ export function PasswordForm({
diff --git a/login/apps/login/src/components/privacy-policy-checkboxes.tsx b/apps/login/src/components/privacy-policy-checkboxes.tsx
similarity index 100%
rename from login/apps/login/src/components/privacy-policy-checkboxes.tsx
rename to apps/login/src/components/privacy-policy-checkboxes.tsx
diff --git a/login/apps/login/src/components/register-form-idp-incomplete.tsx b/apps/login/src/components/register-form-idp-incomplete.tsx
similarity index 92%
rename from login/apps/login/src/components/register-form-idp-incomplete.tsx
rename to apps/login/src/components/register-form-idp-incomplete.tsx
index 1e9f2e99f2..10e766be76 100644
--- a/login/apps/login/src/components/register-form-idp-incomplete.tsx
+++ b/apps/login/src/components/register-form-idp-incomplete.tsx
@@ -3,6 +3,7 @@
import { registerUserAndLinkToIDP } from "@/lib/server/register";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { useTranslations } from "next-intl";
import { FieldValues, useForm } from "react-hook-form";
import { Alert } from "./alert";
import { BackButton } from "./back-button";
@@ -54,6 +55,8 @@ export function RegisterFormIDPIncomplete({
},
});
+ const t = useTranslations("register");
+
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
@@ -102,7 +105,7 @@ export function RegisterFormIDPIncomplete({
type="firstname"
autoComplete="firstname"
required
- {...register("firstname", { required: "This field is required" })}
+ {...register("firstname", { required: t("required.firstname") })}
label="First name"
error={errors.firstname?.message as string}
data-testid="firstname-text-input"
@@ -113,7 +116,7 @@ export function RegisterFormIDPIncomplete({
type="lastname"
autoComplete="lastname"
required
- {...register("lastname", { required: "This field is required" })}
+ {...register("lastname", { required: t("required.lastname") })}
label="Last name"
error={errors.lastname?.message as string}
data-testid="lastname-text-input"
@@ -124,7 +127,7 @@ export function RegisterFormIDPIncomplete({
type="email"
autoComplete="email"
required
- {...register("email", { required: "This field is required" })}
+ {...register("email", { required: t("required.email") })}
label="E-mail"
error={errors.email?.message as string}
data-testid="email-text-input"
diff --git a/login/apps/login/src/components/register-form.tsx b/apps/login/src/components/register-form.tsx
similarity index 95%
rename from login/apps/login/src/components/register-form.tsx
rename to apps/login/src/components/register-form.tsx
index 554a0f08c2..7b4254b0b3 100644
--- a/login/apps/login/src/components/register-form.tsx
+++ b/apps/login/src/components/register-form.tsx
@@ -8,6 +8,7 @@ import {
} from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
import { useRouter } from "next/navigation";
import { useState } from "react";
+import { useTranslations } from "next-intl";
import { FieldValues, useForm } from "react-hook-form";
import { Alert, AlertType } from "./alert";
import {
@@ -60,6 +61,8 @@ export function RegisterForm({
},
});
+ const t = useTranslations("register");
+
const [loading, setLoading] = useState(false);
const [selected, setSelected] = useState(methods[0]);
const [error, setError] = useState("");
@@ -130,7 +133,7 @@ export function RegisterForm({
type="firstname"
autoComplete="firstname"
required
- {...register("firstname", { required: "This field is required" })}
+ {...register("firstname", { required: t("required.firstname") })}
label="First name"
error={errors.firstname?.message as string}
data-testid="firstname-text-input"
@@ -141,7 +144,7 @@ export function RegisterForm({
type="lastname"
autoComplete="lastname"
required
- {...register("lastname", { required: "This field is required" })}
+ {...register("lastname", { required: t("required.lastname") })}
label="Last name"
error={errors.lastname?.message as string}
data-testid="lastname-text-input"
@@ -152,7 +155,7 @@ export function RegisterForm({
type="email"
autoComplete="email"
required
- {...register("email", { required: "This field is required" })}
+ {...register("email", { required: t("required.email") })}
label="E-mail"
error={errors.email?.message as string}
data-testid="email-text-input"
diff --git a/login/apps/login/src/components/register-passkey.tsx b/apps/login/src/components/register-passkey.tsx
similarity index 100%
rename from login/apps/login/src/components/register-passkey.tsx
rename to apps/login/src/components/register-passkey.tsx
diff --git a/login/apps/login/src/components/register-u2f.tsx b/apps/login/src/components/register-u2f.tsx
similarity index 100%
rename from login/apps/login/src/components/register-u2f.tsx
rename to apps/login/src/components/register-u2f.tsx
diff --git a/login/apps/login/src/components/self-service-menu.tsx b/apps/login/src/components/self-service-menu.tsx
similarity index 93%
rename from login/apps/login/src/components/self-service-menu.tsx
rename to apps/login/src/components/self-service-menu.tsx
index 8690160aed..511c14c0ab 100644
--- a/login/apps/login/src/components/self-service-menu.tsx
+++ b/apps/login/src/components/self-service-menu.tsx
@@ -1,6 +1,6 @@
import Link from "next/link";
-export function SelfServiceMenu({ sessionId }: { sessionId: string }) {
+export function SelfServiceMenu() {
const list: any[] = [];
// if (!!config.selfservice.change_password.enabled) {
diff --git a/login/apps/login/src/components/session-clear-item.tsx b/apps/login/src/components/session-clear-item.tsx
similarity index 94%
rename from login/apps/login/src/components/session-clear-item.tsx
rename to apps/login/src/components/session-clear-item.tsx
index 1c9e53121f..4f305b1bd7 100644
--- a/login/apps/login/src/components/session-clear-item.tsx
+++ b/apps/login/src/components/session-clear-item.tsx
@@ -21,7 +21,7 @@ export function SessionClearItem({
const currentLocale = useLocale();
moment.locale(currentLocale === "zh" ? "zh-cn" : currentLocale);
- const [loading, setLoading] = useState(false);
+ const [_loading, setLoading] = useState(false);
async function clearSessionId(id: string) {
setLoading(true);
@@ -41,9 +41,10 @@ export function SessionClearItem({
const { valid, verifiedAt } = isSessionValid(session);
- const [error, setError] = useState(null);
+ const [_error, setError] = useState(null);
- const router = useRouter();
+ // TODO: To we have to call this?
+ useRouter();
return (