Build with IDX Broker › Forums › API › API PHP › Automatically logging in the user after they sign up
Tagged: api
-
AuthorPosts
-
-
There is no way via the API to log someone in. That would have to happen in the browser.
(0 rating, 0 votes, rated)
You need to be a registered member to rate this post.Loading...
-
@AnthonyOrtega, Thx for the response, I’m getting an error still but I think it is possible by sending a POST request to the IDX Login URL. I inspected the User Login Form and it shows the IDX Login URL:
//www.dsmhousesearch.idxbroker.com/idx/ajax/userlogin.php
What I did was copy and paste the entire form and put it in my Global Header Wrapper HTML, hiding it on the page using CSS. I then used jQuery to replace the email field with the correct email of the user. Then in my custom.js file from my server which is also being pulled from the Global Header Wrapper HTML, I put this code:
jQuery.post("/idx/ajax/userlogin.php", jQuery("#IDX-loginForm").serialize(), function(data)
{
// success after the user is logged in above
console.log(data);
});
However after inspecting the console from the browser, I got this error:
{"error":"n","leadID":"25931","redirectLink":"\/idx\/results\/listings?city%5B0%5D=943&pt=sfr&sfrType%5B0%5D=Residential&srt=DESC&stp=advanced&start=1&per=10"}
(0 rating, 0 votes, rated)
You need to be a registered member to rate this post.Loading...
-
-
From my above code, I was able to log the user in. But after making the POST request to the IDX Login URL, I had to refresh the page for them to be logged in.
(0 rating, 0 votes, rated)
You need to be a registered member to rate this post.Loading...
-
-
AuthorPosts
- You must be logged in to reply to this topic.