mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(bitwarden): rename server location
This commit is contained in:
parent
51b55a4cd1
commit
61c6ce72c8
|
@ -52,8 +52,8 @@ export class BitwardenApi implements ICredentialType {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Server Geographies',
|
displayName: 'Region',
|
||||||
name: 'serverLocation',
|
name: 'region',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
default: 'bitwarden.com',
|
default: 'bitwarden.com',
|
||||||
options: [
|
options: [
|
||||||
|
|
|
@ -13,10 +13,10 @@ import { NodeApiError } from 'n8n-workflow';
|
||||||
* Return the access token URL based on the user's environment.
|
* Return the access token URL based on the user's environment.
|
||||||
*/
|
*/
|
||||||
async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
|
async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
|
||||||
const { environment, domain, serverLocation } = await this.getCredentials('bitwardenApi');
|
const { environment, domain, region } = await this.getCredentials('bitwardenApi');
|
||||||
|
|
||||||
return environment === 'cloudHosted'
|
return environment === 'cloudHosted'
|
||||||
? `https://identity.${serverLocation}/connect/token`
|
? `https://identity.${region}/connect/token`
|
||||||
: `${domain}/identity/connect/token`;
|
: `${domain}/identity/connect/token`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ async function getTokenUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
|
||||||
* Return the base API URL based on the user's environment.
|
* Return the base API URL based on the user's environment.
|
||||||
*/
|
*/
|
||||||
async function getBaseUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
|
async function getBaseUrl(this: IExecuteFunctions | ILoadOptionsFunctions) {
|
||||||
const { environment, domain, serverLocation } = await this.getCredentials('bitwardenApi');
|
const { environment, domain, region } = await this.getCredentials('bitwardenApi');
|
||||||
|
|
||||||
return environment === 'cloudHosted' ? `https://api.${serverLocation}` : `${domain}/api`;
|
return environment === 'cloudHosted' ? `https://api.${region}` : `${domain}/api`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue