feat: update ProductController route and enhance authentication configuration
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { OAuthService } from 'angular-oauth2-oidc';
|
||||
|
||||
@@ -13,8 +13,9 @@ export class Login implements OnInit {
|
||||
|
||||
}
|
||||
ngOnInit(): void {
|
||||
this.httpClient.get('http://localhost:5000/api/product'
|
||||
// { headers: { Authorization: `Bearer ${this.as.getAccessToken()}` } }
|
||||
this.httpClient.get('http://localhost:5000/swagger/v1/swagger.json', {
|
||||
headers: new HttpHeaders({ Authorization: `Bearer ${this.as.getAccessToken()}` }).append('Content-Type', 'application/json')
|
||||
}
|
||||
).subscribe(console.warn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user