Brian6960095
Posts: 0
Joined: Mon Jun 30, 2014 9:23 pm

Retrieve username or email on log in

I am trying to retrieve and save the username when the user logs in but all the response has is the _id and sessionToken. How do I receive the username as well.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Retrieve username or email on log in

Hi Brian.

Please follow these steps to get user details:

1 Open login service mapping and make following response mapping:

http://prntscr.com/3y5i8o/direct

2 Create "getUser" REST service. http://devcenter.appery.io/documentat...

See details on screenshots:

URL: https://api.appery.io/rest/1/db/users...
http://prntscr.com/3y5fkm/direct

Request Tab parameters:
userId
X-Appery-Database-Id = {database_id}
X-Appery-Session-Token

http://prntscr.com/3y5fws/direct

3 Add "getUser" datasource to the page and create following mapping:
http://prntscr.com/3y5jj4/direct

4 Open "Events" buttom panel in page "data" mode and add "login" success event handler - invoke getUser service.
http://prntscr.com/3y5lro/direct

That's all

Regards.

Brian6960095
Posts: 0
Joined: Mon Jun 30, 2014 9:23 pm

Retrieve username or email on log in

I at least feel better because I was already doing everything you had listed....unfortunately my problem still exists.

I think the problem stems from the fact that my "getUser" service won't even run when I try the test. I get the error:

Code: Select all

 "status":"401 Unauthorized", 
 "url":"[url=https://api.appery.io/rest/1/db/users/53b1a31be4b07420882b4720]https://api.appery.io/rest/1/db/users...[/url]", 
 "response":{ 
     "code":"DBUG001", 
     "description":"unauthorized" 

If I query any of the other collections it works fine, but it doesn't like it when I try to do it against the "users" table.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Retrieve username or email on log in

Hi Brian.

Now we need to see your implementation.

Thus, give us your app public link please.

Regards.

Brian6960095
Posts: 0
Joined: Mon Jun 30, 2014 9:23 pm

Retrieve username or email on log in

where do I get that from?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Retrieve username or email on log in

Brian,

See details on screen shot: http://prntscr.com/3yhtvx/direct

Regards.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Retrieve username or email on log in

What this issue resolved? I am getting similar issues like the original poster and I've tried all that I could. I think this was working sometime ago for me, but now I get the error message like stated above.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Retrieve username or email on log in

Hello,

Let's continue here https://getsatisfaction.com/apperyio/.... Please stay tuned, we will reply as soon as possible.

xman
Posts: 0
Joined: Sun Jul 06, 2014 7:05 pm

Retrieve username or email on log in

Sure, I'm biting my nails here as I'm running out of time.

Return to “Issues”