security fixes
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { getSermonNote, getUserByUsername } from '~/server/utils/database'
|
||||
import { getAuthCookie } from '~/server/utils/auth'
|
||||
import { getSessionUsername } from '~/server/utils/auth'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getAuthCookie(event)
|
||||
const username = await getSessionUsername(event)
|
||||
|
||||
if (!username) {
|
||||
throw createError({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { saveSermonNote, getUserByUsername } from '~/server/utils/database'
|
||||
import { getAuthCookie } from '~/server/utils/auth'
|
||||
import { getSessionUsername } from '~/server/utils/auth'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getAuthCookie(event)
|
||||
const username = await getSessionUsername(event)
|
||||
|
||||
if (!username) {
|
||||
throw createError({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getSermonNote, getUserByUsername, getDatabase } from '~/server/utils/database'
|
||||
import { getAuthCookie } from '~/server/utils/auth'
|
||||
import { getSessionUsername } from '~/server/utils/auth'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getAuthCookie(event)
|
||||
const username = await getSessionUsername(event)
|
||||
|
||||
if (!username) {
|
||||
throw createError({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getSermonNote, getSermonBySlug, getUserByUsername, getDatabase } from '~/server/utils/database'
|
||||
import { getAuthCookie } from '~/server/utils/auth'
|
||||
import { getSessionUsername } from '~/server/utils/auth'
|
||||
import { sendSermonNotesEmail } from '~/server/utils/email'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getAuthCookie(event)
|
||||
const username = await getSessionUsername(event)
|
||||
|
||||
if (!username) {
|
||||
throw createError({
|
||||
|
||||
Reference in New Issue
Block a user