Compare commits

...

1 Commits

Author SHA1 Message Date
argoyle b4d5dbe9e3 feat: add dummy-implementation of management API 2022-04-26 16:54:03 +02:00
+23 -1
View File
@@ -43,7 +43,7 @@ const addCustomClaims = (email, customClaims, token) => {
// Configure our small auth0-mock-server
app.options('*', cors(corsOpts))
.use(cors())
.use(bodyParser.json())
.use(bodyParser.json({ strict: false }))
.use(bodyParser.urlencoded({ extended: true }))
.use(cookieParser())
.use(express.static(`${__dirname}/public`))
@@ -274,6 +274,28 @@ app.post('/issuer', (req, res) => {
res.send('ok')
})
app.get('/api/v2/users-by-email', (req, res) => {
res.json([])
})
app.post('/api/v2/users', (req, res) => {
const email = req.body.email
res.json({
user_id: `auth0|${email}`
})
})
app.post('/api/v2/tickets/password-change', (req, res) => {
res.json({
ticket: `https://some-url`
})
})
app.use(function(req, res, next) {
console.log('404', req.path)
res.status(404).send('error: 404 Not Found ' + req.path)
})
app.listen(3333, () => {
debug('Auth0-Mock-Server listening on port 3333!')
})