too lazy to think of a message, so enjoy this pointless text. Good luck future me...
All checks were successful
Test action / Print hello world (push) Successful in 6m12s
All checks were successful
Test action / Print hello world (push) Successful in 6m12s
This commit is contained in:
parent
a502a50176
commit
ff31c28d38
46 changed files with 1403 additions and 1397 deletions
102
src/auth.server.ts
Normal file → Executable file
102
src/auth.server.ts
Normal file → Executable file
|
|
@ -1,51 +1,51 @@
|
|||
import { betterAuth } from "better-auth";
|
||||
import { genericOAuth } from "better-auth/plugins";
|
||||
import { Database } from "bun:sqlite";
|
||||
|
||||
export const auth = betterAuth({
|
||||
appName: "Streamarr",
|
||||
basePath: "/api/auth",
|
||||
database: new Database('auth.sqlite', { create: true }),
|
||||
logger: {
|
||||
level: "debug",
|
||||
log(level, message, ...args) {
|
||||
console.log(level, message, {args});
|
||||
},
|
||||
},
|
||||
user: {
|
||||
additionalFields: {
|
||||
name: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
},
|
||||
username: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
genericOAuth({
|
||||
config: [
|
||||
{
|
||||
providerId: "zitadel",
|
||||
clientId: "",
|
||||
clientSecret: "",
|
||||
discoveryUrl: "https://auth.amarth.cloud/.well-known/openid-configuration",
|
||||
scopes: [
|
||||
"offline_access",
|
||||
"openid",
|
||||
"email",
|
||||
"picture",
|
||||
"profile",
|
||||
"groups",
|
||||
],
|
||||
accessType: "offline",
|
||||
pkce: true,
|
||||
mapProfileToUser: ({ id, name, email, image, preferred_username, emailVerified }) =>
|
||||
({ id, name, email, emailVerified, image, username: preferred_username }),
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
import { betterAuth } from "better-auth";
|
||||
import { genericOAuth } from "better-auth/plugins";
|
||||
import { Database } from "bun:sqlite";
|
||||
|
||||
export const auth = betterAuth({
|
||||
appName: "Streamarr",
|
||||
basePath: "/api/auth",
|
||||
database: new Database('auth.sqlite', { create: true }),
|
||||
logger: {
|
||||
level: "debug",
|
||||
log(level, message, ...args) {
|
||||
console.log(level, message, {args});
|
||||
},
|
||||
},
|
||||
user: {
|
||||
additionalFields: {
|
||||
name: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
},
|
||||
username: {
|
||||
type: "string",
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
genericOAuth({
|
||||
config: [
|
||||
{
|
||||
providerId: "zitadel",
|
||||
clientId: "",
|
||||
clientSecret: "",
|
||||
discoveryUrl: "https://auth.amarth.cloud/.well-known/openid-configuration",
|
||||
scopes: [
|
||||
"offline_access",
|
||||
"openid",
|
||||
"email",
|
||||
"picture",
|
||||
"profile",
|
||||
"groups",
|
||||
],
|
||||
accessType: "offline",
|
||||
pkce: true,
|
||||
mapProfileToUser: ({ id, name, email, image, preferred_username, emailVerified }) =>
|
||||
({ id, name, email, emailVerified, image, username: preferred_username }),
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue