Skip to content

Commit

Permalink
adjust vault config to new ports
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Feb 18, 2022
1 parent 15f2733 commit 7c03924
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/common/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface VaultConfigHeaderHub {
clientId: string
authEndpoint: string
tokenEndpoint: string
deviceRegistrationUrl: string,
devicesResourceUrl: string,
authSuccessUrl: string
authErrorUrl: string
}
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/common/vaultconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export class VaultConfig {
}

public static async create(vaultId: string, masterkey: Masterkey): Promise<VaultConfig> {
const kid = `hub+http://localhost:8080/vaults/${vaultId}`;
const cfg = config.get();

const kid = `hub+http://localhost:8080/vaults/${vaultId}`; // TODO: read from config

const hubConfig: VaultConfigHeaderHub = {
clientId: 'cryptomator-hub',
authEndpoint: `${config.get().keycloakUrl}realms/cryptomator/protocol/openid-connect/auth`, // TODO: read full endpoint url from config
tokenEndpoint: `${config.get().keycloakUrl}realms/cryptomator/protocol/openid-connect/token`,
deviceRegistrationUrl: `${location.protocol}//${location.host}${import.meta.env.BASE_URL}#/devices/register?vault=${vaultId}`,
clientId: 'cryptomator-hub', // TODO: read from config
authEndpoint: `${cfg.keycloakUrl}/realms/${cfg.keycloakRealm}/protocol/openid-connect/auth`, // TODO: read from config
tokenEndpoint: `${cfg.keycloakUrl}/realms/${cfg.keycloakRealm}/protocol/openid-connect/token`, // TODO: read from config
devicesResourceUrl: 'http://localhost:8080/devices/', // TODO: read from config
authSuccessUrl: `${location.protocol}//${location.host}${import.meta.env.BASE_URL}#/unlock-success?vault=${vaultId}`,
authErrorUrl: `${location.protocol}//${location.host}${import.meta.env.BASE_URL}#/unlock-error?vault=${vaultId}`
};
Expand Down

0 comments on commit 7c03924

Please sign in to comment.