andacata / HybridIgniter

HybridAuth - CodeIgniter integration
139 stars 84 forks source link

Updates to login flow, auth status, logout endpoint, as well as a status api endpoint. #10

Closed dovy closed 11 years ago

dovy commented 11 years ago

So I made quite a few of changes to the hauth controller that I think will be well received. A breakdown is as follows:

Home view now displays all available/enabled services (automatically) and your connection status. Also displays a profile for each. Added a logout endpoint. /hauth/logout/facebook logs out facebook, while /hauth/logout/ will log you out of all services. This redirects back to the Home view. Home view now provides a "logout" per service function Auth no longer goes to the done view, but back to the Home view Added a /status endpoint and view that offers a var dump or a json view of a specified active service or services. Similar to the logout endpoint: /hauth/status/facebook show the facebook user profile, while /hauth/logout/ shows all active services and their profiles. Append a ?json to either of those URLs and get back a valid json object. I thought this was imperative since I use a lot of javascript checking and such. Cleaned up any code I could find and tried to program for all possible issues.

Changed the flow slightly. Made it so you auth and go back to the main page to see the profile. Main page now auto-displays enabled services and your connection status and profile for each. Also allows you to logout. Added a logout endpoint. You can logout one service, or all by not specifiying a service (ie /hauth/logout/facebook for facebook, /hauth/logout/ to logout all services.). I also added an api endpoint with the same functionality. /hauth/status will do a var dump, but /hauth/status?json will provide a json output. You can also specify a service alone (ie /hauth/status/facebook/?json). Whew.