mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Compare commits
2 commits
ae22351367
...
aef06c6737
| Author | SHA1 | Date | |
|---|---|---|---|
| aef06c6737 | |||
| 8ea95487dd |
2 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import forgorTemplate from './utils/forgorTemplate'
|
|||
import verifyTemplate from './utils/verifyTemplate'
|
||||
|
||||
export const auth = betterAuth({
|
||||
trustedOrigins: ['https://sittingonclouds.net', 'https://www.sittingonclouds.net'],
|
||||
database: prismaAdapter(prismaClient, { provider: 'mysql' }),
|
||||
user: { modelName: 'users' },
|
||||
plugins: [username(), bearer()],
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import PAGES from 'utils/pages.json'
|
|||
import prismaClient from 'utils/prisma-client'
|
||||
|
||||
export const onRequest = defineMiddleware(async (context, next) => {
|
||||
const { request } = context
|
||||
//paraglideMiddleware(request, async ({ locale, request }) => {
|
||||
const isAuthed = await auth.api.getSession({
|
||||
headers: context.request.headers
|
||||
headers: request.headers
|
||||
})
|
||||
|
||||
if (isAuthed) {
|
||||
|
|
@ -31,5 +33,6 @@ export const onRequest = defineMiddleware(async (context, next) => {
|
|||
context.locals.pages = []
|
||||
}
|
||||
|
||||
return paraglideMiddleware(context.request, () => next())
|
||||
return next()
|
||||
//})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue