main #13
4 changed files with 17 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
<h2 mat-dialog-title>{{ data.title }}</h2>
|
<h2 mat-dialog-title>{{ data.title }}</h2>
|
||||||
<mat-dialog-content>{{ data.description }}</mat-dialog-content>
|
<mat-dialog-content>{{ data.description }}</mat-dialog-content>
|
||||||
<mat-dialog-actions>
|
<mat-dialog-actions>
|
||||||
<button mat-flat-button color="warn" (click)="close()">No</button>
|
<button mat-flat-button (click)="close()">No</button>
|
||||||
<button mat-flat-button (click)="accept()">Yes</button>
|
<button mat-flat-button color="warn" (click)="accept()">Yes</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
|
|
|
@ -24,9 +24,16 @@
|
||||||
placeholder="Aurelius14"
|
placeholder="Aurelius14"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<button class="mb-3" mat-flat-button type="submit" (click)="submit()">Login</button>
|
<button class="mb-3" mat-flat-button type="submit" (click)="submit()">
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
<button mat-flat-button [style.backgroundColor]="'#FD4B2D'" class="mt-3 mat-authentik" (click)="loginWithAuthentik()">
|
<button
|
||||||
|
mat-flat-button
|
||||||
|
[style.backgroundColor]="'#FD4B2D'"
|
||||||
|
class="mt-3 mat-authentik"
|
||||||
|
(click)="loginWithAuthentik()"
|
||||||
|
>
|
||||||
Log in with Authentik
|
Log in with Authentik
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
import { MatInputModule, MatLabel } from '@angular/material/input';
|
import { MatInputModule, MatLabel } from '@angular/material/input';
|
||||||
import { MatButton, MatButtonModule } from '@angular/material/button';
|
import { MatButton, MatButtonModule } from '@angular/material/button';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import {MatDividerModule} from '@angular/material/divider';
|
import { MatDividerModule } from '@angular/material/divider';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
|
@ -38,7 +38,7 @@ export class LoginComponent {
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private snackBar: MatSnackBar,
|
private snackBar: MatSnackBar,
|
||||||
) { }
|
) {}
|
||||||
|
|
||||||
private validationErrorMessages: Record<string, string> = {
|
private validationErrorMessages: Record<string, string> = {
|
||||||
required: 'This field is required',
|
required: 'This field is required',
|
||||||
|
@ -78,7 +78,9 @@ export class LoginComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
loginWithAuthentik() {
|
loginWithAuthentik() {
|
||||||
this.pb.collection('users').authWithOAuth2({ provider: 'oidc' })
|
this.pb
|
||||||
|
.collection('users')
|
||||||
|
.authWithOAuth2({ provider: 'oidc' })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.router.navigate(['dashboard']);
|
this.router.navigate(['dashboard']);
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,8 +15,6 @@ html {
|
||||||
@apply underline text-blue-500 cursor-pointer;
|
@apply underline text-blue-500 cursor-pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
Loading…
Add table
Reference in a new issue