Skip to content

Commit

Permalink
fix: correct cjs imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Sep 12, 2022
1 parent b9a54c3 commit 44f5291
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions nuxt/components/event/list/EventListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<script lang="ts">
import { htmlToText } from 'html-to-text'
import DOMPurify from 'isomorphic-dompurify'
import { render } from 'mustache'
import mustache from 'mustache'
import { computed, defineComponent, PropType } from 'vue'
import { Event } from '~/types/event'
Expand All @@ -75,7 +75,8 @@ export default defineComponent({
return htmlToText(
DOMPurify.sanitize(
render(props.event.description, {
// eslint-disable-next-line import/no-named-as-default-member
mustache.render(props.event.description, {
event: props.event,
})
),
Expand Down
5 changes: 3 additions & 2 deletions nuxt/server/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs'

import { serialize } from 'cookie'
import { CompatibilityEvent } from 'h3'
import { verify } from 'jsonwebtoken'
import jsonwebtoken from 'jsonwebtoken'

import { JWT_NAME } from '~/plugins/util/constants'

Expand Down Expand Up @@ -30,7 +30,8 @@ export default function (event: CompatibilityEvent) {
jwt = req.headers.authorization.substring(7)

try {
verify(jwt, configPostgraphileJwtPublicKey, {
// eslint-disable-next-line import/no-named-as-default-member
jsonwebtoken.verify(jwt, configPostgraphileJwtPublicKey, {
algorithms: ['RS256'],
audience: 'postgraphile',
issuer: 'postgraphile',
Expand Down
5 changes: 3 additions & 2 deletions nuxt/server/api/ical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { htmlToText } from 'html-to-text'
import DOMPurify from 'isomorphic-dompurify'
import ical, * as icalGenerator from 'ical-generator'
import moment from 'moment'
import { render } from 'mustache'
import mustache from 'mustache'

import { Contact } from '~/types/contact'
import { Event as MaevsiEvent } from '~/types/event'
Expand Down Expand Up @@ -36,7 +36,8 @@ export function getIcalString(
(process.env.NUXT_ENV_STACK_DOMAIN || 'maevsi.test') +
'/event/' +
userEventPath
const eventDescriptionHtml = render(
// eslint-disable-next-line import/no-named-as-default-member
const eventDescriptionHtml = mustache.render(
event.description ? `${eventUrl}\n${event.description}` : '',
{
contact,
Expand Down
10 changes: 6 additions & 4 deletions nuxt/server/api/tusd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
sendError,
} from 'h3'
import consola from 'consola'
import { verify } from 'jsonwebtoken'
import { Pool } from 'pg'
import jsonwebtoken from 'jsonwebtoken'
import pg from 'pg'
import fetch from 'node-fetch'

const configPostgraphileJwtPublicKeyPath =
Expand All @@ -25,7 +25,8 @@ const configPostgraphileJwtPublicKey = fs.existsSync(
? fs.readFileSync(configPostgraphileJwtPublicKeyPath, 'utf-8')
: undefined

const pool = new Pool({
// eslint-disable-next-line import/no-named-as-default-member
const pool = new pg.Pool({
database: fs.existsSync(secretPostgresDbPath)
? fs.readFileSync(secretPostgresDbPath, 'utf-8')
: undefined,
Expand Down Expand Up @@ -112,7 +113,8 @@ async function tusdDelete(event: CompatibilityEvent) {
}

try {
verify(
// eslint-disable-next-line import/no-named-as-default-member
jsonwebtoken.verify(
req.headers.authorization.substring(7),
configPostgraphileJwtPublicKey,
{
Expand Down

0 comments on commit 44f5291

Please sign in to comment.