Skip to content

Commit

Permalink
chore: fix azure tests (#2239)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Sep 19, 2023
1 parent c2d9320 commit 2228f90
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 1,371 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
{
$source = $link.Target;
$destination = $link.FullName;
Remove-Item $destination -Force
Copy-Item -Path $source -Destination $destination -Force -Recurse
}
Expand Down
6 changes: 5 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ export default defineNuxtConfig({
// Workaround for https://github.com/nuxt/nuxt/issues/22933
hooks: {
close: (nuxt) => {
if (!nuxt.options._prepare) {
if (
!nuxt.options._prepare &&
!process.env.TEST &&
!process.env.VITE_TEST
) {
process.exit()
}
},
Expand Down
13 changes: 1 addition & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,12 @@
"resolutions": {
"@types/react": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.2.0.tgz",
"express-session": "patch:express-session@npm%3A1.17.3#./.yarn/patches/express-session-npm-1.17.3-0819dbe06c.patch",
"tslib": "^2.4.0",
"mount-vue-component": "patch:mount-vue-component@npm%3A0.10.2#./.yarn/patches/mount-vue-component-npm-0.10.2-4968f76fd9.patch",
"uuid@^8.3.0": "^9.0.0",
"uuid@^8.3.2": "^9.0.0",
"node-fetch-native": "^1.2.0",
"destr": "^2.0.0",
"@graphql-tools/schema": "^10.0.0",
"vue-demi": "^0.14.5",
"@wry/trie": "^0.4.3",
"unified": "^11.0.3",
"@vue/apollo-util": "patch:@vue/apollo-util@npm%3A4.0.0-beta.6#./.yarn/patches/@vue-apollo-util-npm-4.0.0-beta.6-7e26e14eb7.patch",
"redis-mock@^0.56.3": "patch:redis-mock@npm%3A0.56.3#./.yarn/patches/redis-mock-npm-0.56.3-967bd7c6ea.patch"
},
"resolutionsComments": {
"@types/react": "Otherwise these types interfere with the types from vite: https://github.com/johnsoncodehk/volar/discussions/592#discussioncomment-1580518",
"tslib": "some libraries still pull-in v1 of tslib, which is incompatible with the other libraries that use tslib v2 features",
"uuid/node-fetch-native/destr/schema/vue-demi/trie/unified": "nitro still has problems when multiple versions of packages are used"
"@types/react": "Otherwise these types interfere with the types from vite: https://github.com/johnsoncodehk/volar/discussions/592#discussioncomment-1580518"
},
"prisma": {
"schema": "server/database/schema.prisma",
Expand Down
29 changes: 17 additions & 12 deletions server/context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { H3ContextFunctionArgument } from '@as-integrations/h3'
import { User } from '@prisma/client'
import expressSession from 'express-session/index.js'
import {
AuthenticateReturn,
buildContext as passportBuildContext,
Expand Down Expand Up @@ -46,17 +45,23 @@ export function buildContext({
return
}
// For some strange reason the session cookie is not set correctly on azure, so do this manually
// @ts-expect-error: internal
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
expressSession.setcookie(
event.res,
'session',
// @ts-expect-error: there are no correct types for this
event.req.sessionID,
useRuntimeConfig().session.primarySecret,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
session.cookie.data,
)
// const signed =
// 's:' +
// signature.sign(
// event.req.sessionID,
// useRuntimeConfig().session.primarySecret,
// )
// const data = cookie.serialize('session', signed, session.cookie.data)
// setCookie(event, 'session', data)
// expressSession.setcookie(
// event.res,
// 'session',
// // @ts-expect-error: there are no correct types for this
// event.req.sessionID,
// useRuntimeConfig().session.primarySecret,
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// session.cookie.data,
// )
resolve()
})
})
Expand Down
Loading

0 comments on commit 2228f90

Please sign in to comment.