Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to lucia v3 #2335

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .github/scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def main(environment_name: str, verbose: bool = False):
REDIS_NAME = "jabref"
DATABASE_URL = os.environ.get("DATABASE_URL", "<Not specified>")
SESSION_SECRET = os.environ.get("AZURE_SESSION_SECRET", "<Not specified>")
SESSION_SEAL = os.environ.get("AZURE_SESSION_SEAL", "<Not specified>")
GITHUB_REPO_TOKEN = os.environ.get("GITHUB_REPO_TOKEN", "<Not specified>")

function_app_name = "jabref-function-" + environment_name
Expand Down Expand Up @@ -133,6 +134,7 @@ def main(environment_name: str, verbose: bool = False):
"value": redis_keys.primary_key,
},
{"name": "SESSION_SECRET_PRIMARY", "value": SESSION_SECRET},
{"name": "SESSION_SEAL", "value": SESSION_SEAL},
{"name": "GITHUB_REPO_TOKEN", "value": GITHUB_REPO_TOKEN},
# Disable indexing of non-production sites
# https://nuxtseo.com/robots/guides/disable-indexing#preview-staging-testing-environments
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"scimago",
"transpiled",
"tsyringe",
"Unstorage",
"upsert"
],
"[jsonc]": {
Expand Down
9 changes: 8 additions & 1 deletion apollo/validation.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { z } from 'zod'
import type { LoginInput, SignupInput } from './graphql'
import type { ChangePasswordInput, LoginInput, SignupInput } from './graphql'
import {
ChangePasswordInputSchema as InternalChangePasswordInputSchema,
LoginInputSchema as InternalLoginInputSchema,
SignupInputSchema as InternalSignupInputSchema,
} from './validation.internal'

type Properties<T> = Required<{
[K in keyof T]: z.ZodType<T[K], any, T[K]>

Check warning on line 10 in apollo/validation.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
}>

const passwordSchema = z
Expand All @@ -24,3 +25,9 @@
email: z.string().email(),
password: passwordSchema,
})

export const ChangePasswordInputSchema: z.ZodObject<
Properties<ChangePasswordInput>
> = InternalChangePasswordInputSchema.extend({
newPassword: passwordSchema,
})
4 changes: 4 additions & 0 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface Config {
session: {
primarySecret: string
secondarySecret: string
seal: string
}
githubRepoToken: string
public: {
Expand All @@ -87,6 +88,9 @@ export function constructConfig() {
session: {
primarySecret: process.env.SESSION_SECRET_PRIMARY ?? 'session_secret',
secondarySecret: process.env.SESSION_SECRET_SECONDARY ?? 'session_secret',
// seal has to be min 32 characters
seal:
process.env.SESSION_SEAL ?? 'session_seal_session_seal_session_seal',
},
githubRepoToken: process.env.GITHUB_REPO_TOKEN ?? 'UNDEFINED',
public: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@azure/communication-email": "1.0.0",
"@graphql-tools/schema": "10.0.4",
"@he-tree/vue": "2.8.2",
"@lucia-auth/adapter-prisma": "^3.0.2",
"@lucia-auth/adapter-prisma": "^4.0.0",
"@lucia-auth/adapter-session-unstorage": "^2.1.0",
"@nuxtjs/tailwindcss": "6.12.1",
"@pinia/nuxt": "0.5.2",
Expand All @@ -69,7 +69,7 @@
"ioredis": "5.4.1",
"json-bigint-patch": "0.0.8",
"lodash": "4.17.21",
"lucia": "^2.7.4",
"lucia": "^3.0.1",
"pinia": "2.2.0",
"reflect-metadata": "0.2.2",
"ts-loader": "9.5.1",
Expand Down
Loading
Loading