Skip to content
This repository has been archived by the owner on Aug 24, 2018. It is now read-only.

Commit

Permalink
escape client id / secret
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed Oct 8, 2017
1 parent 30ed9b1 commit dbb5dbf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ const express = require('express')
const Hydra = require('ory-hydra-sdk')
const router = express.Router()
const OAuth2 = require('simple-oauth2')
const qs = require('querystring')

const scope = 'hydra.consent hydra.consent.*'
const oauth2 = OAuth2.create({
client: {
id: process.env.HYDRA_CLIENT_ID,
secret: process.env.HYDRA_CLIENT_SECRET
id: qs.escape(process.env.HYDRA_CLIENT_ID),
secret: qs.escape(process.env.HYDRA_CLIENT_SECRET)
},
auth: {
tokenHost: endpoint = process.env.HYDRA_URL,
Expand Down Expand Up @@ -163,6 +164,9 @@ router.post('/login', (r, w) => {
w.redirect('/consent?consent=' + r.body.consent)
})

router.get('/', (r, w) => w.send('This is an exemplary consent app for Hydra. Please read the hydra docs on how to use this router.'))
router.get('/', (
r,
w
) => w.send('This is an exemplary consent app for Hydra. Please read the hydra docs on how to use this router.'))

module.exports = router

0 comments on commit dbb5dbf

Please sign in to comment.