aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-03-02 11:22:48 -0500
committersowgro <tpoke.ferrari@gmail.com>2025-03-02 11:22:48 -0500
commitc02c47efcb00782feb1461534923023a711d4f15 (patch)
tree8c59e17bc6039d76d0b9522e2535a49a33b3d340 /ufund-ui/src/app/components
parent8e93fe31c81c4c36e66c48e7efcdbfedb1877385 (diff)
downloadJellySolutions-c02c47efcb00782feb1461534923023a711d4f15.tar.gz
JellySolutions-c02c47efcb00782feb1461534923023a711d4f15.tar.bz2
JellySolutions-c02c47efcb00782feb1461534923023a711d4f15.zip
First attempt at an authentication system.
Diffstat (limited to 'ufund-ui/src/app/components')
-rw-r--r--ufund-ui/src/app/components/login/login.component.html8
-rw-r--r--ufund-ui/src/app/components/login/login.component.ts14
2 files changed, 17 insertions, 5 deletions
diff --git a/ufund-ui/src/app/components/login/login.component.html b/ufund-ui/src/app/components/login/login.component.html
index 41427ae..178ddbf 100644
--- a/ufund-ui/src/app/components/login/login.component.html
+++ b/ufund-ui/src/app/components/login/login.component.html
@@ -1,5 +1,5 @@
<p>Login:</p>
-<input placeholder="Username" type="text">
-<input placeholder="Password" type="password">
-<button>Login</button>
-<button>Create Account...</button>
+<input placeholder="Username" type="text" #username>
+<input placeholder="Password" type="password" #password>
+<button type="button" (click)="login(username.value, password.value)">Login</button>
+<button type="button">Create Account...</button>
diff --git a/ufund-ui/src/app/components/login/login.component.ts b/ufund-ui/src/app/components/login/login.component.ts
index efb8a58..9a4eb0f 100644
--- a/ufund-ui/src/app/components/login/login.component.ts
+++ b/ufund-ui/src/app/components/login/login.component.ts
@@ -1,4 +1,5 @@
-import { Component } from '@angular/core';
+import { Component } from '@angular/core'
+import {UsersService} from '../../services/users.service';
@Component({
selector: 'app-login',
@@ -7,5 +8,16 @@ import { Component } from '@angular/core';
styleUrl: './login.component.css'
})
export class LoginComponent {
+ constructor(
+ protected usersService: UsersService
+ ) {}
+ login(username: string | null, password: string | null) {
+ console.log(`attempting to log in with ${username} ${password}`)
+ if (!username || !password) {
+ return;
+ }
+
+ this.usersService.login(username, password)
+ }
}