Skip to content

Commit

Permalink
chore: add mattermost login
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Jul 30, 2024
1 parent b3c4b4e commit 5b71e7e
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 56 deletions.
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"formatter": {
"enabled": true,
"formatWithErrors": true,
Expand All @@ -25,7 +25,7 @@
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "all",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "tsx server.ts",
"build": "CONFIG=$(cat .config/config.json) next build",
"start": "NODE_ENV=production tsx server.ts",
"check": "biome check --apply .",
"check": "biome check --write .",
"drizzle-kit": "drizzle-kit",
"db:push": "drizzle-kit push",
"config:generate": "ts-json-schema-generator --tsconfig ./tsconfig.json --path ./src/types/config.d.ts --type Config > ./.config/config-schema.json"
Expand Down Expand Up @@ -66,7 +66,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.7.0",
"@biomejs/biome": "1.8.3",
"@types/node": "^20.11.30",
"@types/novnc__novnc": "^1.3.5",
"@types/pg": "^8.11.4",
Expand Down
99 changes: 52 additions & 47 deletions pnpm-lock.yaml

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

24 changes: 20 additions & 4 deletions src/components/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { SVGProps } from "react";
export const GitHubIcon = (props: SVGProps<SVGSVGElement>) => (
type Props = SVGProps<SVGSVGElement>;
export const GitHubIcon = (props: Props) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" {...props}>
<title>{"GitHub"}</title>
<path d="M5.884 18.653c-.3-.2-.558-.455-.86-.816a50.59 50.59 0 0 1-.466-.579c-.463-.575-.755-.841-1.056-.95a1 1 0 1 1 .675-1.882c.752.27 1.261.735 1.947 1.588-.094-.117.34.427.433.539.19.227.33.365.44.438.204.137.588.196 1.15.14.024-.382.094-.753.202-1.095-2.968-.726-4.648-2.64-4.648-6.396 0-1.24.37-2.356 1.058-3.292-.218-.894-.185-1.975.302-3.192a1 1 0 0 1 .63-.582c.081-.024.127-.035.208-.047.803-.124 1.937.17 3.415 1.096a11.73 11.73 0 0 1 2.687-.308c.912 0 1.819.104 2.684.308 1.477-.933 2.614-1.227 3.422-1.096.085.013.158.03.218.05a1 1 0 0 1 .616.58c.487 1.216.52 2.296.302 3.19.691.936 1.058 2.045 1.058 3.293 0 3.757-1.674 5.665-4.642 6.392.125.415.19.878.19 1.38 0 .665-.002 1.299-.007 2.01 0 .19-.002.394-.005.706a1 1 0 0 1-.018 1.958c-1.14.227-1.984-.532-1.984-1.525l.002-.447.005-.705c.005-.707.008-1.337.008-1.997 0-.697-.184-1.152-.426-1.361-.661-.57-.326-1.654.541-1.751 2.966-.333 4.336-1.482 4.336-4.66 0-.955-.312-1.744-.913-2.404A1 1 0 0 1 17.2 6.19c.166-.414.236-.957.095-1.614l-.01.003c-.491.139-1.11.44-1.858.949a1 1 0 0 1-.833.135 9.626 9.626 0 0 0-2.592-.349c-.89 0-1.772.118-2.592.35a1 1 0 0 1-.829-.134c-.753-.507-1.374-.807-1.87-.947-.143.653-.072 1.194.093 1.607a1 1 0 0 1-.189 1.045c-.597.655-.913 1.458-.913 2.404 0 3.172 1.371 4.328 4.322 4.66.865.097 1.202 1.177.545 1.748-.193.168-.43.732-.43 1.364v3.15c0 .985-.834 1.725-1.96 1.528a1 1 0 0 1-.04-1.962v-.99c-.91.061-1.661-.088-2.254-.485Z" />
</svg>
);
export const DiscordIcon = (props: SVGProps<SVGSVGElement>) => (
export const DiscordIcon = (props: Props) => (
<svg viewBox="0 0 24 24" {...props}>
<title>Discord</title>
<path
Expand All @@ -14,13 +15,13 @@ export const DiscordIcon = (props: SVGProps<SVGSVGElement>) => (
/>
</svg>
);
export const GoogleIcon = (props: SVGProps<SVGSVGElement>) => (
export const GoogleIcon = (props: Props) => (
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" {...props}>
<title>Google</title>
<path d="M3.064 7.51A9.996 9.996 0 0 1 12 2c2.695 0 4.959.991 6.69 2.605l-2.867 2.868C14.786 6.482 13.468 5.977 12 5.977c-2.605 0-4.81 1.76-5.595 4.123-.2.6-.314 1.24-.314 1.9 0 .66.114 1.3.314 1.9.786 2.364 2.99 4.123 5.595 4.123 1.345 0 2.49-.355 3.386-.955a4.6 4.6 0 0 0 1.996-3.018H12v-3.868h9.418c.118.654.182 1.336.182 2.045 0 3.046-1.09 5.61-2.982 7.35C16.964 21.105 14.7 22 12 22A9.996 9.996 0 0 1 2 12c0-1.614.386-3.14 1.064-4.49Z" />
</svg>
);
export const GitLabIcon = (props: SVGProps<SVGSVGElement>) => (
export const GitLabIcon = (props: Props) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={24}
Expand All @@ -37,3 +38,18 @@ export const GitLabIcon = (props: SVGProps<SVGSVGElement>) => (
<path d="m22 13.29-3.33-10a.42.42 0 0 0-.14-.18.38.38 0 0 0-.22-.11.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18l-2.26 6.67H8.32L6.1 3.26a.42.42 0 0 0-.1-.18.38.38 0 0 0-.26-.08.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18L2 13.29a.74.74 0 0 0 .27.83L12 21l9.69-6.88a.71.71 0 0 0 .31-.83Z" />
</svg>
);
export const MattermostIcon = (props: Props) => (
<svg xmlns="http://www.w3.org/2000/svg" width={700} height={700} fill="none" {...props}>
<title>Mattermost</title>
<path
fillRule="evenodd"
d="m496.909 147.716 2.631 53.063c43.019 47.524 59.999 114.83 38.585 178.086-31.966 94.427-137.372 144.065-235.431 110.87-98.059-33.195-151.637-136.654-119.671-231.082 21.485-63.467 76.148-106.7 139.457-118.148l34.205-40.414c-106.716-2.89-207.397 63.351-243.42 169.762-44.26 130.745 25.849 272.615 156.594 316.876 130.745 44.261 272.615-25.849 316.876-156.594 35.965-106.24-3.587-219.827-89.826-282.419Z"
clipRule="evenodd"
/>
<path
fillRule="evenodd"
d="m435.623 304.289-1.811-74.18-1.453-42.685-.983-36.98s.205-17.832-.417-22.022a6.832 6.832 0 0 0-.738-2.226c-.041-.088-.08-.176-.125-.262a5.584 5.584 0 0 0-.142-.229c-.684-1.177-1.759-2.133-3.15-2.604-1.423-.482-2.895-.363-4.173.189l-.079.03a5.765 5.765 0 0 0-.443.226 6.856 6.856 0 0 0-1.825 1.262c-3.04 2.95-13.709 17.24-13.709 17.24l-23.244 28.778-27.083 33.025-46.499 57.826s-21.338 26.631-16.623 59.411 29.085 48.749 47.991 55.15c18.906 6.4 47.965 8.518 71.623-14.657 23.656-23.176 22.883-57.292 22.883-57.292Z"
clipRule="evenodd"
/>
</svg>
);
7 changes: 6 additions & 1 deletion src/lib/auth.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DiscordIcon, GitHubIcon, GitLabIcon, GoogleIcon } from "@/components/icons";
import { DiscordIcon, GitHubIcon, GitLabIcon, GoogleIcon, MattermostIcon } from "@/components/icons";
import { LogIn } from "lucide-react";
import type { NextAuthConfig } from "next-auth";
import type { OAuthUserConfig, OIDCUserConfig, Provider } from "next-auth/providers";
Expand All @@ -7,6 +7,7 @@ import Discord from "next-auth/providers/discord";
import GitHub from "next-auth/providers/github";
import GitLab from "next-auth/providers/gitlab";
import Google from "next-auth/providers/google";
import Mattermost from "next-auth/providers/mattermost";
import Okta from "next-auth/providers/okta";
import { getConfig } from "./config";
const { auth: authConfig } = getConfig();
Expand Down Expand Up @@ -40,6 +41,10 @@ const providersList = {
provider: Okta,
Icon: LogIn,
},
mattermost: {
provider: Mattermost,
Icon: MattermostIcon,
},
} as const;

const providers: Provider[] = [];
Expand Down

0 comments on commit 5b71e7e

Please sign in to comment.