File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -36,18 +36,24 @@ export class RegisterService {
36
36
}
37
37
38
38
registerUser ( payload ) {
39
- this . requestRegister ( ) ;
40
- const creds = payload ;
41
- if ( creds . email . length > 0 && creds . password . length > 0 ) {
42
- this . http . post ( '/user/signup' , creds ) . subscribe ( ( ) => {
43
- this . receiveRegister ( ) ;
44
- this . toastr . success ( 'You\'ve been registered successfully' ) ;
45
- this . router . navigate ( [ '/login' ] ) ;
46
- } , err => {
47
- this . registerError ( err . response . data ) ;
48
- } ) ;
39
+ // We check if app runs with backend mode
40
+ if ( ! this . config . isBackend ) {
41
+ this . toastr . success ( 'You\'ve been registered successfully' ) ;
42
+ this . router . navigate ( [ '/login' ] ) ;
49
43
} else {
50
- this . registerError ( 'Something was wrong. Try again' ) ;
44
+ this . requestRegister ( ) ;
45
+ const creds = payload ;
46
+ if ( creds . email . length > 0 && creds . password . length > 0 ) {
47
+ this . http . post ( '/user/signup' , creds ) . subscribe ( ( ) => {
48
+ this . receiveRegister ( ) ;
49
+ this . toastr . success ( 'You\'ve been registered successfully' ) ;
50
+ this . router . navigate ( [ '/login' ] ) ;
51
+ } , err => {
52
+ this . registerError ( err . response . data ) ;
53
+ } ) ;
54
+ } else {
55
+ this . registerError ( 'Something was wrong. Try again' ) ;
56
+ }
51
57
}
52
58
}
53
59
You can’t perform that action at this time.
0 commit comments