SHIV5T3R / CO-DE

An Open Source Collaborative Code Editor
36 stars 26 forks source link

Feature: Fetch User API #37

Closed ZakariaTalhami closed 4 months ago

ZakariaTalhami commented 11 months ago

Issue #10

Changes:

Fetch User API

URL

GET <base_url>/users/

Headers

Authorization = Bearer <access_token>

Response

{
    "status": true,
    "data": {
        "username": "...",
        "full_name": "...",
        "email": "...",
        "id": "..."
    }
}
hobi9 commented 10 months ago

will this api be refactored to accept cookies instead of the authorization header?

ZakariaTalhami commented 10 months ago

will this api be refactored to accept cookies instead of the authorization header?

Yeah, It should be modified to expect cookies instead of authentication header.

hobi9 commented 10 months ago

Hi, why does the /users/login api also return the avatar while this one doesn't? Will it be added here too?

zatoa commented 8 months ago

I think the POST to /users/ vs /users/register really depends if you're looking at it from service oriented or entity based. Are you exposing a direct CRUD from the DB as endpoints or are you creating an abstract service? Something that I always spend ages thinking about on my own projects.