This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="app"> | |
| <nav class="navbar navbar-expand navbar-dark bg-dark"> | |
| <div class="container"> | |
| <a href="#" class="navbar-brand"> | |
| <img | |
| width="32" | |
| alt="Angular Logo" | |
| src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==" | |
| /> | |
| Angular 9 LOGIN JWT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| import { TokenStorageService } from './_services/token-storage.service'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.css'] | |
| }) | |
| export class AppComponent { | |
| title = 'ang9-auth-jwt-lumen7'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { NgModule } from '@angular/core'; | |
| import { AppRoutingModule } from './app-routing.module'; | |
| import { FormsModule } from '@angular/forms'; | |
| import { HttpClientModule } from '@angular/common/http'; | |
| import { AppComponent } from './app.component'; | |
| import { RegisterComponent } from './register/register.component'; | |
| import { LoginComponent } from './login/login.component'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container"> | |
| <header class="jumbotron"> | |
| <p>{{ content }}</p> | |
| </header> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { UserService } from '../_services/user.service'; | |
| @Component({ | |
| selector: 'app-home', | |
| templateUrl: './home.component.html', | |
| styleUrls: ['./home.component.css'] | |
| }) | |
| export class HomeComponent implements OnInit { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container" *ngIf="currentUser; else loggedOut"> | |
| <header class="jumbotron"> | |
| <h3>Profile</h3> | |
| <h3> | |
| <strong>{{ currentUser.username }}</strong> | |
| </h3> | |
| <p> | |
| <strong>Id:</strong> | |
| {{ currentUser.id }} | |
| </p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { TokenStorageService } from '../_services/token-storage.service'; | |
| @Component({ | |
| selector: 'app-profile', | |
| templateUrl: './profile.component.html', | |
| styleUrls: ['./profile.component.css'] | |
| }) | |
| export class ProfileComponent implements OnInit { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| label { | |
| display: block; | |
| margin-top: 10px; | |
| } | |
| .card-container.card { | |
| max-width: 400px !important; | |
| padding: 40px 40px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="col-md-12"> | |
| <div class="card card-container"> | |
| <img | |
| id="profile-img" | |
| src="//ssl.gstatic.com/accounts/ui/avatar_2x.png" | |
| class="profile-img-card" | |
| /> | |
| <form | |
| *ngIf="!isLoggedIn" | |
| name="form" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit } from '@angular/core'; | |
| import { AuthService } from '../_services/auth.service'; | |
| import { TokenStorageService } from '../_services/token-storage.service'; | |
| @Component({ | |
| selector: 'app-login', | |
| templateUrl: './login.component.html', | |
| styleUrls: ['./login.component.css'] | |
| }) | |
| export class LoginComponent implements OnInit { |