fix: allow fetch to send auth creds + dev testing

This commit is contained in:
Mohamed Sohail 2021-10-28 19:20:18 +03:00
parent af4342e076
commit 22bc50b0dd
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
3 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,11 @@ An angular admin web client for managing users and transactions in the CIC netwo
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.2.0. This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.2.0.
## Node 17 Specific Dev Env
In package.json:dependencies -> "cic-client-meta": "file:./tmp/cic-client-meta-0.0.7-alpha.6.tgz",
in package.json:scripts -> "start:dev": "export NODE_OPTIONS=--openssl-legacy-provider; ng serve -c dev",
## Angular CLI ## Angular CLI
Run `npm install -g @angular/cli` to install the angular CLI. Run `npm install -g @angular/cli` to install the angular CLI.

View File

@ -81,7 +81,9 @@ export class AuthService {
} }
getChallenge(): Promise<any> { getChallenge(): Promise<any> {
return fetch(environment.cicMetaUrl).then((response) => { return fetch(environment.cicMetaUrl, {
credentials: 'include',
}).then((response) => {
if (response.status === 401) { if (response.status === 401) {
const authHeader: string = response.headers.get('WWW-Authenticate'); const authHeader: string = response.headers.get('WWW-Authenticate');
return hobaParseChallengeHeader(authHeader); return hobaParseChallengeHeader(authHeader);

View File

@ -6,7 +6,8 @@ export const environment = {
logLevel: NgxLoggerLevel.DEBUG, logLevel: NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.OFF, serverLogLevel: NgxLoggerLevel.OFF,
loggingUrl: '', loggingUrl: '',
cicMetaUrl: 'https://meta-auth.dev.grassrootseconomics.net:443', // This should match the cic-auth-helper
cicMetaUrl: 'http://127.0.0.1:5555',
publicKeysUrl: 'https://dev.grassrootseconomics.net/.well-known/publickeys/', publicKeysUrl: 'https://dev.grassrootseconomics.net/.well-known/publickeys/',
cicCacheUrl: 'https://cache.dev.grassrootseconomics.net', cicCacheUrl: 'https://cache.dev.grassrootseconomics.net',
web3Provider: 'wss://bloxberg-ws.dev.grassrootseconomics.net', web3Provider: 'wss://bloxberg-ws.dev.grassrootseconomics.net',