Closed script8888 closed 1 year ago
We will add an extra parameter (payload
) in the next version.
@script8888 Please check the 2.11.1 version. You may look at this example.
Hey @script8888! As I can see the feature from @b4rtaz should solve your problem. The only thing I wanted to ask: Why do you set such sensitive information as "Role" from the client side?
Im not using it to set the role I just need it for redirecting users
Hey @script8888! Is your problem resolved? Can we close the issue?
Yes
On Wed, 1 Feb 2023 at 14:24, Dmitry Kapeliushnyi @.***> wrote:
Hey @script8888 https://github.com/script8888! Is your problem resolved? Can we close the issue?
— Reply to this email directly, view it on GitHub https://github.com/MoralisWeb3/Moralis-JS-SDK/issues/940#issuecomment-1412054859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNJSERAWYHETCGUDGVCYJDWVJPZ7ANCNFSM6AAAAAATQR4WW4 . You are receiving this because you were mentioned.Message ID: @.***>
New Bug Report
Checklist
Issue Description
I am using Next Js and vercel In the old implementation of next-auth with Moralis as a provider, moralis v2.6.5, for auth with phantom wallet, I was able to add an extra data field called role to the session object. But with the new implementation here, https://docs.moralis.io/authentication-api/how-to-sign-in-with-solana-phantom-wallet, the same trick doesn't seem to work.
Steps + code to reproduce
Old implementation Which runs a request to
/api/auth/request-message.js
and from there the
[...next-auth].js
and this is how I pass it in the
signIn
function on the frontendActual Outcome
I encountered a TypeError: Converting circular structure to JSON from Moralis.Auth.requestMessage when using the Moralis library in production mode. My role data field was added to the session object as expected, but my env variables were accurate and the issue persisted. I sought help on the Discord and was recommended to try a new implementation.
Expected Outcome
I expected the new implementation with "@moralisweb3/next" to be able to accept extra data field in the session object
Environment
dev and production
Server
i don't know
Client
2.6.5
for the old implementation and "@moralisweb3/next": "^2.11.0" for the new implementationWindows
Chrome
Logs
For the old implementation which had a
TypeError: Converting circular structure to JSON --> starting at object with constructor "ClientRequest"
, this is the log from vercel function logs