Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add app login page #21

Draft
wants to merge 39 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6e31c8d
Add initial implementation of app login with qr code
mpgxvii Sep 18, 2024
81fb654
Fix formatting
mpgxvii Sep 18, 2024
cdf3e2e
Fix login for multiple projects
mpgxvii Sep 23, 2024
c3b9f89
Fix setting of scope
mpgxvii Sep 25, 2024
f5f94a1
Merge branch 'dev' of https://github.com/RADAR-base/radar-self-enrolm…
mpgxvii Sep 26, 2024
d40091b
Add support for rest source auth redirect
mpgxvii Sep 26, 2024
4763a56
Fix formatting
mpgxvii Sep 26, 2024
49aed05
Fix scope loading
mpgxvii Sep 26, 2024
34c130e
Fix npm cache permission issues by setting new dir
mpgxvii Sep 28, 2024
6ca83f7
Add user id when creating subject in MP
mpgxvii Sep 28, 2024
549a64f
Add sample health check endpoints
mpgxvii Sep 28, 2024
f0a1423
Fix formatting
mpgxvii Sep 28, 2024
20e62f6
Add support for custom base path and add health check
mpgxvii Oct 2, 2024
3548a82
Fix navigation to support base href
mpgxvii Oct 3, 2024
6546a73
Update consent component to use http requests directly and support cu…
mpgxvii Oct 8, 2024
fb905dc
Fix base path in consent
mpgxvii Oct 8, 2024
26f9dc2
Update cypress baseurl
mpgxvii Oct 8, 2024
5268450
Fix lint errors
mpgxvii Oct 8, 2024
b8e4e7a
Update cypress baseurl
mpgxvii Oct 8, 2024
c9040f8
Fix base path vars and Dockerfile
mpgxvii Oct 11, 2024
7d359ce
Fix formatting
mpgxvii Oct 11, 2024
e51d271
Update cypress config
mpgxvii Oct 11, 2024
c896c88
Fix rest source client configs
mpgxvii Oct 12, 2024
b4d2ef2
Fix rest source client: create user before registering
mpgxvii Oct 14, 2024
ae18d88
Add separate oauth2 login
mpgxvii Oct 14, 2024
c364a4a
Fix formatting
mpgxvii Oct 14, 2024
2a69e87
Fix Oauth login redirect and Fitbit token
mpgxvii Oct 14, 2024
4f4de50
Fix env vars
mpgxvii Oct 14, 2024
bdbd90f
Fix Oauth login component
mpgxvii Oct 15, 2024
b67ccd9
Update titles
mpgxvii Oct 15, 2024
5470656
Fix formatting
mpgxvii Oct 15, 2024
dd9adbf
Fix formatting
mpgxvii Oct 15, 2024
be96022
Merge branch 'dev' of https://github.com/RADAR-base/radar-self-enrolm…
mpgxvii Oct 31, 2024
74bae26
Update configs
mpgxvii Nov 4, 2024
426f638
Store access token expiry in apps login page
mpgxvii Nov 27, 2024
ddff18a
Fix app login page
mpgxvii Nov 27, 2024
0b57af0
Update consent component
mpgxvii Nov 28, 2024
c45a68c
Add support for automatically logging in to armt
mpgxvii Dec 2, 2024
67fcf70
Fix scopes for skipped consent
mpgxvii Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
node_modules/
.github/
.idea/
.vscode/
# Node modules
node_modules
npm-debug.log

# Build artifacts
.next
out

# Local environment files
.env

# Logs
logs
*.log

# IDE and editor files
.vscode
.idea
*.swp
*.swo

# Operating system files
.DS_Store
Thumbs.db

# Git files
.git
.gitignore

# Other files you may want to ignore
coverage
test-results
*.tgz
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ORY_SDK_URL=http://localhost:4433
HYDRA_ADMIN_URL=http://localhost:4445
HYDRA_PUBLIC_URL=http://localhost:4444
BASE_PATH=/kratos-ui
NEXT_PUBLIC_KRATOS_PUBLIC_URL=http://localhost:3000/kratos-ui
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ dist/
cypress/videos
cypress/screenshots

.idea
.idea
.env
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ RUN npm install

COPY . .

RUN npm run build
RUN npm run build

# Copy the env substitution script and ensure it is executable
COPY docker/30-env-subst.sh /docker-entrypoint.d/30-env-subst.sh
RUN chmod +x /docker-entrypoint.d/30-env-subst.sh

ENTRYPOINT ["/bin/sh", "-c", "/docker-entrypoint.d/30-env-subst.sh && exec \"$@\"", "--"]

EXPOSE 3000

Expand Down
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"baseUrl": "http://localhost:3000"
"baseUrl": "http://localhost:3000/kratos-ui"
}
19 changes: 19 additions & 0 deletions docker/30-env-subst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# Log that the script is running
echo "Running docker-entrypoint.sh."

# Replace placeholder with actual environment variable values
if [ -n "$BASE_PATH" ]; then
echo "Replacing BASE_PATH in env.template.js with ${BASE_PATH}"
sed -i "s|/__BASE_PATH__|${BASE_PATH}|g" /app/env.js
else
echo "BASE_PATH is not set."
fi

# Log the contents of env.template.js after modification
echo "Contents of env.template.js after replacement:"
cat /app/env.js

# Start the application
echo "Starting the application..."
6 changes: 6 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
basePath: "/kratos-ui",
restSourceBackendEndpoint: "",
restSourceFrontendEndpoint: "",
hydraPublicUrl: "",
}
19 changes: 18 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
/** @type {import('next').NextConfig} */
const envConfig = require("./env.js") // Load the generated config

module.exports = {
reactStrictMode: true,

// Set basePath and assetPrefix dynamically
basePath: envConfig.basePath || "",
assetPrefix: `${envConfig.basePath}/` || "",
restSourceBackendEndpoint: `${envConfig.restSourceBackendEndpoint}/` || "",
restSourceFrontendEndpoint: `${envConfig.restSourceFrontendEndpoint}/` || "",
hydraPublicUrl: `${envConfig.hydraPublicUrl}/` || "",

publicRuntimeConfig: {
basePath: envConfig.basePath || "",
frontEndClientId: "SEP",
frontEndClientSecret: "secret",
restSourceBackendEndpoint: envConfig.restSourceBackendEndpoint,
restSourceFrontendEndpoint: envConfig.restSourceFrontendEndpoint,
hydraPublicUrl: envConfig.hydraPublicUrl,
},
}
105 changes: 82 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
"next": "12.1.6",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-qr-code": "^2.0.15",
"react-toastify": "^8.0.3",
"styled-components": "^5.3.1",
"typescript": "^4.4.2"
"typescript": "^4.4.2",
"uuid": "^10.0.0"
},
"peerDependencies": {
"next": "12.1.6",
Expand All @@ -42,6 +44,7 @@
"@types/react": "~17.0.19",
"@types/request": "^2.48.7",
"@types/styled-components": "^5.1.13",
"@types/uuid": "^10.0.0",
"cypress": "^8.7.0",
"eslint": "7.32.0",
"eslint-config-next": "12.0.3",
Expand Down
1 change: 1 addition & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "../styles/globals.css"
import { theme, globalStyles, ThemeProps } from "@ory/themes"
import type { AppProps } from "next/app"
import Head from "next/head"
import { ToastContainer } from "react-toastify"
import "react-toastify/dist/ReactToastify.css"
import { ThemeProvider } from "styled-components"
Expand Down
Loading
Loading