Skip to content

Commit cadd514

Browse files
feat: Implement user sign-up page with form validation and add JWT to… (#195)
* feat: Implement user sign-up page with form validation and add JWT token interceptor for API requests. * fix: format constructor method in SignUpComponent * fix: remove sign-out * fix: remove ,
1 parent 3bb7bc6 commit cadd514

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

timeless-api/src/main/webui/src/app/pages/sign/sign-up/sign-up.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { InputText } from 'primeng/inputtext';
1111
import { Router, RouterLink } from '@angular/router';
1212
import { FloatLabel } from 'primeng/floatlabel';
1313
import { TimelessApiService } from '../../../timeless-api.service';
14-
import { catchError } from 'rxjs';
14+
import { catchError, EMPTY } from 'rxjs';
1515
import { ToastService } from '../../../services/toast.service';
1616
import { InputMask } from 'primeng/inputmask';
1717

@@ -54,10 +54,10 @@ export class SignUpComponent {
5454
.signUp(this.form.value)
5555
.pipe(
5656
catchError((err: any) => {
57-
if (err.error.message) {
57+
if (err.error?.message) {
5858
this.toast.error('Conflito', err.error.message);
5959
}
60-
return err;
60+
return EMPTY;
6161
}),
6262
)
6363
.subscribe((_) => {

timeless-api/src/main/webui/src/app/token.interceptor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { timelessLocalStorageKey } from './constants';
33

44
const allowedPaths = [
55
'/api/sign-in',
6-
'/api/sign-out',
6+
'/api/sign-up',
77
'api/sign-in',
8-
'api/sign-out',
8+
'api/sign-up',
99
];
1010

1111
export const tokenInterceptor: HttpInterceptorFn = (req, next) => {

0 commit comments

Comments
 (0)