azranel / TAS

Projekt na technologie aplikacji serwerowych
2 stars 0 forks source link

User REST API #9

Closed dajvido closed 9 years ago

dajvido commented 9 years ago

Could login return also all user data or give with answer user id? Cus I can't fetch user data without user id ;)

(I didn't check it out yet. Just read your wiki.)

azranel commented 9 years ago

If user is logged in you should have his ID. If you have his ID you can fetch hid data from business layer.

dajvido commented 9 years ago

From your file i understand that I'll have only code 200 as return, so how I can have user id from db without connection to it from web layer? User will be logged in only because in session it will be said so. Without id from your longin request I can't find out what id user have. My question was do your longin request return user id. If not I will not be able to get it without self connection to db.

azranel commented 9 years ago

If user is logged in you must have his id in your session. If you dont have it, use is not logged in.

API POST /users/login returns { status: 200, id: u.id } If user have success during logon. u.id is User ID from database. If you will need any more info (firstname,lastname etc), you will need to fetch more data through API.

dajvido commented 9 years ago

And that what I was asking for... You know that we haven't connection in web layer to db so all what we can store in session is data return from buss layer?

azranel commented 9 years ago

What do you need more? And actually It should be like. If you need any data from the database you have to contact through business layer.

dajvido commented 9 years ago

Read my first post once again. Returning user id is enought. I ask you about that because in readme you had wrote its return only response code and nothing more.