Skip to content

Commit

Permalink
latest canary
Browse files Browse the repository at this point in the history
  • Loading branch information
peintnermax committed Dec 27, 2024
1 parent 876c8bd commit 81190d1
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 71 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions apps/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"copy-to-clipboard": "^3.3.3",
"deepmerge": "^4.3.1",
"moment": "^2.29.4",
"next": "15.0.4-canary.23",
"next": "15.1.1-canary.21",
"next-intl": "^3.25.1",
"next-themes": "^0.2.1",
"nice-grpc": "2.0.1",
Expand Down Expand Up @@ -75,7 +75,7 @@
"cypress": "^13.15.2",
"del-cli": "6.0.0",
"env-cmd": "^10.1.0",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"grpc-tools": "1.12.4",
"jsdom": "^25.0.1",
"lint-staged": "15.2.10",
Expand Down
4 changes: 3 additions & 1 deletion apps/login/src/app/(login)/idp/[provider]/success/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ export default async function Page(props: {
// this just returns orgs where the suffix is set as primary domain
const orgs = await getOrgsByDomain(suffix);
const orgToCheckForDiscovery =
orgs.result && orgs.result.length === 1 ? orgs.result[0].id : undefined;
orgs?.result && orgs.result.length === 1
? orgs.result[0]?.id
: undefined;

const orgLoginSettings = await getLoginSettings(orgToCheckForDiscovery);
if (orgLoginSettings?.allowDomainDiscovery) {
Expand Down
10 changes: 5 additions & 5 deletions apps/login/src/helpers/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,17 @@ export const COLORS: ColorShade[] = [
700: "#be123c",
900: "#881337",
},
] as ColorShade[];
];

export function getColorHash(value: string): ColorShade {
let hash = 0;

if (value.length === 0 && COLORS[hash]) {
return COLORS[hash];
if (value.length === 0 && COLORS[hash] !== undefined) {
return COLORS[hash] as ColorShade;
}

hash = hashCode(value);
return COLORS[hash % COLORS.length];
return COLORS[hash % COLORS.length] as ColorShade;
}

export function hashCode(str: string, seed = 0): number {
Expand Down Expand Up @@ -435,5 +435,5 @@ export function getMembershipColor(role: string): ColorShade {
break;
}

return color;
return color as ColorShade;
}
5 changes: 3 additions & 2 deletions apps/login/src/i18n/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export default getRequestConfig(async () => {

let locale: string = fallback;

const languageHeader = await (await headers()).get(LANGUAGE_HEADER_NAME);
if (languageHeader) {
const _headers = await headers();
const languageHeader = _headers.get(LANGUAGE_HEADER_NAME);
if (languageHeader !== undefined) {
const headerLocale = languageHeader.split(",")[0].split("-")[0]; // Extract the language code
if (LANGS.map((l) => l.code).includes(headerLocale)) {
locale = headerLocale;
Expand Down
115 changes: 54 additions & 61 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81190d1

Please sign in to comment.