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

[bugfix] Fix POST to create account endpoint #3767

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

tsmethurst
Copy link
Contributor

@tsmethurst tsmethurst commented Feb 9, 2025

Description

If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.

If this is a documentation change, please briefly describe what you've changed and why.

Lil fix + new test for creating an account by POSTing to the accounts endpoint.

Following command on the testrig:

curl -H 'content-type: application/json' -H 'authorization: Bearer ZTK1MWMWZDGTMGMXOS0ZY2UXLWI5ZWETMWEZYZZIYTLHMZI4' -d '{"username":"xk063c2xa3insqw3n4nj_sb_persona","email":"[email protected]","password":"20 char long mix of upper lower special and digits","reason":"a long enough explanation of why I am doing api calls","agreement":true,"locale":"en-US"}' localhost:8080/api/v1/accounts

Now returns expected response with default scope (it's a bit dorky that it's an empty string but it's got nothing to do with this PR at least):

{
  "access_token": "NDU5MZNLM2ITYJHLYY0ZYTIXLTG5NTCTNTEYOTJKYZK1ZGFM",
  "token_type": "Bearer",
  "scope": "",
  "created_at": 1739103202
}

closes #3733
closes #3612

Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: [ ] -> [x]

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@tsmethurst tsmethurst merged commit ce7ba8f into main Feb 9, 2025
4 checks passed
@tsmethurst tsmethurst deleted the fix_create_account_post branch February 9, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant