[SOLVED] Authenticating with Phantom/Solana wallet


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.”}


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!