Skip to content

Commit

Permalink
chore: changing auth url
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Sep 15, 2024
1 parent 3d132de commit b4f9941
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 57 deletions.
102 changes: 53 additions & 49 deletions src/main/services/hydra-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,54 +81,54 @@ export class HydraApi {
baseURL: import.meta.env.MAIN_VITE_API_URL,
});

// this.instance.interceptors.request.use(
// (request) => {
// logger.log(" ---- REQUEST -----");
// logger.log(request.method, request.url, request.params, request.data);
// return request;
// },
// (error) => {
// logger.error("request error", error);
// return Promise.reject(error);
// }
// );

// this.instance.interceptors.response.use(
// (response) => {
// logger.log(" ---- RESPONSE -----");
// logger.log(
// response.status,
// response.config.method,
// response.config.url,
// response.data
// );
// return response;
// },
// (error) => {
// logger.error(" ---- RESPONSE ERROR -----");

// const { config } = error;

// logger.error(
// config.method,
// config.baseURL,
// config.url,
// config.headers,
// config.data
// );

// if (error.response) {
// logger.error("Response", error.response.status, error.response.data);
// } else if (error.request) {
// logger.error("Request", error.request);
// } else {
// logger.error("Error", error.message);
// }

// logger.error(" ----- END RESPONSE ERROR -------");
// return Promise.reject(error);
// }
// );
this.instance.interceptors.request.use(
(request) => {
logger.log(" ---- REQUEST -----");
logger.log(request.method, request.url, request.params, request.data);
return request;
},
(error) => {
logger.error("request error", error);
return Promise.reject(error);
}
);

this.instance.interceptors.response.use(
(response) => {
logger.log(" ---- RESPONSE -----");
logger.log(
response.status,
response.config.method,
response.config.url,
response.data
);
return response;
},
(error) => {
logger.error(" ---- RESPONSE ERROR -----");

const { config } = error;

logger.error(
config.method,
config.baseURL,
config.url,
config.headers,
config.data
);

if (error.response) {
logger.error("Response", error.response.status, error.response.data);
} else if (error.request) {
logger.error("Request", error.request);
} else {
logger.error("Error", error.message);
}

logger.error(" ----- END RESPONSE ERROR -------");
return Promise.reject(error);
}
);

const userAuth = await userAuthRepository.findOne({
where: { id: 1 },
Expand Down Expand Up @@ -192,7 +192,11 @@ export class HydraApi {

private static handleUnauthorizedError = (err) => {
if (err instanceof AxiosError && err.response?.status === 401) {
logger.error("401 - Current credentials:", this.userAuth);
logger.error(
"401 - Current credentials:",
this.userAuth,
err.response?.data
);

this.userAuth = {
authToken: "",
Expand Down
2 changes: 1 addition & 1 deletion src/main/services/window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class WindowManager {
});

authWindow.loadURL(
`https://auth.hydra.losbroxas.org/?${searchParams.toString()}`
`https://auth.hydralauncher.gg/?${searchParams.toString()}`
);

authWindow.once("ready-to-show", () => {
Expand Down
10 changes: 3 additions & 7 deletions src/renderer/src/pages/game-details/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,12 @@ export function Sidebar() {
<p>{numberFormatter.format(stats?.playerCount)}</p>
</div>
</div>

<div
className={styles.contentSidebarTitle}
style={{ border: "none" }}
>
<h3>{t("requirements")}</h3>
</div>
</>
)}

<div className={styles.contentSidebarTitle} style={{ border: "none" }}>
<h3>{t("requirements")}</h3>
</div>
<div className={styles.requirementButtonContainer}>
<Button
className={styles.requirementButton}
Expand Down

0 comments on commit b4f9941

Please sign in to comment.