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

Deleting the Authorization #8

Open
finnp opened this issue Jun 16, 2014 · 7 comments
Open

Deleting the Authorization #8

finnp opened this issue Jun 16, 2014 · 7 comments

Comments

@finnp
Copy link
Contributor

finnp commented Jun 16, 2014

Hi,

I have similar problems to #6. Everytime I redo the authorization, I get an error if I already have authorized the application (but haven't saved the credentials ;)).

The problem is that I would have to delete the authorization (https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization), since I actually don't need it after its use.

Therefore I think it would be nice if ghauth would have a delete method, which first deleted the authorization key (with the authorization key itself ..) and then deletes the .config/<>.json.

This might also be useful for applications that want to implement a logout command.

The revoke methods seemingly can not be used, since they need a client_id, which we don't have. This kind of seems like we either have to keep track of the ID of the authorization, which would suck. A possibility to "self-destruct" them would be nice.

I will look into this - but it kind of looks like that there is no nice way other then let the user delete the tokens for themself..

Best,
Finn

PS: This is the workflow that I am actually trying to achieve. Maybe I should just write my custom solution for it. Not sure whether that's within the scope of this module.

@mattdesl
Copy link

👍 I had to hunt down the cache a couple times to remove and invalidate it.

Even just providing the file path would be useful, I can build a "logout" or clear cache feature around that.

@rvagg
Copy link
Owner

rvagg commented May 27, 2015

happy to add this, it would indeed be helpful, the application config location has got more complex now that we're using application-config but I think it's for the better; pull request would be welcome if you can include some tests too

@mattdesl
Copy link

It looks like this is going to be easier now that application-config-path has been pushed by @LinusU

@rvagg
Copy link
Owner

rvagg commented Jul 31, 2015

tbh I'm finding it more difficult now, particularly as someone who moves across OSs regularly for dev, I feel like I need a "show me where the config file is" option somewhere

@LinusU
Copy link
Contributor

LinusU commented Jul 31, 2015

@mattdesl application-config includes a trash method in addition to write and read so it should be very straight forward to add removing of the config :)

@rvagg Would it be useful if the application-config instance exported a filePath property with the path to the file?

@rvagg
Copy link
Owner

rvagg commented Aug 1, 2015

@LinusU it would be nice, we could even consider passing it back on the authData object so downstream users can see where it comes from on the fs

@LinusU
Copy link
Contributor

LinusU commented Aug 1, 2015

@rvagg Fixed and published as version 0.2.0, the property is named filePath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants