Signing a Message w Metamask

I am attempting to sign an arbitrary message. (After user has already logged in)

I can easily do this by reusing the authenticate function.

user = await Moralis.authenticate({ signingMessage: message })

However if the message is rejected by metamask, the user gets logged out.

Is there another way to sign messages that doesn’t use Moralis.authenticate?

I am sure I am missing something. Thank you.

you can find how to do it in the source code for authenticate, the source code is in GitHub

I am not sure exactly where to look. If anyone has more information I would certainly appreciate it.

I don’t have the experience to rewrite these functions.

Perhaps I will find another way. :grinning:

you don’t have to rewrite something, only to find how the signature part is done