tea login add creates token without scopes #542

Closed
opened 2023-04-15 23:28:16 +00:00 by wandersonwhcr · 4 comments

After executing tea login add with username and password, the token created does not have any scopes and all commands are useless.

Currently, I am creating a token with scopes manually via user settings.

After executing `tea login add` with username and password, the token created does not have any scopes and all commands are useless. Currently, I am creating a token with scopes manually via user settings.
lunny added the
kind/bug
label 2023-04-16 01:57:36 +00:00
Author

I used curl as a workaround to create token and use it with tea login add.

curl "http://gitea.your.host/api/v1/users/${GITEA_SERVER_USER}/tokens" \
    --silent \
    --request POST \
    --header 'Content-Type: application/json' \
    --user "${GITEA_SERVER_USER}:${GITEA_SERVER_PASSWORD}" \
    --data '{ "name": "tea", "scopes": [ "all" ] }'
I used `curl` as a workaround to create token and use it with `tea login add`. ``` curl "http://gitea.your.host/api/v1/users/${GITEA_SERVER_USER}/tokens" \ --silent \ --request POST \ --header 'Content-Type: application/json' \ --user "${GITEA_SERVER_USER}:${GITEA_SERVER_PASSWORD}" \ --data '{ "name": "tea", "scopes": [ "all" ] }' ```
Owner

Once gitea/go-sdk#616 or gitea/go-sdk#617 are merged I will send a PR here to resolve this.

Thanks for reporting!

Once gitea/go-sdk#616 or gitea/go-sdk#617 are merged I will send a PR here to resolve this. Thanks for reporting!

Curious where this stands. I'm running into this issue with a CI pipeline I'm developing, and it would be helpful for #546 to be merged. It looks like gitea/go-sdk#617 is merged.

Curious where this stands. I'm running into this issue with a CI pipeline I'm developing, and it would be helpful for #546 to be merged. It looks like gitea/go-sdk#617 is merged.

It looks like #616 did not get merged and it's still an issue for me. It created a token and then complained that it didn't have enough scopes defined and errored out. I had to create the token manually and pass it to tea login.

It looks like #616 did not get merged and it's still an issue for me. It created a token and then complained that it didn't have enough scopes defined and errored out. I had to create the token manually and pass it to `tea login`.
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#542
No description provided.