aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/signup/signup.component.ts
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-04-01 21:17:45 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-04-01 21:17:45 -0400
commit2eb67f9481d858474e77af545e71f68b2cea7041 (patch)
treec08cbcdb85f20edc4f3198f17f1c5597dfc0dae7 /ufund-ui/src/app/components/signup/signup.component.ts
parent77f3cf60bbb9e7b13cc2642fa06b5f40dccdbdb1 (diff)
downloadJellySolutions-2eb67f9481d858474e77af545e71f68b2cea7041.tar.gz
JellySolutions-2eb67f9481d858474e77af545e71f68b2cea7041.tar.bz2
JellySolutions-2eb67f9481d858474e77af545e71f68b2cea7041.zip
Simplify sign up process
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)