Enhance data retrived through API call on /users/{username} #3463

Open
opened 2025-11-02 05:13:34 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @William-LP on GitHub (Jun 13, 2019).

  • Gitea version 1.8.2
  • Git version: 2.16.1
  • Operating system: Windows Server 2012 R2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • [ x ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [ x ] Not relevant

Description

Today I had to delete all the users than never connected to the plateforme (and they were quite a lot).
I realized the API call on /users/{username} didn't provide the last-user-connection info.

What about giving the API the ability to provide the user's creation and last-connection date?

http://giteaSrv/api/v1/users/mylogin

{
  "id": 1,
  "login": "mylogin",
  "full_name": "My Full Name",
  "email": "My@E.mail",
  "avatar_url": "https://secure.gravatar.com/avatar/myavatar?d=identicon",
  "language": "en-US",
  "is_admin": false,
  "username": "myusername",
  "creation_date": "YYYY-mm-dd HH:MM:SS",
  "last_connection_date": "YYYY-mm-dd HH:MM:SS"
}
Originally created by @William-LP on GitHub (Jun 13, 2019). - Gitea version 1.8.2 - Git version: 2.16.1 - Operating system: Windows Server 2012 R2 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ x ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ x ] Not relevant ## Description Today I had to delete all the users than never connected to the plateforme (and they were quite a lot). I realized the API call on /users/{username} didn't provide the last-user-connection info. What about giving the API the ability to provide the user's creation and last-connection date? `http://giteaSrv/api/v1/users/mylogin ` ``` { "id": 1, "login": "mylogin", "full_name": "My Full Name", "email": "My@E.mail", "avatar_url": "https://secure.gravatar.com/avatar/myavatar?d=identicon", "language": "en-US", "is_admin": false, "username": "myusername", "creation_date": "YYYY-mm-dd HH:MM:SS", "last_connection_date": "YYYY-mm-dd HH:MM:SS" } ```
GiteaMirror added the type/enhancementmodifies/api labels 2025-11-02 05:13:34 -06:00
Author
Owner

@jolheiser commented on GitHub (Jun 13, 2019):

#7196 accomplishes last login

@jolheiser commented on GitHub (Jun 13, 2019): #7196 accomplishes last login
Author
Owner

@zeripath commented on GitHub (Jun 14, 2019):

it also now includes created.

@zeripath commented on GitHub (Jun 14, 2019): it also now includes created.
Author
Owner

@William-LP commented on GitHub (Jun 19, 2019):

What about adding the source_id (authentication source) as well ?

@William-LP commented on GitHub (Jun 19, 2019): What about adding the `source_id` (authentication source) as well ?
Author
Owner

@gary-kim commented on GitHub (Jul 9, 2019):

What about adding the source_id (authentication source) as well ?

I'm working on another pull request at the moment but once that's done, I'll try this.

@gary-kim commented on GitHub (Jul 9, 2019): > What about adding the `source_id` (authentication source) as well ? I'm working on another pull request at the moment but once that's done, I'll try this.
Author
Owner

@stale[bot] commented on GitHub (Sep 7, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Sep 7, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@6543 commented on GitHub (Jun 23, 2021):

ref: https://try.gitea.io/api/swagger#/user/userGetCurrent

hat specific is missing?

@6543 commented on GitHub (Jun 23, 2021): ref: https://try.gitea.io/api/swagger#/user/userGetCurrent hat specific is missing?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3463