Sign In Register

How can we help you today?

Start a new topic
Answered

What is your workflow for password reset email for web?

I have to let my privacy freaks play my game, so I want legacy login as well. What's best (easiest) practice to allow password reset via the web? 


I hate to compare PlayFab, but they have a player.SendPasswordResetEmail api call, which... just makes sense. Otherwise it's a really huge system to make a secure, password reset email.


Best Answer

What you are looking for is something like this..

 if(Spark.getData().scriptData)
{
        Spark.getPlayer().setScriptData("email", Spark.getData().scriptData["email"]);
}


Hi Dylan,


We don't store user email addresses by default so we don't have a call for that but we do have a method for doing this (by first setting a users email to script data on registration), the basics of this are set up in a test project. I can add you to this if you like to see how it works. Just let me know and I'll send you the details.


Thanks,

Liam

 

{
    "@class": ".AuthenticationRequest",
    "password": "ffff",
    "userName": "ffff",
    "scriptData": {
        "action": "passwordRecoveryRequest",
        "email": "vvvvvvv@gmail.com"
    },
    "requestId": "1479401743_2"
}

 using that in test harness , i am getting null inside   of  Spark.data.scriptData .
As a result it is skipping whole if(Spark.data.scriptData) {} block.

can u provide some test harness example?

in test harness i am trying this:

 

{
    "@class":   ".AuthenticationRequest",
    "password": "ffff",
    "userName": "ffff",
    "scriptData":   {
        "action":   "passwordRecoveryRequest",
        "email":    "muzaheed57@gmail.com"
    },
    "requestId":    "1479401743_2"
}

 but it is not entering inside of this   if(Spark.data.scriptData){}

somehow it always considering "(Spark.data.scriptData)"  as invalid !!!!!!!!

can u provide some example code for testing in test harness

Firstly, let me thank Dylan for that question. I am coming from PlayerIO and they too have a simple password reset system. I do not believe that we two are going to be the only devs with this question so perhaps in future, it might be added as a tutorial, or better yet incorporated within the authentication system?

Can you also add me to the test project?

Thank you,
Richard.

 

Answer

What you are looking for is something like this..

 if(Spark.getData().scriptData)
{
        Spark.getPlayer().setScriptData("email", Spark.getData().scriptData["email"]);
}

Hi Richard,


A guide for how to handle this can be found in our documentation located here. If you have any further questions please don't hesitate to let us know.


Thanks,

Liam

Login to post a comment