PeerTube/shared/extra-utils/users/users.ts

21 lines
658 B
TypeScript
Raw Normal View History

2017-09-04 19:21:47 +00:00
import * as request from 'supertest'
2021-05-07 09:53:46 +00:00
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
2017-10-27 15:27:06 +00:00
2021-07-13 12:23:01 +00:00
// FIXME: delete once videos does not use it anymore
function xxxgetMyUserInformation (url: string, accessToken: string, specialStatus = HttpStatusCode.OK_200) {
2017-09-04 19:21:47 +00:00
const path = '/api/v1/users/me'
return request(url)
.get(path)
.set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + accessToken)
2017-12-28 14:25:31 +00:00
.expect(specialStatus)
2017-09-04 19:21:47 +00:00
.expect('Content-Type', /json/)
}
// ---------------------------------------------------------------------------
export {
2021-07-13 12:23:01 +00:00
xxxgetMyUserInformation
2017-09-04 19:21:47 +00:00
}