JS frontend stuff

Move old ember frontend to properly named folder
Add vue based new frontend
This commit is contained in:
Melody Becker 2025-07-07 21:48:39 +02:00
parent 8947d97825
commit 88398334fe
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
254 changed files with 837 additions and 0 deletions

View file

@ -1,50 +0,0 @@
import { action } from '@ember/object';
import { service } from '@ember/service';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import '@simplewebauthn/browser';
import {
startAuthentication,
startRegistration,
} from '@simplewebauthn/browser';
import type AuthService from 'frontend-reactive/services/auth';
export interface AuthSignature {
// The arguments accepted by the component
Args: {};
// Any blocks yielded by the component
Blocks: {
default: [];
};
// The element to which `...attributes` is applied in the component template
Element: null;
}
export default class Auth extends Component<AuthSignature> {
@tracked username: string = '';
@tracked error: string | undefined;
//@tracked isLogin = true;
@service declare auth: AuthService;
@action async startLogin() {
try {
// TODO: Check if account exists and is alowed to login
this.auth.startLogin(this.username);
} catch (error: any) {
this.error = 'Error: ' + error.message;
}
}
@action async startRegistration() {
try {
// TODO: Check if handle is already taken
await this.auth.startRegistration(this.username);
// After registration, log in immediately to obtain a valid session token
// for the "post" registration data, such as email
await this.auth.startLogin(this.username);
// And after login,
} catch (error: any) {
this.error = 'Error: ' + error.message;
}
}
}