Skip to content

Commit

Permalink
fix: remove trailing slash from agent and boot url (WebOfTrust#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
HunnySajid authored Aug 7, 2024
1 parent 0707920 commit 13da646
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/ui/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const StyledInputError = styled.p`
color: ${({ theme }) => theme?.colors?.error};
font-size: 12px;
margin: 0;
overflow-wrap: break-word;
`;

export const Input = ({
Expand Down
11 changes: 9 additions & 2 deletions src/pages/background/services/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { browserStorageService } from "@pages/background/services/browser-storage";
import { default as defaultVendor } from "@src/config/vendor.json";
import { removeSlash } from "@shared/utils";

const CONFIG_ENUMS = {
VENDOR_URL: "vendor-url",
Expand Down Expand Up @@ -63,7 +64,10 @@ const Config = () => {
};

const setBootUrl = async (token: string) => {
await browserStorageService.setValue(CONFIG_ENUMS.BOOT_URL, token);
await browserStorageService.setValue(
CONFIG_ENUMS.BOOT_URL,
removeSlash(token)
);
};

const getBootUrl = async (): Promise<string> => {
Expand All @@ -73,7 +77,10 @@ const Config = () => {
};

const setAgentUrl = async (token: string) => {
await browserStorageService.setValue(CONFIG_ENUMS.AGENT_URL, token);
await browserStorageService.setValue(
CONFIG_ENUMS.AGENT_URL,
removeSlash(token)
);
};

const getHasOnboarded = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/background/services/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { browserStorageService } from "@pages/background/services/browser-storag
import { ObjectOfObject, ISession } from "@config/types";

const SESSION_ENUMS = {
EXPIRY_IN_MINS: 5,
EXPIRY_IN_MINS: 30,
SESSIONS: "sessions",
};

Expand Down

0 comments on commit 13da646

Please sign in to comment.