The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
beforeSSR: ({ state, libraries }) => async ({ ctx }) => {
console.log("SSR all day long", ctx.status);
},
//Register user
// Post request to create a post
axios
.post(`${wordPressSiteUrl}/?rest_route=/secure-Oauth/v2/users&${JWT_Key}&${AUTH_KEY_VALUE}`, formData)
.then((res) => {
//xyz
})
.catch((err) => {
{
//zyx
}
});
};
so how would I go about this? when click register button, it’ll take formdata and submit to ssr ctx how?
mburridge2
Hi @furrysmile2
Exposing API credentials in client side code can be a problem. We’re working to see what a good solution might be, though it might vary for different use cases.
You will probably need to use a proxy to pass the credentials. A quick google search turned up this video:
I haven’t watched it myself yet, but it may point you in the right direction. Let me know if it does.
mburridge3
Alternatively try googling for something like “hide api credentials with a proxy” and see if a solution for your use case comes up.