mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
First version with PostgreSQL
This commit is contained in:
parent
108626609e
commit
feb4bdfd9b
68 changed files with 1171 additions and 730 deletions
|
@ -1,13 +1,11 @@
|
|||
'use strict'
|
||||
|
||||
const express = require('express')
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const constants = require('../../initializers/constants')
|
||||
const db = require('../../initializers/database')
|
||||
const logger = require('../../helpers/logger')
|
||||
|
||||
const Client = mongoose.model('OAuthClient')
|
||||
|
||||
const router = express.Router()
|
||||
|
||||
router.get('/local', getLocalClient)
|
||||
|
@ -27,12 +25,12 @@ function getLocalClient (req, res, next) {
|
|||
return res.type('json').status(403).end()
|
||||
}
|
||||
|
||||
Client.loadFirstClient(function (err, client) {
|
||||
db.OAuthClient.loadFirstClient(function (err, client) {
|
||||
if (err) return next(err)
|
||||
if (!client) return next(new Error('No client available.'))
|
||||
|
||||
res.json({
|
||||
client_id: client._id,
|
||||
client_id: client.clientId,
|
||||
client_secret: client.clientSecret
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue