fix(frontend): replace HttpClient with generated AuthenticationService in verify-email
This commit is contained in:
parent
ef4eefa4cd
commit
c180d6fd32
@ -1,32 +1,26 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {ActivatedRoute, RouterLink} from '@angular/router';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {AuthenticationService} from '../../api';
|
||||
|
||||
@Component({
|
||||
selector: 'app-verify-email',
|
||||
standalone: true,
|
||||
imports: [RouterLink], // CommonModule wird für die neue Control Flow Syntax nicht mehr benötigt!
|
||||
imports: [RouterLink],
|
||||
templateUrl: './verify-email.html',
|
||||
styleUrl: './verify-email.scss'
|
||||
})
|
||||
export class VerifyEmailComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
|
||||
// Tipp: Hier später idealerweise deinen OpenAPI-generierten Service verwenden,
|
||||
// z.B. private authService = inject(AuthenticationService);
|
||||
private http = inject(HttpClient);
|
||||
private authService = inject(AuthenticationService);
|
||||
|
||||
isLoading = true;
|
||||
isSuccess = false;
|
||||
|
||||
ngOnInit() {
|
||||
const token = this.route.snapshot.queryParamMap.get('token');
|
||||
// Ggf. atNumber auslesen, falls du sie hier mit übergibst
|
||||
|
||||
if (token) {
|
||||
// Wenn du OpenAPI nutzt, kannst du hier die entsprechende Methode aufrufen.
|
||||
// Fürs Beispiel als direkter HTTP-Call:
|
||||
this.http.get(`http://localhost:8080/api/auth/verify-email?token=${token}`).subscribe({
|
||||
this.authService.verifyEmail(token).subscribe({
|
||||
next: () => {
|
||||
this.isLoading = false;
|
||||
this.isSuccess = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user