[SOLVED] Authenticating with Phantom/Solana wallet

Hi,

Iā€™m trying to connect my dappā€™s user to the Phantom/Solana wallet using Moralis authenticeā€™s type: sol property/value. Iā€™m getting a 500 error back from the xhr request: {ā€œcodeā€:1,ā€œmessageā€:ā€œInternal server error.ā€} ā€¦ The Moralis SDK scripts tries to contact https://kbvgdqapw6fm.usemoralis.com:2053/server/users but it returns a 500 error code. Loggin a user in with MetaMask works fine. Anyone any idea why the Solana/Phantom login doesnā€™t work?

My JS code:

let user = Moralis.User.current();
if (!user) {
    Moralis.authenticate({type:'sol'}).then(function(user) {
        console.log("Logged in Solana/Phantum Wallet user with address: " + user.get('solAddress'));
    });
}

Response from Request URL: https://kbvgdqapw6fm.usemoralis.com:2053/server/users:
{ā€œcodeā€:1,ā€œmessageā€:ā€œInternal server error.ā€}

Thanks!

1 Like

What version of the server do you use? Are you running the latest version?

Thanks for your reply Erno!

This is how I initialize the Moralis SDK and server:

//Initialize Moralis:
const serverUrl = ā€œhttps://kbvgdqapw6fm.usemoralis.com:2053/serverā€;
const appId = ā€œtO8LmcrbWFf4ymDxpksgQnNNI164RbC0t3zljcSvā€;
Moralis.start({ serverUrl, appId });

In the Moralis dashboard, my Test server reads ā€œ0.0.302ā€ā€¦

Thanks again!

That seems like an old server version.

Yeah that seems to be the issue.
This feature needs server v0.0.308 of above, so updating server should solve it

Hey guys! Yes, that was it; updating the server solved the issue :slight_smile: Thanks so much for the quick help!

Best,
Roel