register, login, create and manage sites and pages

This commit is contained in:
Krrish Ghimire
2026-06-30 11:13:55 +05:45
commit 65f38d68c5
110 changed files with 28049 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AuthService } from '../../core/services/auth.service';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@Component({
selector: 'app-oauth-callback',
standalone: true,
imports: [MatProgressSpinnerModule],
template: `
<div class="min-h-screen flex items-center justify-center bg-gray-50">
<div class="text-center">
<mat-spinner diameter="40" class="mx-auto mb-4"></mat-spinner>
<p class="text-gray-500">Completing sign in...</p>
</div>
</div>
`,
})
export class OAuthCallbackComponent implements OnInit {
constructor(
private route: ActivatedRoute,
private router: Router,
private authService: AuthService,
) {}
ngOnInit(): void {
const accessToken = this.route.snapshot.queryParamMap.get('accessToken');
const refreshToken = this.route.snapshot.queryParamMap.get('refreshToken');
if (accessToken && refreshToken) {
this.authService.setSessionFromOAuth(accessToken, refreshToken);
this.router.navigate(['/dashboard']);
} else {
this.router.navigate(['/login']);
}
}
}