Thoughts on how to integrate t3 app, connectkit web3 auth, nextjs middleware, and trpc
I am prototyping an application using t3 app with trpc, connectkit web3 auth.
I am wanting to use nextjs middleware to protect routes server side.
As part of the connectkit auth flow, I have my application wrapped in a ClientProvider:
Inside ClientProvider I have the web3 providers:
and here is const siwiConfig. It calls the /siwe route on initial load and sets a cookie using iron-session with the nonce inside, then updates that same cookie after authentiucation with wallet address and chain:
I am wanting to use nextjs middleware to protect routes server side.
As part of the connectkit auth flow, I have my application wrapped in a ClientProvider:
Inside ClientProvider I have the web3 providers:
and here is const siwiConfig. It calls the /siwe route on initial load and sets a cookie using iron-session with the nonce inside, then updates that same cookie after authentiucation with wallet address and chain: