Skip to content

New client method: GetSelfInfo() #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2020
Merged

Conversation

achilleas-k
Copy link
Contributor

Uses the GOGS API endpoint "/user" to retrieve the information for the current authenticated user.

This is very useful in a lot of cases where a gogs.Client is initialised with a token and the username isn't readily available. For instance, loading a token from a database for a service that interacts with GOGS. Since the API endpoint exists, it would be nice for that convenience to be available in the client as well.

Retrieves the information for the current authenticated user.
API endpoint "/user".
@unknwon
Copy link
Member

unknwon commented Aug 21, 2020

Thank you!

@unknwon unknwon merged commit 4ab716b into gogs:master Aug 21, 2020
@achilleas-k achilleas-k deleted the self-user-info branch August 21, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants