Skip to content
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

Cannot set Auth Source to Local via API #5654

Open
2 of 6 tasks
leesei opened this issue Mar 21, 2019 · 1 comment
Open
2 of 6 tasks

Cannot set Auth Source to Local via API #5654

leesei opened this issue Mar 21, 2019 · 1 comment
Labels
💊 bug Something isn't working 👋 good first issue Good for newcomers

Comments

@leesei
Copy link

leesei commented Mar 21, 2019

Describe the bug
Cannot set Auth Source to Local via API

To Reproduce
Steps to reproduce the behavior:

  1. Create an Authentication Source (say a SMTP auth source with id 2)
  2. Change user to the new auth source in admin panel
  3. Change auth source to local (id 0) with API
    http --print HhB PATCH http://${GOGS_HOST}/api/v1/admin/users/$GOGS_USER "Authorization: token ${GOGS_TOKEN}" source_id:=0 login_name=$GOGS_USER email=$GOGS_USER@mail.com password=$GOGS_USER
  4. Server response 200 but auth source not changed (per admin panel and login error message)

Expected behavior
The auth source should be set to Local after the 200 response

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

  • Gogs version (or commit ref): 0.11.86.0130
  • Git version:
  • Operating system: Linux
  • Database (replace [ ] with [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes: provide example URL
    • No: explain why
      no external auth source
  • Log gist (usually found in log/gogs.log):
@unknwon unknwon added the 💊 bug Something isn't working label Mar 21, 2019
@unknwon unknwon added this to the 0.12 milestone Mar 21, 2019
@unknwon unknwon added the 👋 good first issue Good for newcomers label Mar 21, 2019
@unknwon
Copy link
Member

unknwon commented Mar 21, 2019

I think the cause is the zero-value feature of Go. 0 itself is not recognized as a change of state.

@unknwon unknwon removed this from the Triaging priority milestone Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💊 bug Something isn't working 👋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants