diff options
Diffstat (limited to '')
| -rw-r--r-- | ufund-ui/src/app/components/signup/signup.component.ts | 7 | 
1 files changed, 5 insertions, 2 deletions
diff --git a/ufund-ui/src/app/components/signup/signup.component.ts b/ufund-ui/src/app/components/signup/signup.component.ts index b040d1a..9c37211 100644 --- a/ufund-ui/src/app/components/signup/signup.component.ts +++ b/ufund-ui/src/app/components/signup/signup.component.ts @@ -3,6 +3,7 @@ import {UsersService} from '../../services/users.service';  import {Router} from '@angular/router';  import {BehaviorSubject} from 'rxjs';  import {ToastsService, ToastType} from '../../services/toasts.service'; +import {AuthService} from '../../services/auth.service';  class PasswordRequirements {      sixLong:    {title: string, value: boolean} = {title: 'Is 6 characters or longer' , value: false} @@ -32,7 +33,8 @@ export class SignupComponent {      constructor(          protected usersService: UsersService,          protected router: Router, -        protected toastService: ToastsService +        protected toastService: ToastsService, +        protected authService: AuthService      ) {}      signup(username: string | null, password: string | null) { @@ -44,7 +46,8 @@ export class SignupComponent {          this.usersService.createUser(username, password).then(() => {              // let action = {label: 'Proceed to login', onAction: () => this.router.navigate(["/login"])}              this.toastService.sendToast(ToastType.INFO, "Account successfully created") -            this.router.navigate(["/login"]) +            this.authService.login(username, password) +            this.router.navigate(["/"])          }).catch(ex => {              this.toastService.sendToast(ToastType.ERROR, "Unable to create account: " + friendlyHttpStatus[ex.status])              console.log(ex)  | 
