aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/signup/signup.component.ts
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-04-02 13:33:47 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-04-02 13:33:47 -0400
commitf14d070155a6927d544a908545c648c402948fea (patch)
treef6f56af728b5d0d23f1f222962a9215bc852a080 /ufund-ui/src/app/components/signup/signup.component.ts
parent22df0d963e09520339dfa9c681caeaaec790df8e (diff)
parent2eb67f9481d858474e77af545e71f68b2cea7041 (diff)
downloadJellySolutions-f14d070155a6927d544a908545c648c402948fea.tar.gz
JellySolutions-f14d070155a6927d544a908545c648c402948fea.tar.bz2
JellySolutions-f14d070155a6927d544a908545c648c402948fea.zip
Merge remote-tracking branch 'origin/css' into css
Diffstat (limited to 'ufund-ui/src/app/components/signup/signup.component.ts')
-rw-r--r--ufund-ui/src/app/components/signup/signup.component.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/ufund-ui/src/app/components/signup/signup.component.ts b/ufund-ui/src/app/components/signup/signup.component.ts
index a20d828..b040d1a 100644
--- a/ufund-ui/src/app/components/signup/signup.component.ts
+++ b/ufund-ui/src/app/components/signup/signup.component.ts
@@ -6,7 +6,6 @@ import {ToastsService, ToastType} from '../../services/toasts.service';
class PasswordRequirements {
sixLong: {title: string, value: boolean} = {title: 'Is 6 characters or longer' , value: false}
- twelveLong: {title: string, value: boolean} = {title: 'Is 12 characters or longer', value: false}
lowercase: {title: string, value: boolean} = {title: 'Includes lowercase letter' , value: false}
uppercase: {title: string, value: boolean} = {title: 'Includes uppercase letter' , value: false}
number: {title: string, value: boolean} = {title: 'Includes number' , value: false}
@@ -25,12 +24,10 @@ export class SignupComponent {
protected passwordStatusText = new BehaviorSubject("")
protected passwordsMatch = new BehaviorSubject(false)
protected usernameStatusText = new BehaviorSubject("")
- protected showSuccessMessage = new BehaviorSubject(false)
protected passwordStrongEnough = new BehaviorSubject(false)
protected ableToCreateAccount = new BehaviorSubject(false)
protected passwordRequirements: PasswordRequirements = new PasswordRequirements()
protected strength = new BehaviorSubject(0)
- protected statusText = new BehaviorSubject("");
constructor(
protected usersService: UsersService,
@@ -45,7 +42,9 @@ export class SignupComponent {
}
this.usersService.createUser(username, password).then(() => {
- this.showSuccessMessage.next(true);
+ // let action = {label: 'Proceed to login', onAction: () => this.router.navigate(["/login"])}
+ this.toastService.sendToast(ToastType.INFO, "Account successfully created")
+ this.router.navigate(["/login"])
}).catch(ex => {
this.toastService.sendToast(ToastType.ERROR, "Unable to create account: " + friendlyHttpStatus[ex.status])
console.log(ex)
@@ -74,16 +73,12 @@ export class SignupComponent {
if (password.match(/[^!-~]/g)) {
this.passwordStatusText.next("Invalid characters")
-
return
}
if (password.length > 6) {
this.passwordRequirements.sixLong.value = true
}
- if (password.length > 12) {
- this.passwordRequirements.twelveLong.value = true
- }
if (password.match(/[a-z]/g)) {
this.passwordRequirements.lowercase.value = true
}
@@ -108,7 +103,7 @@ export class SignupComponent {
} else if (strength == 0) {
this.passwordStatusText.next("")
} else {
- this.passwordStatusText.next("5/6 checks required")
+ this.passwordStatusText.next("Password must meet requirements")
}
this.strength.next(strength)