aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/app.component.ts
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/app.component.ts
parent8e93fe31c81c4c36e66c48e7efcdbfedb1877385 (diff)
downloadJellySolutions-c02c47efcb00782feb1461534923023a711d4f15.tar.gz
JellySolutions-c02c47efcb00782feb1461534923023a711d4f15.tar.bz2
JellySolutions-c02c47efcb00782feb1461534923023a711d4f15.zip
First attempt at an authentication system.
Diffstat (limited to '')
-rw-r--r--ufund-ui/src/app/app.component.ts21
1 files changed, 18 insertions, 3 deletions
diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts
index 2dbf33c..a85d04b 100644
--- a/ufund-ui/src/app/app.component.ts
+++ b/ufund-ui/src/app/app.component.ts
@@ -1,4 +1,7 @@
-import { Component } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {UsersService} from './services/users.service';
+import {BehaviorSubject, Observable, Subject} from 'rxjs';
+import {User} from './models/User';
@Component({
selector: 'app-root',
@@ -6,6 +9,18 @@ import { Component } from '@angular/core';
standalone: false,
styleUrl: './app.component.css'
})
-export class AppComponent {
- title = 'ufund-ui';
+export class AppComponent implements OnInit {
+ // title = 'ufund-ui';
+ currentUser$: BehaviorSubject<string> = new BehaviorSubject<string>("Logged out.");
+
+ constructor(
+ private userService: UsersService
+ ) {}
+
+ ngOnInit() {
+ this.userService.getCurrentUser().subscribe(r => {
+ this.currentUser$?.next("Logged in as " + r.username)
+ })
+ }
+
}