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

Rollover security #54

Merged
merged 3 commits into from
Dec 20, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { logger } from 'src/lib/logger'
import {db} from 'src/lib/db';
import {authDecoder} from "@redwoodjs/auth-dbauth-api";
/**
* The handler function is your code that processes http request events.
* You can use return and throw to send a response or error, respectively.
Expand All @@ -18,11 +19,15 @@ import {db} from 'src/lib/db';
*/


export const handler = async (event, _context) => {
export const handler = async (event, context) => {
logger.info(`${event.httpMethod} ${event.path}: rolloverPreviousTasks function`)

// Get the current user
const { userId, date } = event.queryStringParameters

// Verify user is logged in and the same as requested
await authDecoder(userId, 'dbAuth', {event, context})

const dd= new Date(date)

const most_recent_tasks = await db.task.findFirst({
Expand Down