Access request properties from within a server action. #57949
ken-spencer
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Here's some code from my audit system that mostly gets around the lack of NextRequest in Server Actions:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
"use server"; import { serverUrl } from "@/lib/env-export"; export const loginAction = async (formData: loginSchemaType) => {
} catch (error) { |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
It would be extremely handy if there was a way to access request properties from within a server action. In my case for audit logging.
Non-Goals
Background
I am currently having to append the data I need to custom headers in middleware, but feels like a hack.
Proposal
import request from "next/request"
...
let {geo, ip, nextUrl} = request();
Beta Was this translation helpful? Give feedback.
All reactions