diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/users/users.ts | 14 | ||||
-rw-r--r-- | shared/models/users/user-scoped-token.ts | 5 |
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 | ||
112 | function 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 | |||
112 | function deleteMe (url: string, accessToken: string, specialStatus = 204) { | 123 | function 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 @@ | |||
1 | export type ScopedTokenType = 'feedToken' | ||
2 | |||
3 | export type ScopedToken = { | ||
4 | feedToken: string | ||
5 | } | ||