aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-08-13 15:07:23 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-11-25 11:07:56 +0100
commitafff310e50f2fa8419bb4242470cbde46ab54463 (patch)
tree34efda2daf8f7cdfd89ef6616a79e2222082f93a /shared
parentf619de0e435f7ac3abad2ec772397486358b56e7 (diff)
downloadPeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.tar.gz
PeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.tar.zst
PeerTube-afff310e50f2fa8419bb4242470cbde46ab54463.zip
allow private syndication feeds via a user feedToken
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/users/users.ts14
-rw-r--r--shared/models/users/user-scoped-token.ts5
2 files changed, 18 insertions, 1 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts
index 9f193680d..4d0986ce3 100644
--- a/shared/extra-utils/users/users.ts
+++ b/shared/extra-utils/users/users.ts
@@ -109,6 +109,17 @@ function getMyUserInformation (url: string, accessToken: string, specialStatus =
109 .expect('Content-Type', /json/) 109 .expect('Content-Type', /json/)
110} 110}
111 111
112function getUserScopedTokens (url: string, accessToken: string, specialStatus = 200) {
113 const path = '/api/v1/users/scoped-tokens'
114
115 return request(url)
116 .get(path)
117 .set('Accept', 'application/json')
118 .set('Authorization', 'Bearer ' + accessToken)
119 .expect(specialStatus)
120 .expect('Content-Type', /json/)
121}
122
112function deleteMe (url: string, accessToken: string, specialStatus = 204) { 123function deleteMe (url: string, accessToken: string, specialStatus = 204) {
113 const path = '/api/v1/users/me' 124 const path = '/api/v1/users/me'
114 125
@@ -351,5 +362,6 @@ export {
351 updateMyAvatar, 362 updateMyAvatar,
352 askSendVerifyEmail, 363 askSendVerifyEmail,
353 generateUserAccessToken, 364 generateUserAccessToken,
354 verifyEmail 365 verifyEmail,
366 getUserScopedTokens
355} 367}
diff --git a/shared/models/users/user-scoped-token.ts b/shared/models/users/user-scoped-token.ts
new file mode 100644
index 000000000..f9d9b0a8b
--- /dev/null
+++ b/shared/models/users/user-scoped-token.ts
@@ -0,0 +1,5 @@
1export type ScopedTokenType = 'feedToken'
2
3export type ScopedToken = {
4 feedToken: string
5}