aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/users/users.ts14
1 files changed, 13 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}