aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/index.ts4
-rw-r--r--server/controllers/api/oauth-clients.ts (renamed from server/controllers/api/clients.ts)10
2 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 3abe9bcf8..a9205b33c 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
2 2
3import { badRequest } from '../../helpers' 3import { badRequest } from '../../helpers'
4 4
5import { clientsRouter } from './clients' 5import { oauthClientsRouter } from './oauth-clients'
6import { configRouter } from './config' 6import { configRouter } from './config'
7import { podsRouter } from './pods' 7import { podsRouter } from './pods'
8import { remoteRouter } from './remote' 8import { remoteRouter } from './remote'
@@ -12,7 +12,7 @@ import { videosRouter } from './videos'
12 12
13const apiRouter = express.Router() 13const apiRouter = express.Router()
14 14
15apiRouter.use('/clients', clientsRouter) 15apiRouter.use('/oauth-clients', oauthClientsRouter)
16apiRouter.use('/config', configRouter) 16apiRouter.use('/config', configRouter)
17apiRouter.use('/pods', podsRouter) 17apiRouter.use('/pods', podsRouter)
18apiRouter.use('/remote', remoteRouter) 18apiRouter.use('/remote', remoteRouter)
diff --git a/server/controllers/api/clients.ts b/server/controllers/api/oauth-clients.ts
index 96490d04a..b9bc0534f 100644
--- a/server/controllers/api/clients.ts
+++ b/server/controllers/api/oauth-clients.ts
@@ -3,11 +3,11 @@ import * as express from 'express'
3import { CONFIG } from '../../initializers' 3import { CONFIG } from '../../initializers'
4import { logger } from '../../helpers' 4import { logger } from '../../helpers'
5import { database as db } from '../../initializers/database' 5import { database as db } from '../../initializers/database'
6import { ClientLocal } from '../../../shared' 6import { OAuthClientLocal } from '../../../shared'
7 7
8const clientsRouter = express.Router() 8const oauthClientsRouter = express.Router()
9 9
10clientsRouter.get('/local', getLocalClient) 10oauthClientsRouter.get('/local', getLocalClient)
11 11
12// Get the client credentials for the PeerTube front end 12// Get the client credentials for the PeerTube front end
13function getLocalClient (req: express.Request, res: express.Response, next: express.NextFunction) { 13function getLocalClient (req: express.Request, res: express.Response, next: express.NextFunction) {
@@ -28,7 +28,7 @@ function getLocalClient (req: express.Request, res: express.Response, next: expr
28 if (err) return next(err) 28 if (err) return next(err)
29 if (!client) return next(new Error('No client available.')) 29 if (!client) return next(new Error('No client available.'))
30 30
31 const json: ClientLocal = { 31 const json: OAuthClientLocal = {
32 client_id: client.clientId, 32 client_id: client.clientId,
33 client_secret: client.clientSecret 33 client_secret: client.clientSecret
34 } 34 }
@@ -39,5 +39,5 @@ function getLocalClient (req: express.Request, res: express.Response, next: expr
39// --------------------------------------------------------------------------- 39// ---------------------------------------------------------------------------
40 40
41export { 41export {
42 clientsRouter 42 oauthClientsRouter
43} 43}