diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
commit | 154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch) | |
tree | 5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /server/controllers/api/clients.ts | |
parent | df98563e2104b82b119c00a3cd83cd0dc1242d25 (diff) | |
download | PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip |
Share models between server and client
Diffstat (limited to 'server/controllers/api/clients.ts')
-rw-r--r-- | server/controllers/api/clients.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/clients.ts b/server/controllers/api/clients.ts index 8c460096b..96490d04a 100644 --- a/server/controllers/api/clients.ts +++ b/server/controllers/api/clients.ts | |||
@@ -3,6 +3,7 @@ import * as express from 'express' | |||
3 | import { CONFIG } from '../../initializers' | 3 | import { CONFIG } from '../../initializers' |
4 | import { logger } from '../../helpers' | 4 | import { logger } from '../../helpers' |
5 | import { database as db } from '../../initializers/database' | 5 | import { database as db } from '../../initializers/database' |
6 | import { ClientLocal } from '../../../shared' | ||
6 | 7 | ||
7 | const clientsRouter = express.Router() | 8 | const clientsRouter = express.Router() |
8 | 9 | ||
@@ -27,10 +28,11 @@ function getLocalClient (req: express.Request, res: express.Response, next: expr | |||
27 | if (err) return next(err) | 28 | if (err) return next(err) |
28 | if (!client) return next(new Error('No client available.')) | 29 | if (!client) return next(new Error('No client available.')) |
29 | 30 | ||
30 | res.json({ | 31 | const json: ClientLocal = { |
31 | client_id: client.clientId, | 32 | client_id: client.clientId, |
32 | client_secret: client.clientSecret | 33 | client_secret: client.clientSecret |
33 | }) | 34 | } |
35 | res.json(json) | ||
34 | }) | 36 | }) |
35 | } | 37 | } |
36 | 38 | ||