fix: allow fetch to send auth creds + dev testing
This commit is contained in:
parent
af4342e076
commit
22bc50b0dd
@ -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.
|
||||||
|
@ -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);
|
||||||
|
@ -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',
|
||||||
|
Loading…
Reference in New Issue
Block a user