-
Request email for account verification
-
-
-
-
- This instance does not require email verification.
-
-
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
deleted file mode 100644
index 127f61284..000000000
--- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Component, OnInit, inject } from '@angular/core'
-import { SignupService } from '@app/+signup/shared/signup.service'
-import { Notifier, RedirectService, ServerService } from '@app/core'
-import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators'
-import { FormReactive } from '@app/shared/shared-forms/form-reactive'
-import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
-import { FormsModule, ReactiveFormsModule } from '@angular/forms'
-import { NgIf, NgClass } from '@angular/common'
-
-@Component({
- selector: 'my-verify-account-ask-send-email',
- templateUrl: './verify-account-ask-send-email.component.html',
- styleUrls: [ './verify-account-ask-send-email.component.scss' ],
- imports: [ NgIf, FormsModule, ReactiveFormsModule, NgClass ]
-})
-export class VerifyAccountAskSendEmailComponent extends FormReactive implements OnInit {
- protected formReactiveService = inject(FormReactiveService)
- private signupService = inject(SignupService)
- private serverService = inject(ServerService)
- private notifier = inject(Notifier)
- private redirectService = inject(RedirectService)
-
- requiresEmailVerification = false
-
- ngOnInit () {
- this.serverService.getConfig()
- .subscribe(config => this.requiresEmailVerification = config.signup.requiresEmailVerification)
-
- this.buildForm({
- 'verify-email-email': USER_EMAIL_VALIDATOR
- })
- }
-
- askSendVerifyEmail () {
- const email = this.form.value['verify-email-email']
- this.signupService.askSendVerifyEmail(email)
- .subscribe({
- next: () => {
- this.notifier.success($localize`An email with verification link will be sent to ${email}.`)
- this.redirectService.redirectToHomepage()
- },
-
- error: err => this.notifier.error(err.message)
- })
- }
-}
diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
index ec8d79291..683809272 100644
--- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
+++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html
@@ -1,19 +1,20 @@
Verify email
-
-
+ @if (success) {
+ @if (this.isRegistration() || this.isRegistrationRequest()) {
+
+ } @else {
+
Email updated.
+ }
-
Email updated.
+ } @else if (failed) {
+
+ An error occurred.
-
- An error occurred.
-
-
- Request a new verification email
-
-
+
+ Request a new verification email
+
+
+ }
diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
index feb8db713..b055b8c86 100644
--- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
+++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
@@ -2,7 +2,7 @@ import { NgIf } from '@angular/common'
import { Component, OnInit, inject } from '@angular/core'
import { ActivatedRoute, RouterLink } from '@angular/router'
import { SignupService } from '@app/+signup/shared/signup.service'
-import { AuthService, Notifier, ServerService } from '@app/core'
+import { AuthService, Notifier, ServerService, UserService } from '@app/core'
import { AlertComponent } from '@app/shared/shared-main/common/alert.component'
import { SignupSuccessAfterEmailComponent } from '../../shared/signup-success-after-email.component'
@@ -13,6 +13,7 @@ import { SignupSuccessAfterEmailComponent } from '../../shared/signup-success-af
})
export class VerifyAccountEmailComponent implements OnInit {
private signupService = inject(SignupService)
+ private userService = inject(UserService)
private server = inject(ServerService)
private authService = inject(AuthService)
private notifier = inject(Notifier)
@@ -44,9 +45,7 @@ export class VerifyAccountEmailComponent implements OnInit {
this.userId = queryParams['userId']
this.registrationId = queryParams['registrationId']
-
this.verificationString = queryParams['verificationString']
-
this.isPendingEmail = queryParams['isPendingEmail'] === 'true'
if (!this.verificationString) {
@@ -62,15 +61,12 @@ export class VerifyAccountEmailComponent implements OnInit {
this.verifyEmail()
}
- isRegistrationRequest () {
- return !!this.registrationId
+ isRegistration () {
+ return !this.isPendingEmail
}
- displaySignupSuccess () {
- if (!this.success) return false
- if (!this.isRegistrationRequest() && this.isPendingEmail) return false
-
- return true
+ isRegistrationRequest () {
+ return !!this.registrationId
}
verifyEmail () {
@@ -88,7 +84,7 @@ export class VerifyAccountEmailComponent implements OnInit {
isPendingEmail: this.isPendingEmail
}
- this.signupService.verifyUserEmail(options)
+ this.userService.verifyUserEmail(options)
.subscribe({
next: () => {
if (this.authService.isLoggedIn()) {
diff --git a/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.html b/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.html
new file mode 100644
index 000000000..aaae8d55a
--- /dev/null
+++ b/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.html
@@ -0,0 +1,22 @@
+
+
Request email for account verification
+
+ @if (requiresEmailVerification) {
+
+ } @else {
+
{{ instanceName }} does not require email verification.
+ }
+
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss b/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.scss
similarity index 100%
rename from client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss
rename to client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.scss
diff --git a/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.ts
new file mode 100644
index 000000000..7c6843b74
--- /dev/null
+++ b/client/src/app/+signup/+verify-account/verify-new-account-ask-send-email/verify-new-account-ask-send-email.component.ts
@@ -0,0 +1,57 @@
+import { NgClass, NgIf } from '@angular/common'
+import { Component, OnInit, inject } from '@angular/core'
+import { FormsModule, ReactiveFormsModule } from '@angular/forms'
+import { SignupService } from '@app/+signup/shared/signup.service'
+import { Notifier, RedirectService, ServerService, UserService } from '@app/core'
+import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators'
+import { FormReactive } from '@app/shared/shared-forms/form-reactive'
+import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
+import { forkJoin } from 'rxjs'
+
+@Component({
+ selector: 'my-verify-new-account-ask-send-email',
+ templateUrl: './verify-new-account-ask-send-email.component.html',
+ styleUrls: [ './verify-new-account-ask-send-email.component.scss' ],
+ imports: [ NgIf, FormsModule, ReactiveFormsModule, NgClass ]
+})
+export class VerifyNewAccountAskSendEmailComponent extends FormReactive implements OnInit {
+ protected formReactiveService = inject(FormReactiveService)
+ private userService = inject(UserService)
+ private signupService = inject(SignupService)
+ private serverService = inject(ServerService)
+ private notifier = inject(Notifier)
+ private redirectService = inject(RedirectService)
+
+ requiresEmailVerification = false
+
+ get instanceName () {
+ return this.serverService.getHTMLConfig().instance.name
+ }
+
+ ngOnInit () {
+ this.serverService.getConfig()
+ .subscribe(config => {
+ this.requiresEmailVerification = config.signup.requiresEmailVerification
+ })
+
+ this.buildForm({
+ 'verify-email-email': USER_EMAIL_VALIDATOR
+ })
+ }
+
+ askSendVerifyEmail () {
+ const email = this.form.value['verify-email-email']
+
+ forkJoin([
+ this.userService.askSendVerifyEmail(email),
+ this.signupService.askSendVerifyEmail(email)
+ ]).subscribe({
+ next: () => {
+ this.notifier.success($localize`An email with verification link will be sent to ${email}.`)
+ this.redirectService.redirectToHomepage()
+ },
+
+ error: err => this.notifier.error(err.message)
+ })
+ }
+}
diff --git a/client/src/app/+signup/shared/signup-success-after-email.component.html b/client/src/app/+signup/shared/signup-success-after-email.component.html
index ef6010740..a00f0ffc2 100644
--- a/client/src/app/+signup/shared/signup-success-after-email.component.html
+++ b/client/src/app/+signup/shared/signup-success-after-email.component.html
@@ -3,19 +3,17 @@