casbin / casbin-hub

The hub for Casbin
https://dashboard.casbin.com
Apache License 2.0
87 stars 46 forks source link

Add github login function #129

Closed Xiaoyang-Gu closed 3 years ago

Xiaoyang-Gu commented 3 years ago

Fixes : [#128 ]

Description :

  1. Add github login function. Store the user‘s username, avator, email into the database for future management.
  2. Delete the login page.
  3. Change the antd frame and route method.
  4. Add syntax checks and validations of models. Refer to #68

Screenshot of changes :

Screenshot check

Please ensure Checkmark the following :

Xiaoyang-Gu commented 3 years ago

@hsluoyz @BetaCat0 @nodece Sorry for a such big pr. Please review!

BetaCat0 commented 3 years ago

I found the demo site will always notice me to login even I have done. I'm not sure if it was a bug or not. Could you help confirm?

nodece commented 3 years ago

@438561537 please fix the conflicting files.

Xiaoyang-Gu commented 3 years ago

@nodece The conflicts has been removed.

jcfergus commented 3 years ago

Why is there no documentation on how to set up the Github OAuth application? I have no idea what the callback URL is supposed to be.

hsluoyz commented 3 years ago

@438561537

Xiaoyang-Gu commented 3 years ago

@jcfergus If you want to set up the Github OAuth application to run casbin-dashboard locally, you can view this guideline to set up the Github OAuth application and understand the authentication process.

jcfergus commented 3 years ago

Thanks for the response. I understand how to set up OAuth - my point was that there's no documentation of this setup for casbin-dashboard to make sure that when I'm setting up my OAuth application that I use the correct callback URL and application homepage in configuring my OAuth application. I finally found it after digging through the source (http://[hostname:port]/callback, and http://[hostname:port]/dashboard/home, respectively), but it took me rather longer to dig through to find that than it would have to either just be able to set a local password or read a quick document that told me that.

I've decided against casbin for my particular use case, but I'll try to open a documentation pull request to at least add the above.

Xiaoyang-Gu commented 3 years ago

@jcfergus Thanks for your mentioned, it‘s necessary to put more detials to explain how to configure the github OAUTH APP in the readme file.

hsluoyz commented 3 years ago

@438561537 please update the README about OAuth setup instructions for Casbin Dashboard, see a reference here: https://github.com/casbin/casbin-forum#installation

Xiaoyang-Gu commented 3 years ago

@hsluoyz OK, see: https://github.com/casbin/casbin-dashboard/pull/138