Skip to content

auth: enable authentication by token from password#7198

Merged
unknwon merged 3 commits intogogs:mainfrom
ly4096x:main
Oct 22, 2022
Merged

auth: enable authentication by token from password#7198
unknwon merged 3 commits intogogs:mainfrom
ly4096x:main

Conversation

@ly4096x
Copy link
Contributor

@ly4096x ly4096x commented Oct 22, 2022

Describe the pull request

As #6421 is not getting update, I created this PR to close #3866 . This PR tries to authenticate using password as token at first, together with verifying username, and if that fails, it will try to fallback to try authenticate using username as token.

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code. Having trouble locating test cases, please help point out where to add tests.

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I pushed a revised version to make this PR actually work :)

@codecov
Copy link

codecov bot commented Oct 22, 2022

Codecov Report

Merging #7198 (2d502f8) into main (7cbd84d) will increase coverage by 0.05%.
The diff coverage is 23.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7198      +/-   ##
==========================================
+ Coverage   11.86%   11.92%   +0.05%     
==========================================
  Files         107      107              
  Lines       13626    13635       +9     
==========================================
+ Hits         1617     1626       +9     
+ Misses      11805    11799       -6     
- Partials      204      210       +6     

@unknwon unknwon merged commit b9f5cfd into gogs:main Oct 22, 2022
dna2github pushed a commit to dna2fork/gogs that referenced this pull request May 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use personal access tokens as password

2 participants