trunk.cocoapods.org
trunk.cocoapods.org copied to clipboard
Updating name doesn't work
I accidentally used the wrong name when I was setting up CocoaPods. It seems that simply registering again with a new name should let me update it (https://github.com/CocoaPods/trunk.cocoapods.org/blob/e0be3b379138d154f8d3f4f7a2e7d9dd799970f4/app/models/owner.rb#L31-L38), but doesn't seem to be working with CocoaPods 0.39.0.
Really weird, looking at https://github.com/CocoaPods/trunk.cocoapods.org/blob/master/app/controllers/api/sessions_controller.rb#L17 it should be working...
Hmm... is this specific to my account, or are you able to reproduce it for yours as well?
I haven't tried to reproduce it yet, but I did a quick audit of the code and it all seems in order
I got the same problem. Want to change my account by register again, but fail.
Might be related to https://github.com/CocoaPods/trunk.cocoapods.org/pull/150 ?
Accidentally had an typo in my name and would like to fix it. Any chance to change my name? Re-registring with the correct name doesn't change anything.
Same problem for me also here. Any chance to get an update functionality?
You're welcome to take a look at fixing it, this repo is well tested
Re-registring with the correct name doesn't change anything.
This problem is still there with CocoaPods 1.0.1, I register wrong name with Pod name, so I want changing it, but it's not working by pod trunk register EMAIL 'New Name'
, and the pod trunk register --help
print:
If this is your first registration, both an EMAIL
address and your NAME
are required. If youโve already registered with trunk, you may omit the NAME
(unless you would like to change it).
I tried several times, but all failed, then I register new trunk with my another email, it seems like only first time register will setting name.
Anybody found a workaround for this issue?
Yeah this is still not working. Is there any work around we can use for the time being?
Hello @orta,
Seeing that many people are still running into this issue, could you provide us with an update as to what is the status of this issue? I would like to fix a naming error that I made whilst setting up a session with trunk.
I read in another thread concerning this same issue that "pod trunk register will create a new account with the new email, not re-name it.". If this is indeed the case I suggest to change the misleading sentence in the description of the register
command. However I would prefer to have the functionality of changing registered name, probably along with all the other CocoaPod users that voiced themselves in this thread and many more.
As I've mentioned, we've taken a look over it and couldn't find any obvious answers. You're welcome to take a look at figuring it out and writing a PR fixing it ๐
We work on CocoaPods in our spare time, so there is no schedule for fixing it and as this is the canonical issue for the problem - so any notes from others looking at it would go here
Any news?
Nope, otherwise there would be a mention in this issue.
The issue is here: https://github.com/CocoaPods/trunk.cocoapods.org/blob/master/app/controllers/api/sessions_controller.rb#L12
When you run the pod trunk register
command, it doesn't include the Authorization header, therefore @owner
will never be present.
After looking over this, I think this code is correct. I don't want any random person being able to submit a session registration for an already existing owner and then go about changing the name. If you took this check out of here, that would allow anybody to be able to do that.
The fix for this needs to happen in the pod trunk register
command itself. I'm guessing if you already have a valid active session, pass the auth header when you make subsequent registrations, and it will enable the functionality.
To test that theory I submitted the following curl:
curl -v -H "Authorization: Token <MY CURRENT TOKEN>" -H "Content-Type: application/json" -X POST -d '{"email":"<MY EMAIL>","name":"<MY NEW NAME>","description":"<My DESCRIPTION>"}' https://trunk.cocoapods.org/api/v1/sessions
And it properly updated the name to <MY NEW NAME>
.
@paynerc greatness. Thanks a ton. Works superb.
For those looking for your Authorization Token
. Once you are in a cocoapod session, do the following:
grep -A2 'trunk.cocoapods.org' ~/.netrc
@tallytalwar This command just print:
machine trunk.cocoapods.org
login My Email
password ******
Is password
is the Token?
Thanks!
Yup password is the token
@tallytalwar Thanks! But...Are you changed your name succeed? I tried paynerc's solution, but my name still is old name, doesn't changed. ๐
Yes it did work for me. Make sure to verify your session by clicking on the link which is mailed to you first.
On Apr 27, 2017 9:44 PM, "ๆ็็ผ้ๅชๆไปฃ็ " [email protected] wrote:
@tallytalwar https://github.com/tallytalwar Thanks! But...Are you changed your name succeed? I tried paynerc's solution, but my name still is old name, doesn't changed. ๐
โ You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CocoaPods/trunk.cocoapods.org/issues/155#issuecomment-297884971, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWAwemoFNkzxWu9RHN7D1vgluQ94j9Jks5r0USJgaJpZM4GlIKQ .
Oh yeah!
Worked, first try I clicked verify link in my mail, seems failed, CocoaPods web site tell me I'm set up, but in terminal, run pod trunk me
, print:
[!] Authentication token is invalid or unverified. Either verify it with the email that was sent or register a new session.
And second try is succeed.
Thanks, also thanks paynerc.
Great work @paynerc, interesting.
A quick look through the me command makes me think that we can't reasonably offer the ability to rename in this command. If you're using it to change your current login then sending auth for your current login seems pretty illogical.
I guess we'll need a new command for rename that is basically the same code but includes default_headers
.
@orta Yeah, it seems counterintuitive to have to have a valid session first and then create a new one just to change your name.
The only way I think changing the name on session registration would work is that for a name change, the new name is stored somewhere temporarily and only overwriting the previous name on the verify action.
I've shipped a PR adding the command pod trunk me rename NAME
thanks to this research - thanks https://github.com/CocoaPods/cocoapods-trunk/pull/92
pod trunk me rename 'NAME'
[!] Unknown command: rename
There is no this command. Is another workaround to change trunk name?
@lyc2345 I changed my name using paynerc's solution. You should try it.
Worked for me too, I had to "Confirm the session" twice for this to work, first time to get an auth token and second time to update the name.
Can we please get this fixed? Looking at the code @paynerc cited, my impression is the problem is that it's trying to set the owner name at the point where you attempt the registration, not the point where you confirm the session. If so, that's the big problem. The "confirm your session" should use the name supplied during the registration but not actually save that to the database yet, and then actually confirming it should save the supplied name.
This also makes me wonder, if I pick an email address that hasn't been registered yet, attempt to register with a bogus name, but never confirm the session (because it's not my email), when the actual owner of that email goes to register for themselves, will they be stuck with the bogus name?