Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { faDiscord, faGithub } from "@fortawesome/free-brands-svg-icons";
import { classnames } from "@thunderstore/cyberstorm/src/utils/utils";
import { buildAuthLoginUrl } from "cyberstorm/utils/ThunderstoreAuth";
import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons";
import { getPublicEnvVariables } from "cyberstorm/security/publicEnvVariables";

export function Navigation(props: {
// hydrationCheck: boolean;
Expand Down Expand Up @@ -226,6 +227,11 @@ export function Navigation(props: {
}

export function DesktopLoginPopover() {
const publicEnvVariables = getPublicEnvVariables([
"VITE_AUTH_BASE_URL",
"VITE_AUTH_RETURN_URL",
]);

return (
<Modal
popoverId={"navAccount"}
Expand Down Expand Up @@ -281,7 +287,11 @@ export function DesktopLoginPopover() {
<div className="navigation-login__links">
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "discord" })}
href={buildAuthLoginUrl({
type: "discord",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__discord"
>
<NewIcon csMode="inline" noWrapper>
Expand All @@ -291,7 +301,11 @@ export function DesktopLoginPopover() {
</NewLink>
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "github" })}
href={buildAuthLoginUrl({
type: "github",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__github"
>
<NewIcon csMode="inline" noWrapper>
Expand All @@ -301,7 +315,11 @@ export function DesktopLoginPopover() {
</NewLink>
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "overwolf" })}
href={buildAuthLoginUrl({
type: "overwolf",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__overwolf"
>
<NewIcon csMode="inline">
Expand Down Expand Up @@ -520,6 +538,10 @@ export function MobileUserPopoverContent(props: {
}) {
const { user, domain } = props;
const avatar = user?.connections.find((c) => c.avatar !== null)?.avatar;
const publicEnvVariables = getPublicEnvVariables([
"VITE_AUTH_BASE_URL",
"VITE_AUTH_RETURN_URL",
]);

return (
<Menu popoverId={"mobileNavAccount"} rootClasses="mobile-navigation__user">
Expand Down Expand Up @@ -601,7 +623,11 @@ export function MobileUserPopoverContent(props: {
<div className="navigation-login__links">
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "discord" })}
href={buildAuthLoginUrl({
type: "discord",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__discord"
>
<NewIcon csMode="inline" noWrapper>
Expand All @@ -611,7 +637,11 @@ export function MobileUserPopoverContent(props: {
</NewLink>
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "github" })}
href={buildAuthLoginUrl({
type: "github",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__github"
>
<NewIcon csMode="inline" noWrapper>
Expand All @@ -621,7 +651,11 @@ export function MobileUserPopoverContent(props: {
</NewLink>
<NewLink
primitiveType="link"
href={buildAuthLoginUrl({ type: "overwolf" })}
href={buildAuthLoginUrl({
type: "overwolf",
authBaseDomain: publicEnvVariables.VITE_AUTH_BASE_URL || "",
authReturnDomain: publicEnvVariables.VITE_AUTH_RETURN_URL || "",
})}
rootClasses="navigation-login__link navigation-login__overwolf"
>
<NewIcon csMode="inline" noWrapper>
Expand Down
11 changes: 5 additions & 6 deletions apps/cyberstorm-remix/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import { hydrateRoot } from "react-dom/client";
import { useLocation, useMatches } from "react-router";
import * as Sentry from "@sentry/remix";
import { useEffect } from "react";
// import { DapperTs } from "@thunderstore/dapper-ts";
import { getPublicEnvVariables } from "cyberstorm/security/publicEnvVariables";

// INIT DAPPER
// window.Dapper = new DapperTs(getConfig, () => {
// clearSession();
// });
const sentryClientDSN = getPublicEnvVariables([
"VITE_CLIENT_SENTRY_DSN",
]).VITE_CLIENT_SENTRY_DSN;

Sentry.init({
dsn: import.meta.env.VITE_CLIENT_SENTRY_DSN,
dsn: sentryClientDSN,
integrations: [
Sentry.browserTracingIntegration({
useEffect,
Expand Down
29 changes: 0 additions & 29 deletions apps/cyberstorm-remix/app/middlewares.ts

This file was deleted.

Loading
Loading