claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 185 forks source link

Support login through Mastodon API. #239

Open Feufochmar opened 6 years ago

Feufochmar commented 6 years ago

This commit add Mastdon as an option for login by using mastodon-passport.

Mastodon being a federated social network, there are several instances of the service, so you need to know against which server you do the authentication. In this commit, a domain parameter in the configuration file indicate this. If users from different instances should be able to log in, this commit must be improved to ask the domain on the login page.

This commit also reorganises a bit the auth.js file by regrouping the code related to a login method inside the same if block. This has the effect of not exposing unneeded API endpoints is those are disabled in the configuration.

This pull request is mainly for reference, as I've seen that you haven't merged similar pull requests.

claudioc commented 5 years ago

@Feufochmar first of all, thank you for understanding my position on this topic; I rather not merge all the requests for new auth method, simply because with current Jingo's architecture (not "pluggable") it'd be a complete nightmare to test all the integration whenever a new change is made :)

Thanks!