diff --git a/README.md b/README.md index 681774cd..d2736d39 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,14 @@ ├── cypress: End-2-End tests organized by features │ ├── e2e: End to end tests ordered by execution │ │ └── Feature: according to front end -│ ├── fixtures: static test files and test data objects +│ ├── fixtures: specific test variables │ └── support │ ├── commands: Definition of cypress commonands │ └── index.d.ts: Signature and types of cypress commands │ +├── seed_and_test_data +│ └── Data used to seed database and set test states +│ ├── src │ ├── app: Frontend │ │ ├── auth: Authentication functionality diff --git a/src/app/auth/services/authentication.service.ts b/src/app/auth/services/authentication.service.ts index e1c65117..1114f9e0 100644 --- a/src/app/auth/services/authentication.service.ts +++ b/src/app/auth/services/authentication.service.ts @@ -124,6 +124,12 @@ export class AuthenticationService { } } + /** + * Updates the email of the user. + * + * @param {string} newEmail - The new email address to update. + * @return {Promise<{ user: User } | unknown>} - A promise that resolves to an an object containing the updated user data or an unknown error. + */ public async updateEmail(newEmail: string): Promise<{ user: User } | unknown> { try { this.sessionStoreService.loading.startLoading() @@ -131,7 +137,6 @@ export class AuthenticationService { if (userResponse.error) { throw userResponse.error; } - console.log(userResponse.data) this.tuiAlertService.open( 'Email erfolgreich geändert. Die Änderung muss in der Alten und Neuen Email-Adresse bestätigt werden' + ' und wird dann beim nächsten Login benötigt.', @@ -149,6 +154,13 @@ export class AuthenticationService { } } + /** + * Updates the password of the current user. + * + * @param {string} newPassword - The new password to be set. + * @returns {Promise<{ user: User } | unknown>} A Promise that resolves to either an object containing the + * updated user data or an unknown error. + */ public async updatePassword(newPassword: string): Promise<{ user: User } | unknown> { try { this.sessionStoreService.loading.startLoading() @@ -156,7 +168,6 @@ export class AuthenticationService { if (userResponse.error) { throw userResponse.error; } - console.log(userResponse.data) this.tuiAlertService.open( 'Passwort erfolgreich geändert und beim nächsten Login benötigt.', { @@ -173,6 +184,12 @@ export class AuthenticationService { } } + /** + * Requests a password reset for the given email address. + * + * @param {string} emailResetShouldBeSend - The email address to send the password reset to. + * @returns {Promise} - A Promise that resolves to the response data, or rejects with an error. + */ public async requestPasswordReset(emailResetShouldBeSend: string): Promise { try { this.sessionStoreService.loading.startLoading() @@ -186,7 +203,6 @@ export class AuthenticationService { if (userResponse.error) { throw userResponse.error; } - console.log(userResponse.data) this.tuiAlertService.open( 'Email erfolgreich versendet. Öffne deinen Email Account.', {