Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

ClientLocal -> OAuthClientLocal

Chocobozzz0a381679e04b
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index fcc6b9bb64..d5aa80512d 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -11,13 +11,13 @@ import { NotificationsService } from 'angular2-notifications'
import { AuthStatus } from './auth-status.model'
import { AuthUser } from './auth-user.model'
-import { ClientLocal } from '../../../../../shared'
+import { OAuthClientLocal } from '../../../../../shared'
// Do not use the barrel (dependency loop)
import { RestExtractor } from '../../shared/rest'
@Injectable()
export class AuthService {
- private static BASE_CLIENT_URL = API_URL + '/api/v1/clients/local'
+ private static BASE_CLIENT_URL = API_URL + '/api/v1/oauth-clients/local'
private static BASE_TOKEN_URL = API_URL + '/api/v1/users/token'
private static BASE_USER_INFORMATIONS_URL = API_URL + '/api/v1/users/me'
@@ -43,7 +43,7 @@ export class AuthService {
.map(this.restExtractor.extractDataGet)
.catch(res => this.restExtractor.handleError(res))
.subscribe(
- (result: ClientLocal) => {
+ (result: OAuthClientLocal) => {
this.clientId = result.client_id
this.clientSecret = result.client_secret
console.log('Client credentials loaded.')
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 3abe9bcf82..a9205b33c6 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
import { badRequest } from '../../helpers'
-import { clientsRouter } from './clients'
+import { oauthClientsRouter } from './oauth-clients'
import { configRouter } from './config'
import { podsRouter } from './pods'
import { remoteRouter } from './remote'
@@ -12,7 +12,7 @@ import { videosRouter } from './videos'
const apiRouter = express.Router()
-apiRouter.use('/clients', clientsRouter)
+apiRouter.use('/oauth-clients', oauthClientsRouter)
apiRouter.use('/config', configRouter)
apiRouter.use('/pods', podsRouter)
apiRouter.use('/remote', remoteRouter)
diff --git a/server/controllers/api/clients.ts b/server/controllers/api/oauth-clients.ts
similarity index 85%
rename from server/controllers/api/clients.ts
rename to server/controllers/api/oauth-clients.ts
index 96490d04a7..b9bc0534f2 100644
--- a/server/controllers/api/clients.ts
+++ b/server/controllers/api/oauth-clients.ts
@@ -3,11 +3,11 @@ import * as express from 'express'
import { CONFIG } from '../../initializers'
import { logger } from '../../helpers'
import { database as db } from '../../initializers/database'
-import { ClientLocal } from '../../../shared'
+import { OAuthClientLocal } from '../../../shared'
-const clientsRouter = express.Router()
+const oauthClientsRouter = express.Router()
-clientsRouter.get('/local', getLocalClient)
+oauthClientsRouter.get('/local', getLocalClient)
// Get the client credentials for the PeerTube front end
function getLocalClient (req: express.Request, res: express.Response, next: express.NextFunction) {
@@ -28,7 +28,7 @@ function getLocalClient (req: express.Request, res: express.Response, next: expr
if (err) return next(err)
if (!client) return next(new Error('No client available.'))
- const json: ClientLocal = {
+ const json: OAuthClientLocal = {
client_id: client.clientId,
client_secret: client.clientSecret
}
@@ -39,5 +39,5 @@ function getLocalClient (req: express.Request, res: express.Response, next: expr
// ---------------------------------------------------------------------------
export {
- clientsRouter
+ oauthClientsRouter
}
diff --git a/shared/models/index.ts b/shared/models/index.ts
index fffac795e5..95d95ab479 100644
--- a/shared/models/index.ts
+++ b/shared/models/index.ts
@@ -1,5 +1,5 @@
-export * from './client-local.model'
export * from './job.model'
+export * from './oauth-client-local.model'
export * from './pod.model'
export * from './request-scheduler.model'
export * from './user-video-rate.model'
diff --git a/shared/models/client-local.model.ts b/shared/models/oauth-client-local.model.ts
similarity index 56%
rename from shared/models/client-local.model.ts
rename to shared/models/oauth-client-local.model.ts
index c27963e88b..0c6ce6c5df 100644
--- a/shared/models/client-local.model.ts
+++ b/shared/models/oauth-client-local.model.ts
@@ -1,4 +1,4 @@
-export interface ClientLocal {
+export interface OAuthClientLocal {
client_id: string
client_secret: string
}