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

url with launch compaitable #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"serve": "node lib/index.js",
"start": "set BASE_URL=http://127.0.0.1:4455&& set HYDRA_ADMIN_URL=http://localhost:4445&& set KRATOS_PUBLIC_URL=http://localhost:4433/&& set KRATOS_ADMIN_URL=http://localhost:4434/&& set PORT=4455 && set KRATOS_BROWSER_URL=http://127.0.0.1:4433/&& ts-node-dev --watch public,views --respawn src/index.ts",
"start": "set BASE_URL=http://localhost:4455&& set HYDRA_ADMIN_URL=http://localhost/hydra/admin&& set KRATOS_PUBLIC_URL=http://localhost/kratos/public&& set KRATOS_ADMIN_URL=http://localhost/kratos/admin&& set PORT=4455 && set KRATOS_BROWSER_URL=http://localhost/kratos/admin&& ts-node-dev --watch public,views --respawn src/index.ts",
"test": "npm-run-all build",
"format": "prettier --write src/**/*.ts",
"check-format": "prettier --check src/**/*.ts",
Expand Down
19 changes: 15 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import hydraLogin, { postLogin } from './routes/hydraLogin'
import hydraLogout from './routes/hydraLogout'
import session from 'express-session'
import { hydraGetConsent, hydraPostConsent } from './routes/hydraConsent'
import { getPatientPicker, postPatientPicker } from './routes/patientPicker'
import bodyParser from 'body-parser'
import cors from 'cors'

Expand All @@ -34,7 +35,6 @@ const app = express()

app.locals.logoUrl = config.logoUrl


app.use(morgan('tiny'))
app.use(cookieParser())
app.use(
Expand Down Expand Up @@ -106,7 +106,7 @@ if (process.env.NODE_ENV === 'stub') {
app.get('/recovery', recoveryHandler)
app.get('/postLogin', csrfProtection, postLogin)
app.get('/hydralogin', csrfProtection, hydraLogin)
app.get('/hydralogout', csrfProtection, hydraLogout)
app.get('/hydralogout', cors(), csrfProtection, hydraLogout)
app.get(
'/hydraconsent',
csrfProtection,
Expand All @@ -119,6 +119,19 @@ if (process.env.NODE_ENV === 'stub') {
csrfProtection,
hydraPostConsent
)
app.get(
'/patientpicker/:challenge/:launch',
protect,
csrfProtection,
getPatientPicker
)
app.post(
'/patientpicker/:challenge/:launch',
protect,
bodyParser.urlencoded({ extended: true }),
csrfProtection,
postPatientPicker
)
app.get('/postlogout', cors(), (req, res, next) => {
res.send('You have successfully logged out')
})
Expand All @@ -138,8 +151,6 @@ app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
})
})



const port = Number(process.env.PORT) || 3000

let listener = () => {
Expand Down
Loading