This file contains 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
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Hosting; | |
namespace CleanArchitectureApp.WebApi | |
{ | |
/// <summary> | |
/// This class extends from APIGatewayProxyFunction which contains the method FunctionHandlerAsync which is the | |
/// actual Lambda function entry point. The Lambda handler field should be set to | |
/// | |
/// CleanArchitectureApp.WebApi::CleanArchitectureApp.WebApi.LambdaEntryPoint::FunctionHandlerAsync |
This file contains 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
using Amazon.SimpleSystemsManagement; | |
using Amazon.SimpleSystemsManagement.Model; | |
var request = new GetParameterRequest() | |
{ | |
Name = "/CleanArchitectureAppWebApi/postgresconnection" | |
}; | |
using (var client = new AmazonSimpleSystemsManagementClient(Amazon.RegionEndpoint.GetBySystemName("ap-south-1"))) | |
{ | |
var response = client.GetParameterAsync(request).GetAwaiter().GetResult(); |
This file contains 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 { Injectable } from '@angular/core'; | |
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | |
import { Observable } from 'rxjs'; | |
import { AuthenticationService } from '../_services/authentication/authentication.service'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class AuthGuard implements CanActivate { |
This file contains 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 { ErrorHandler, Injectable, Injector } from '@angular/core'; | |
import { ToastService } from '../toast/toast.service'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class GlobalErrorService implements ErrorHandler{ | |
constructor( | |
private injector: Injector |
This file contains 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 { AuthenticationService } from './../_services/authentication/authentication.service'; | |
import { environment } from './../../environments/environment'; | |
import { Injectable } from '@angular/core'; | |
import { | |
HttpRequest, | |
HttpHandler, | |
HttpEvent, | |
HttpInterceptor | |
} from '@angular/common/http'; | |
import { Observable } from 'rxjs'; |
This file contains 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 { environment } from './../../../environments/environment'; | |
import { HttpClient } from '@angular/common/http'; | |
import { Router } from '@angular/router'; | |
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject, Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; | |
import { User } from 'src/app/_models/user.model'; | |
import { ApiResponse } from '../../_models/api-response'; | |
@Injectable({ |
This file contains 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
export interface User { | |
id: string| undefined; | |
username: string| undefined; | |
firstname: string| undefined; | |
lastname: string| undefined; | |
status: string | undefined; | |
createddate: any; | |
token: string | undefined; | |
refreshToken: string | undefined; | |
} |
This file contains 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 { AuthenticationService } from './../../../_services/authentication/authentication.service'; | |
import { ActivatedRoute, Router } from '@angular/router'; | |
import { Component, OnInit, Injector } from '@angular/core'; | |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | |
import { first } from 'rxjs/operators'; | |
import { ToastService } from 'src/app/_services/toast/toast.service'; | |
import { HttpErrorResponse } from '@angular/common/http'; | |
@Component({ | |
templateUrl: './login.component.html', |
This file contains 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="card shadow p-3 mb-5 bg-white rounded card-top"> | |
<h4 class="card-header">Login</h4> | |
<div class="card-body"> | |
<form [formGroup]="form" (ngSubmit)="onSubmit()"> | |
<div class="form-group"> | |
<label for="username">Username</label> | |
<input type="text" formControlName="username" class="form-control" [ngClass]="{ 'is-invalid': submitted && formControls.username.errors }" /> | |
<div *ngIf="submitted && formControls.username.errors" class="invalid-feedback"> |
This file contains 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
namespace CleanArchitectureApp.Application.Features.Users.Commands | |
{ | |
public class CreateUserCommandValidator : AbstractValidator<CreateUserCommand> | |
{ | |
private readonly IUserRepositoryAsync userRepository; | |
public CreateUserCommandValidator(IUserRepositoryAsync userRepository) | |
{ | |
this.userRepository = userRepository; |
NewerOlder