mirror of
https://github.com/openstf/stf
synced 2025-10-05 19:42:01 +02:00
add groups feature
This commit is contained in:
parent
6fd750dad5
commit
7f5dc4c152
119 changed files with 12416 additions and 402 deletions
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
var http = require('http')
|
||||
|
||||
var express = require('express')
|
||||
|
@ -16,6 +20,8 @@ var pathutil = require('../../util/pathutil')
|
|||
var urlutil = require('../../util/urlutil')
|
||||
var lifecycle = require('../../util/lifecycle')
|
||||
|
||||
const dbapi = require('../../db/api')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('auth-mock')
|
||||
var app = express()
|
||||
|
@ -80,6 +86,24 @@ module.exports = function(options) {
|
|||
res.redirect('/auth/mock/')
|
||||
})
|
||||
|
||||
app.get('/auth/contact', function(req, res) {
|
||||
dbapi.getRootGroup().then(function(group) {
|
||||
res.status(200)
|
||||
.json({
|
||||
success: true
|
||||
, contact: group.owner
|
||||
})
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.error('Unexpected error', err.stack)
|
||||
res.status(500)
|
||||
.json({
|
||||
success: false
|
||||
, error: 'ServerError'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
app.get('/auth/mock/', function(req, res) {
|
||||
res.render('index')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue