feat(webpage): showing you the menu, hopefully it works??
This commit is contained in:
parent
bd0b9c9a52
commit
a727696e5b
51 changed files with 8573 additions and 688 deletions
31
frontend/src/lib/auth.ts
Normal file
31
frontend/src/lib/auth.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { betterAuth } from "better-auth";
|
||||
import { genericOAuth, username } from "better-auth/plugins";
|
||||
import { Pool } from "pg";
|
||||
import "dotenv/config";
|
||||
|
||||
export const auth = betterAuth({
|
||||
baseURL: process.env.BASE_URL,
|
||||
database: new Pool({
|
||||
connectionString: process.env.PG_CONNECTION_STRING,
|
||||
}),
|
||||
plugins: [
|
||||
username(),
|
||||
genericOAuth({
|
||||
config: [
|
||||
{
|
||||
providerId: "keycloak",
|
||||
clientId: process.env.OAUTH_CLIENT_ID as string,
|
||||
clientSecret: process.env.OAUTH_CLIENT_SECRET as string,
|
||||
|
||||
pkce: true,
|
||||
|
||||
authorizationUrl: `${process.env.OAUTH_ISSUER}/protocol/openid-connect/auth`,
|
||||
tokenUrl: `${process.env.OAUTH_ISSUER}/protocol/openid-connect/token`,
|
||||
userInfoUrl: `${process.env.OAUTH_ISSUER}/protocol/openid-connect/userinfo`,
|
||||
|
||||
scopes: ["openid", "profile", "email"],
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue