aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/clients.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-12 15:20:03 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-12 15:20:03 +0100
commit99fe265a5fc077cb66c322e7f3d191ff7110aea0 (patch)
treec9e04ccfcc5496d2300d7c26db5833e494b4cdad /server/controllers/api/clients.js
parentfcc5f77b95d330bfcb439c172b7fcc58f3162e4d (diff)
parent91cc839af88730ba55f84997c56b85ea100070a7 (diff)
downloadPeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.gz
PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.zst
PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.zip
Merge branch 'postgresql'
Diffstat (limited to 'server/controllers/api/clients.js')
-rw-r--r--server/controllers/api/clients.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/server/controllers/api/clients.js b/server/controllers/api/clients.js
index 7755f6c2b..cf83cb835 100644
--- a/server/controllers/api/clients.js
+++ b/server/controllers/api/clients.js
@@ -1,13 +1,11 @@
1'use strict' 1'use strict'
2 2
3const express = require('express') 3const express = require('express')
4const mongoose = require('mongoose')
5 4
6const constants = require('../../initializers/constants') 5const constants = require('../../initializers/constants')
6const db = require('../../initializers/database')
7const logger = require('../../helpers/logger') 7const logger = require('../../helpers/logger')
8 8
9const Client = mongoose.model('OAuthClient')
10
11const router = express.Router() 9const router = express.Router()
12 10
13router.get('/local', getLocalClient) 11router.get('/local', getLocalClient)
@@ -27,12 +25,12 @@ function getLocalClient (req, res, next) {
27 return res.type('json').status(403).end() 25 return res.type('json').status(403).end()
28 } 26 }
29 27
30 Client.loadFirstClient(function (err, client) { 28 db.OAuthClient.loadFirstClient(function (err, client) {
31 if (err) return next(err) 29 if (err) return next(err)
32 if (!client) return next(new Error('No client available.')) 30 if (!client) return next(new Error('No client available.'))
33 31
34 res.json({ 32 res.json({
35 client_id: client._id, 33 client_id: client.clientId,
36 client_secret: client.clientSecret 34 client_secret: client.clientSecret
37 }) 35 })
38 }) 36 })