local api/identity uri paths
This commit is contained in:
parent
8a3fb92bbe
commit
1ea9d28523
|
@ -465,7 +465,7 @@ gulp.task('deploy-preview', ['dist'], function () {
|
||||||
return gulp.src(paths.dist + '**/*')
|
return gulp.src(paths.dist + '**/*')
|
||||||
.pipe(ghPages({
|
.pipe(ghPages({
|
||||||
cacheDir: paths.dist + '.publish',
|
cacheDir: paths.dist + '.publish',
|
||||||
remoteUrl: 'git@github.com:kspearrin/bitwarden-web-preview.git'
|
remoteUrl: 'git@github.com:bitwarden/web-preview.git'
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"appSettings": {
|
"appSettings": {
|
||||||
"apiUri": "https://preview-api.bitwarden.com",
|
"apiUri": "/api",
|
||||||
"identityUri": "https://preview-identity.bitwarden.com",
|
"identityUri": "/identity",
|
||||||
"iconsUri": "https://icons.bitwarden.com",
|
"iconsUri": "https://icons.bitwarden.com",
|
||||||
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
|
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
|
||||||
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
|
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
|
||||||
"whitelistDomains": [
|
"whitelistDomains": [
|
||||||
"preview-api.bitwarden.com"
|
"preview-vault.bitwarden.com"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"appSettings": {
|
"appSettings": {
|
||||||
"apiUri": "https://api.bitwarden.com",
|
"apiUri": "/api",
|
||||||
"identityUri": "https://identity.bitwarden.com",
|
"identityUri": "/identity",
|
||||||
"iconsUri": "https://icons.bitwarden.com",
|
"iconsUri": "https://icons.bitwarden.com",
|
||||||
"stripeKey": "pk_live_bpN0P37nMxrMQkcaHXtAybJk",
|
"stripeKey": "pk_live_bpN0P37nMxrMQkcaHXtAybJk",
|
||||||
"braintreeKey": "production_qfbsv8kc_njj2zjtyngtjmbjd",
|
"braintreeKey": "production_qfbsv8kc_njj2zjtyngtjmbjd",
|
||||||
"whitelistDomains": [
|
"whitelistDomains": [
|
||||||
"api.bitwarden.com"
|
"vault.bitwarden.com"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,27 +14,15 @@ angular
|
||||||
$qProvider.errorOnUnhandledRejections(false);
|
$qProvider.errorOnUnhandledRejections(false);
|
||||||
$locationProvider.hashPrefix('');
|
$locationProvider.hashPrefix('');
|
||||||
|
|
||||||
var jwtConfig = {
|
if (appSettings.apiUri !== '/api' && appSettings.whitelistDomains && appSettings.whitelistDomains.length) {
|
||||||
whiteListedDomains: appSettings.whitelistDomains
|
jwtOptionsProvider.config({
|
||||||
};
|
whiteListedDomains: appSettings.whitelistDomains
|
||||||
|
});
|
||||||
if (!appSettings.selfHosted) {
|
|
||||||
var userAgent = navigator.userAgent.toLowerCase();
|
|
||||||
if (userAgent.indexOf('safari') > -1 && userAgent.indexOf('chrome') === -1) {
|
|
||||||
// Safari doesn't work with unconventional "Content-Language" header for CORS.
|
|
||||||
// See notes here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
|
|
||||||
jwtConfig.urlParam = 'access_token';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Using Content-Language header since it is unused and is a CORS-safelisted header. This avoids pre-flights.
|
|
||||||
jwtConfig.authHeader = 'Content-Language';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jwtOptionsProvider.config(jwtConfig);
|
|
||||||
var refreshPromise;
|
var refreshPromise;
|
||||||
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) {
|
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) {
|
||||||
if (options.url.indexOf(appSettings.apiUri) !== 0) {
|
if (options.url.indexOf(appSettings.apiUri + '/') === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
angular.module("bit")
|
angular.module("bit")
|
||||||
.constant("appSettings", {"apiUri":"https://api.bitwarden.com","identityUri":"https://identity.bitwarden.com","iconsUri":"https://icons.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","whitelistDomains":["api.bitwarden.com"],"selfHosted":false,"version":"1.21.0","environment":"Production"});
|
.constant("appSettings", {"apiUri":"/api","identityUri":"/identity","iconsUri":"https://icons.bitwarden.com","stripeKey":"pk_live_bpN0P37nMxrMQkcaHXtAybJk","braintreeKey":"production_qfbsv8kc_njj2zjtyngtjmbjd","whitelistDomains":["vault.bitwarden.com"],"selfHosted":false,"version":"1.21.0","environment":"Production"});
|
||||||
|
|
Loading…
Reference in New Issue