Similar to #513 write the e2e test to cover: delete account on keycloak.
NOTE:
- Actually we have implemented this function here,
|
public async createUser(userData: RegisterUserDto) { |
|
const keycloakBaseUrl = process.env.PRIVATE_KEYCLOAK_BASE_URL; |
|
const keycloakRealm = process.env.PRIVATE_KEYCLOAK_REALM; |
|
try { |
|
// Get the access token |
|
const tokenData = await this.authService.getToken(); |
|
|
|
// API for creating the user |
|
const createUserApiUrl = `${keycloakBaseUrl}/admin/realms/${keycloakRealm}/users`; |
|
|
|
const headers = { |
|
Authorization: `Bearer ${tokenData}`, |
|
"Content-Type": "application/json", |
|
}; |
|
const body = JSON.stringify({ |
|
username: userData.username, |
|
email: userData.email, |
|
firstName: userData.firstName, |
|
lastName: userData.lastName, |
|
enabled: true, |
|
emailVerified: false, |
|
credentials: [ |
|
{ |
|
type: "password", |
|
value: userData.password, |
|
temporary: false, |
|
}, |
|
], |
|
}); |
So we just need to copy and migrate it to this package
Similar to #513 write the e2e test to cover: delete account on keycloak.
NOTE:
treetracker-wallet-app/apps/user/src/user/user.service.ts
Lines 72 to 100 in f05585a
So we just need to copy and migrate it to this package
coreat the same folder.