diff options
author | Divyam Bhasin <divbest99@gmail.com> | 2020-10-25 14:21:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-25 14:21:49 -0400 |
commit | 7974b3418350c180df70111da611047f09122fa9 (patch) | |
tree | 869fad1ab88c8deca8f6e1eba01cb2b0a47a539e /models/oauth2.go | |
parent | f565cf5dcfa6a674eff2a7b3d47f47c77c6ed9d7 (diff) | |
download | gitea-7974b3418350c180df70111da611047f09122fa9.tar.gz gitea-7974b3418350c180df70111da611047f09122fa9.zip |
#12897 - add mastodon provider (#13293)
* added mastodon provider to oauth code
* changed go.mod and vendor/modules.txt to add updated goth
* vendored mastodon and new goth
* committing result of go mod tidy && go mod vendor
* added pic and mastodon to oauth models
* handled instance url
* applied lafriks suggestion
* Update web_src/js/index.js
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'models/oauth2.go')
-rw-r--r-- | models/oauth2.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/oauth2.go b/models/oauth2.go index ccf24eb35d..65d62fdb61 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -59,6 +59,11 @@ var OAuth2Providers = map[string]OAuth2Provider{ }, }, "yandex": {Name: "yandex", DisplayName: "Yandex", Image: "/img/auth/yandex.png"}, + "mastodon": {Name: "mastodon", DisplayName: "Mastodon", Image: "/img/auth/mastodon.png", + CustomURLMapping: &oauth2.CustomURLMapping{ + AuthURL: oauth2.GetDefaultAuthURL("mastodon"), + }, + }, } // OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls @@ -69,6 +74,7 @@ var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{ "gitlab": OAuth2Providers["gitlab"].CustomURLMapping, "gitea": OAuth2Providers["gitea"].CustomURLMapping, "nextcloud": OAuth2Providers["nextcloud"].CustomURLMapping, + "mastodon": OAuth2Providers["mastodon"].CustomURLMapping, } // GetActiveOAuth2ProviderLoginSources returns all actived LoginOAuth2 sources |