diff options
author | lain <lain@soykaf.club> | 2020-05-07 08:14:54 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-07 08:14:54 +0000 |
commit | f4c2bf0985f3d65d9caa6f02a71c89db9f070fb1 (patch) | |
tree | a7f4ece6dcd0a534b464e455fa382d3ebd8f4d07 /lib/pleroma/web/router.ex | |
parent | 68a126317d7cdd670c8e244319da08ff85639d33 (diff) | |
parent | 3d0c567fbc3506770fdac5f1269c45b244928747 (diff) | |
download | pleroma-f4c2bf0985f3d65d9caa6f02a71c89db9f070fb1.tar.gz |
Merge branch 'issue/209' into 'develop'
[#209] 2FA/two_factor_authentication support
See merge request pleroma/pleroma!801
Diffstat (limited to 'lib/pleroma/web/router.ex')
-rw-r--r-- | lib/pleroma/web/router.ex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 281516bb8..7a171f9fb 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -132,6 +132,7 @@ defmodule Pleroma.Web.Router do post("/users/follow", AdminAPIController, :user_follow) post("/users/unfollow", AdminAPIController, :user_unfollow) + put("/users/disable_mfa", AdminAPIController, :disable_mfa) delete("/users", AdminAPIController, :user_delete) post("/users", AdminAPIController, :users_create) patch("/users/:nickname/toggle_activation", AdminAPIController, :user_toggle_activation) @@ -258,6 +259,16 @@ defmodule Pleroma.Web.Router do post("/follow_import", UtilController, :follow_import) end + scope "/api/pleroma", Pleroma.Web.PleromaAPI do + pipe_through(:authenticated_api) + + get("/accounts/mfa", TwoFactorAuthenticationController, :settings) + get("/accounts/mfa/backup_codes", TwoFactorAuthenticationController, :backup_codes) + get("/accounts/mfa/setup/:method", TwoFactorAuthenticationController, :setup) + post("/accounts/mfa/confirm/:method", TwoFactorAuthenticationController, :confirm) + delete("/accounts/mfa/:method", TwoFactorAuthenticationController, :disable) + end + scope "/oauth", Pleroma.Web.OAuth do scope [] do pipe_through(:oauth) @@ -269,6 +280,10 @@ defmodule Pleroma.Web.Router do post("/revoke", OAuthController, :token_revoke) get("/registration_details", OAuthController, :registration_details) + post("/mfa/challenge", MFAController, :challenge) + post("/mfa/verify", MFAController, :verify, as: :mfa_verify) + get("/mfa", MFAController, :show) + scope [] do pipe_through(:browser) |