diff options
Diffstat (limited to 'shared/extra-utils/users/users.ts')
-rw-r--r-- | shared/extra-utils/users/users.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/shared/extra-utils/users/users.ts b/shared/extra-utils/users/users.ts index 0f15962ad..835ad08ba 100644 --- a/shared/extra-utils/users/users.ts +++ b/shared/extra-utils/users/users.ts | |||
@@ -7,7 +7,6 @@ import { UserRegister } from '../../models/users/user-register.model' | |||
7 | import { UserRole } from '../../models/users/user-role' | 7 | import { UserRole } from '../../models/users/user-role' |
8 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest, updateImageRequest } from '../requests/requests' | 8 | import { makeGetRequest, makePostBodyRequest, makePutBodyRequest, updateImageRequest } from '../requests/requests' |
9 | import { ServerInfo } from '../server/servers' | 9 | import { ServerInfo } from '../server/servers' |
10 | import { userLogin } from './login' | ||
11 | 10 | ||
12 | function createUser (parameters: { | 11 | function createUser (parameters: { |
13 | url: string | 12 | url: string |
@@ -55,7 +54,7 @@ async function generateUser (server: ServerInfo, username: string) { | |||
55 | const password = 'my super password' | 54 | const password = 'my super password' |
56 | const resCreate = await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password }) | 55 | const resCreate = await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password }) |
57 | 56 | ||
58 | const token = await userLogin(server, { username, password }) | 57 | const token = await server.loginCommand.getAccessToken({ username, password }) |
59 | 58 | ||
60 | const resMe = await getMyUserInformation(server.url, token) | 59 | const resMe = await getMyUserInformation(server.url, token) |
61 | 60 | ||
@@ -70,7 +69,7 @@ async function generateUserAccessToken (server: ServerInfo, username: string) { | |||
70 | const password = 'my super password' | 69 | const password = 'my super password' |
71 | await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password }) | 70 | await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password }) |
72 | 71 | ||
73 | return userLogin(server, { username, password }) | 72 | return server.loginCommand.getAccessToken({ username, password }) |
74 | } | 73 | } |
75 | 74 | ||
76 | function registerUser (url: string, username: string, password: string, specialStatus = HttpStatusCode.NO_CONTENT_204) { | 75 | function registerUser (url: string, username: string, password: string, specialStatus = HttpStatusCode.NO_CONTENT_204) { |