1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Router do
6 use Pleroma.Web, :router
9 plug(:accepts, ["html"])
15 plug(Pleroma.Plugs.OAuthPlug)
16 plug(Pleroma.Plugs.UserEnabledPlug)
20 plug(:accepts, ["json"])
22 plug(Pleroma.Plugs.OAuthPlug)
23 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
24 plug(Pleroma.Plugs.UserFetcherPlug)
25 plug(Pleroma.Plugs.SessionAuthenticationPlug)
26 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
27 plug(Pleroma.Plugs.AuthenticationPlug)
28 plug(Pleroma.Plugs.UserEnabledPlug)
29 plug(Pleroma.Plugs.SetUserSessionIdPlug)
30 plug(Pleroma.Plugs.EnsureUserKeyPlug)
31 plug(Pleroma.Plugs.IdempotencyPlug)
34 pipeline :authenticated_api do
35 plug(:accepts, ["json"])
37 plug(Pleroma.Plugs.AuthExpectedPlug)
38 plug(Pleroma.Plugs.OAuthPlug)
39 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
40 plug(Pleroma.Plugs.UserFetcherPlug)
41 plug(Pleroma.Plugs.SessionAuthenticationPlug)
42 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
43 plug(Pleroma.Plugs.AuthenticationPlug)
44 plug(Pleroma.Plugs.UserEnabledPlug)
45 plug(Pleroma.Plugs.SetUserSessionIdPlug)
46 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
47 plug(Pleroma.Plugs.IdempotencyPlug)
50 pipeline :admin_api do
51 plug(:accepts, ["json"])
53 plug(Pleroma.Plugs.OAuthPlug)
54 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
55 plug(Pleroma.Plugs.UserFetcherPlug)
56 plug(Pleroma.Plugs.SessionAuthenticationPlug)
57 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
58 plug(Pleroma.Plugs.AuthenticationPlug)
59 plug(Pleroma.Plugs.AdminSecretAuthenticationPlug)
60 plug(Pleroma.Plugs.UserEnabledPlug)
61 plug(Pleroma.Plugs.SetUserSessionIdPlug)
62 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
63 plug(Pleroma.Plugs.UserIsAdminPlug)
64 plug(Pleroma.Plugs.IdempotencyPlug)
67 pipeline :mastodon_html do
68 plug(:accepts, ["html"])
70 plug(Pleroma.Plugs.OAuthPlug)
71 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
72 plug(Pleroma.Plugs.UserFetcherPlug)
73 plug(Pleroma.Plugs.SessionAuthenticationPlug)
74 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
75 plug(Pleroma.Plugs.AuthenticationPlug)
76 plug(Pleroma.Plugs.UserEnabledPlug)
77 plug(Pleroma.Plugs.SetUserSessionIdPlug)
78 plug(Pleroma.Plugs.EnsureUserKeyPlug)
81 pipeline :pleroma_html do
82 plug(:accepts, ["html"])
84 plug(Pleroma.Plugs.OAuthPlug)
85 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
86 plug(Pleroma.Plugs.UserFetcherPlug)
87 plug(Pleroma.Plugs.SessionAuthenticationPlug)
88 plug(Pleroma.Plugs.AuthenticationPlug)
89 plug(Pleroma.Plugs.EnsureUserKeyPlug)
92 pipeline :well_known do
93 plug(:accepts, ["json", "jrd+json", "xml", "xrd+xml"])
97 plug(:accepts, ["json", "xml"])
100 pipeline :pleroma_api do
101 plug(:accepts, ["html", "json"])
104 pipeline :mailbox_preview do
105 plug(:accepts, ["html"])
107 plug(:put_secure_browser_headers, %{
108 "content-security-policy" =>
109 "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' 'unsafe-eval'"
113 pipeline :http_signature do
114 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
115 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
118 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
119 pipe_through(:pleroma_api)
121 get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
122 post("/password_reset", PasswordController, :do_reset, as: :reset_password)
123 get("/emoji", UtilController, :emoji)
124 get("/captcha", UtilController, :captcha)
125 get("/healthcheck", UtilController, :healthcheck)
128 scope "/api/pleroma", Pleroma.Web do
129 pipe_through(:pleroma_api)
130 post("/uploader_callback/:upload_path", UploaderController, :callback)
133 scope "/api/pleroma/admin", Pleroma.Web.AdminAPI do
134 pipe_through(:admin_api)
136 post("/users/follow", AdminAPIController, :user_follow)
137 post("/users/unfollow", AdminAPIController, :user_unfollow)
139 delete("/users", AdminAPIController, :user_delete)
140 post("/users", AdminAPIController, :users_create)
141 patch("/users/:nickname/toggle_activation", AdminAPIController, :user_toggle_activation)
142 patch("/users/activate", AdminAPIController, :user_activate)
143 patch("/users/deactivate", AdminAPIController, :user_deactivate)
144 put("/users/tag", AdminAPIController, :tag_users)
145 delete("/users/tag", AdminAPIController, :untag_users)
147 get("/users/:nickname/permission_group", AdminAPIController, :right_get)
148 get("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_get)
150 post("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_add)
153 "/users/:nickname/permission_group/:permission_group",
158 post("/users/permission_group/:permission_group", AdminAPIController, :right_add_multiple)
161 "/users/permission_group/:permission_group",
163 :right_delete_multiple
166 get("/relay", AdminAPIController, :relay_list)
167 post("/relay", AdminAPIController, :relay_follow)
168 delete("/relay", AdminAPIController, :relay_unfollow)
170 post("/users/invite_token", AdminAPIController, :create_invite_token)
171 get("/users/invites", AdminAPIController, :invites)
172 post("/users/revoke_invite", AdminAPIController, :revoke_invite)
173 post("/users/email_invite", AdminAPIController, :email_invite)
175 get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset)
176 patch("/users/force_password_reset", AdminAPIController, :force_password_reset)
177 get("/users/:nickname/credentials", AdminAPIController, :show_user_credentials)
178 patch("/users/:nickname/credentials", AdminAPIController, :update_user_credentials)
180 get("/users", AdminAPIController, :list_users)
181 get("/users/:nickname", AdminAPIController, :user_show)
182 get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
184 get("/instances/:instance/statuses", AdminAPIController, :list_instance_statuses)
186 patch("/users/confirm_email", AdminAPIController, :confirm_email)
187 patch("/users/resend_confirmation_email", AdminAPIController, :resend_confirmation_email)
189 get("/reports", AdminAPIController, :list_reports)
190 get("/grouped_reports", AdminAPIController, :list_grouped_reports)
191 get("/reports/:id", AdminAPIController, :report_show)
192 patch("/reports", AdminAPIController, :reports_update)
193 post("/reports/:id/notes", AdminAPIController, :report_notes_create)
194 delete("/reports/:report_id/notes/:id", AdminAPIController, :report_notes_delete)
196 put("/statuses/:id", AdminAPIController, :status_update)
197 delete("/statuses/:id", AdminAPIController, :status_delete)
198 get("/statuses", AdminAPIController, :list_statuses)
200 get("/config", AdminAPIController, :config_show)
201 post("/config", AdminAPIController, :config_update)
202 get("/config/descriptions", AdminAPIController, :config_descriptions)
203 get("/restart", AdminAPIController, :restart)
205 get("/moderation_log", AdminAPIController, :list_log)
207 post("/reload_emoji", AdminAPIController, :reload_emoji)
208 get("/stats", AdminAPIController, :stats)
211 scope "/api/pleroma/emoji", Pleroma.Web.PleromaAPI do
214 pipe_through(:admin_api)
216 post("/import_from_fs", EmojiAPIController, :import_from_fs)
218 post("/:pack_name/update_file", EmojiAPIController, :update_file)
219 post("/:pack_name/update_metadata", EmojiAPIController, :update_metadata)
220 put("/:name", EmojiAPIController, :create)
221 delete("/:name", EmojiAPIController, :delete)
222 post("/download_from", EmojiAPIController, :download_from)
223 post("/list_from", EmojiAPIController, :list_from)
227 # Pack info / downloading
228 get("/", EmojiAPIController, :list_packs)
229 get("/:name/download_shared/", EmojiAPIController, :download_shared)
233 scope "/", Pleroma.Web.TwitterAPI do
234 pipe_through(:pleroma_html)
236 post("/main/ostatus", UtilController, :remote_subscribe)
237 get("/ostatus_subscribe", RemoteFollowController, :follow)
239 post("/ostatus_subscribe", RemoteFollowController, :do_follow)
242 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
243 pipe_through(:authenticated_api)
245 post("/change_email", UtilController, :change_email)
246 post("/change_password", UtilController, :change_password)
247 post("/delete_account", UtilController, :delete_account)
248 put("/notification_settings", UtilController, :update_notificaton_settings)
249 post("/disable_account", UtilController, :disable_account)
251 post("/blocks_import", UtilController, :blocks_import)
252 post("/follow_import", UtilController, :follow_import)
255 scope "/oauth", Pleroma.Web.OAuth do
258 get("/authorize", OAuthController, :authorize)
261 post("/authorize", OAuthController, :create_authorization)
262 post("/token", OAuthController, :token_exchange)
263 post("/revoke", OAuthController, :token_revoke)
264 get("/registration_details", OAuthController, :registration_details)
267 pipe_through(:browser)
269 get("/prepare_request", OAuthController, :prepare_request)
270 get("/:provider", OAuthController, :request)
271 get("/:provider/callback", OAuthController, :callback)
272 post("/register", OAuthController, :register)
276 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
279 get("/statuses/:id/reactions/:emoji", PleromaAPIController, :emoji_reactions_by)
280 get("/statuses/:id/reactions", PleromaAPIController, :emoji_reactions_by)
283 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
285 pipe_through(:authenticated_api)
287 get("/conversations/:id/statuses", PleromaAPIController, :conversation_statuses)
288 get("/conversations/:id", PleromaAPIController, :conversation)
289 post("/conversations/read", PleromaAPIController, :read_conversations)
293 pipe_through(:authenticated_api)
295 patch("/conversations/:id", PleromaAPIController, :update_conversation)
296 put("/statuses/:id/reactions/:emoji", PleromaAPIController, :react_with_emoji)
297 delete("/statuses/:id/reactions/:emoji", PleromaAPIController, :unreact_with_emoji)
298 post("/notifications/read", PleromaAPIController, :read_notification)
300 patch("/accounts/update_avatar", AccountController, :update_avatar)
301 patch("/accounts/update_banner", AccountController, :update_banner)
302 patch("/accounts/update_background", AccountController, :update_background)
304 get("/mascot", MascotController, :show)
305 put("/mascot", MascotController, :update)
307 post("/scrobble", ScrobbleController, :new_scrobble)
312 get("/accounts/:id/favourites", AccountController, :favourites)
316 pipe_through(:authenticated_api)
318 post("/accounts/:id/subscribe", AccountController, :subscribe)
319 post("/accounts/:id/unsubscribe", AccountController, :unsubscribe)
322 post("/accounts/confirmation_resend", AccountController, :confirmation_resend)
325 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
327 get("/accounts/:id/scrobbles", ScrobbleController, :user_scrobbles)
330 scope "/api/v1", Pleroma.Web.MastodonAPI do
331 pipe_through(:authenticated_api)
333 get("/accounts/verify_credentials", AccountController, :verify_credentials)
335 get("/accounts/relationships", AccountController, :relationships)
337 get("/accounts/:id/lists", AccountController, :lists)
338 get("/accounts/:id/identity_proofs", AccountController, :identity_proofs)
340 get("/follow_requests", FollowRequestController, :index)
341 get("/blocks", AccountController, :blocks)
342 get("/mutes", AccountController, :mutes)
344 get("/timelines/home", TimelineController, :home)
345 get("/timelines/direct", TimelineController, :direct)
347 get("/favourites", StatusController, :favourites)
348 get("/bookmarks", StatusController, :bookmarks)
350 get("/notifications", NotificationController, :index)
351 get("/notifications/:id", NotificationController, :show)
352 post("/notifications/clear", NotificationController, :clear)
353 post("/notifications/dismiss", NotificationController, :dismiss)
354 delete("/notifications/destroy_multiple", NotificationController, :destroy_multiple)
356 get("/scheduled_statuses", ScheduledActivityController, :index)
357 get("/scheduled_statuses/:id", ScheduledActivityController, :show)
359 get("/lists", ListController, :index)
360 get("/lists/:id", ListController, :show)
361 get("/lists/:id/accounts", ListController, :list_accounts)
363 get("/domain_blocks", DomainBlockController, :index)
365 get("/filters", FilterController, :index)
367 get("/suggestions", SuggestionController, :index)
369 get("/conversations", ConversationController, :index)
370 post("/conversations/:id/read", ConversationController, :read)
372 get("/endorsements", AccountController, :endorsements)
374 patch("/accounts/update_credentials", AccountController, :update_credentials)
376 post("/statuses", StatusController, :create)
377 delete("/statuses/:id", StatusController, :delete)
379 post("/statuses/:id/reblog", StatusController, :reblog)
380 post("/statuses/:id/unreblog", StatusController, :unreblog)
381 post("/statuses/:id/favourite", StatusController, :favourite)
382 post("/statuses/:id/unfavourite", StatusController, :unfavourite)
383 post("/statuses/:id/pin", StatusController, :pin)
384 post("/statuses/:id/unpin", StatusController, :unpin)
385 post("/statuses/:id/bookmark", StatusController, :bookmark)
386 post("/statuses/:id/unbookmark", StatusController, :unbookmark)
387 post("/statuses/:id/mute", StatusController, :mute_conversation)
388 post("/statuses/:id/unmute", StatusController, :unmute_conversation)
390 put("/scheduled_statuses/:id", ScheduledActivityController, :update)
391 delete("/scheduled_statuses/:id", ScheduledActivityController, :delete)
393 post("/polls/:id/votes", PollController, :vote)
395 post("/media", MediaController, :create)
396 put("/media/:id", MediaController, :update)
398 delete("/lists/:id", ListController, :delete)
399 post("/lists", ListController, :create)
400 put("/lists/:id", ListController, :update)
402 post("/lists/:id/accounts", ListController, :add_to_list)
403 delete("/lists/:id/accounts", ListController, :remove_from_list)
405 post("/filters", FilterController, :create)
406 get("/filters/:id", FilterController, :show)
407 put("/filters/:id", FilterController, :update)
408 delete("/filters/:id", FilterController, :delete)
410 post("/reports", ReportController, :create)
412 post("/follows", AccountController, :follows)
413 post("/accounts/:id/follow", AccountController, :follow)
414 post("/accounts/:id/unfollow", AccountController, :unfollow)
415 post("/accounts/:id/block", AccountController, :block)
416 post("/accounts/:id/unblock", AccountController, :unblock)
417 post("/accounts/:id/mute", AccountController, :mute)
418 post("/accounts/:id/unmute", AccountController, :unmute)
420 post("/follow_requests/:id/authorize", FollowRequestController, :authorize)
421 post("/follow_requests/:id/reject", FollowRequestController, :reject)
423 post("/domain_blocks", DomainBlockController, :create)
424 delete("/domain_blocks", DomainBlockController, :delete)
426 post("/push/subscription", SubscriptionController, :create)
427 get("/push/subscription", SubscriptionController, :get)
428 put("/push/subscription", SubscriptionController, :update)
429 delete("/push/subscription", SubscriptionController, :delete)
431 get("/markers", MarkerController, :index)
432 post("/markers", MarkerController, :upsert)
435 scope "/api/web", Pleroma.Web do
436 pipe_through(:authenticated_api)
438 put("/settings", MastoFEController, :put_settings)
441 scope "/api/v1", Pleroma.Web.MastodonAPI do
444 post("/accounts", AccountController, :create)
445 get("/accounts/search", SearchController, :account_search)
447 get("/instance", InstanceController, :show)
448 get("/instance/peers", InstanceController, :peers)
450 post("/apps", AppController, :create)
451 get("/apps/verify_credentials", AppController, :verify_credentials)
453 get("/statuses/:id/card", StatusController, :card)
454 get("/statuses/:id/favourited_by", StatusController, :favourited_by)
455 get("/statuses/:id/reblogged_by", StatusController, :reblogged_by)
457 get("/custom_emojis", CustomEmojiController, :index)
459 get("/trends", MastodonAPIController, :empty_array)
461 get("/timelines/public", TimelineController, :public)
462 get("/timelines/tag/:tag", TimelineController, :hashtag)
463 get("/timelines/list/:list_id", TimelineController, :list)
465 get("/statuses", StatusController, :index)
466 get("/statuses/:id", StatusController, :show)
467 get("/statuses/:id/context", StatusController, :context)
469 get("/polls/:id", PollController, :show)
471 get("/accounts/:id/statuses", AccountController, :statuses)
472 get("/accounts/:id/followers", AccountController, :followers)
473 get("/accounts/:id/following", AccountController, :following)
474 get("/accounts/:id", AccountController, :show)
476 get("/search", SearchController, :search)
479 scope "/api/v2", Pleroma.Web.MastodonAPI do
481 get("/search", SearchController, :search2)
484 scope "/api", Pleroma.Web do
485 pipe_through(:config)
487 get("/help/test", TwitterAPI.UtilController, :help_test)
488 post("/help/test", TwitterAPI.UtilController, :help_test)
489 get("/statusnet/config", TwitterAPI.UtilController, :config)
490 get("/statusnet/version", TwitterAPI.UtilController, :version)
491 get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
494 scope "/api", Pleroma.Web do
498 "/account/confirm_email/:user_id/:token",
499 TwitterAPI.Controller,
505 scope "/api", Pleroma.Web, as: :authenticated_twitter_api do
506 pipe_through(:authenticated_api)
508 get("/oauth_tokens", TwitterAPI.Controller, :oauth_tokens)
509 delete("/oauth_tokens/:id", TwitterAPI.Controller, :revoke_token)
511 post("/qvitter/statuses/notifications/read", TwitterAPI.Controller, :notifications_read)
514 pipeline :ap_service_actor do
515 plug(:accepts, ["activity+json", "json"])
519 plug(:accepts, ["html", "xml", "atom", "activity+json", "json"])
520 plug(Pleroma.Plugs.StaticFEPlug)
524 plug(:accepts, ["json", "xml"])
527 scope "/", Pleroma.Web do
528 pipe_through(:ostatus)
529 pipe_through(:http_signature)
531 get("/objects/:uuid", OStatus.OStatusController, :object)
532 get("/activities/:uuid", OStatus.OStatusController, :activity)
533 get("/notice/:id", OStatus.OStatusController, :notice)
534 get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
536 get("/users/:nickname/feed", Feed.UserController, :feed, as: :user_feed)
537 get("/users/:nickname", Feed.UserController, :feed_redirect, as: :user_feed)
539 get("/tags/:tag", Feed.TagController, :feed, as: :tag_feed)
542 scope "/", Pleroma.Web do
543 pipe_through(:browser)
544 get("/mailer/unsubscribe/:token", Mailer.SubscriptionController, :unsubscribe)
547 pipeline :activitypub do
548 plug(:accepts, ["activity+json", "json"])
549 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
550 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
553 scope "/", Pleroma.Web.ActivityPub do
554 # XXX: not really ostatus
555 pipe_through(:ostatus)
557 get("/users/:nickname/outbox", ActivityPubController, :outbox)
560 pipeline :activitypub_client do
561 plug(:accepts, ["activity+json", "json"])
563 plug(Pleroma.Plugs.OAuthPlug)
564 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
565 plug(Pleroma.Plugs.UserFetcherPlug)
566 plug(Pleroma.Plugs.SessionAuthenticationPlug)
567 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
568 plug(Pleroma.Plugs.AuthenticationPlug)
569 plug(Pleroma.Plugs.UserEnabledPlug)
570 plug(Pleroma.Plugs.SetUserSessionIdPlug)
571 plug(Pleroma.Plugs.EnsureUserKeyPlug)
574 scope "/", Pleroma.Web.ActivityPub do
575 pipe_through([:activitypub_client])
577 get("/api/ap/whoami", ActivityPubController, :whoami)
578 get("/users/:nickname/inbox", ActivityPubController, :read_inbox)
580 post("/users/:nickname/outbox", ActivityPubController, :update_outbox)
581 post("/api/ap/upload_media", ActivityPubController, :upload_media)
583 get("/users/:nickname/followers", ActivityPubController, :followers)
584 get("/users/:nickname/following", ActivityPubController, :following)
587 scope "/", Pleroma.Web.ActivityPub do
588 pipe_through(:activitypub)
589 post("/inbox", ActivityPubController, :inbox)
590 post("/users/:nickname/inbox", ActivityPubController, :inbox)
593 scope "/relay", Pleroma.Web.ActivityPub do
594 pipe_through(:ap_service_actor)
596 get("/", ActivityPubController, :relay)
599 pipe_through(:http_signature)
600 post("/inbox", ActivityPubController, :inbox)
603 get("/following", ActivityPubController, :following, assigns: %{relay: true})
604 get("/followers", ActivityPubController, :followers, assigns: %{relay: true})
607 scope "/internal/fetch", Pleroma.Web.ActivityPub do
608 pipe_through(:ap_service_actor)
610 get("/", ActivityPubController, :internal_fetch)
611 post("/inbox", ActivityPubController, :inbox)
614 scope "/.well-known", Pleroma.Web do
615 pipe_through(:well_known)
617 get("/host-meta", WebFinger.WebFingerController, :host_meta)
618 get("/webfinger", WebFinger.WebFingerController, :webfinger)
619 get("/nodeinfo", Nodeinfo.NodeinfoController, :schemas)
622 scope "/nodeinfo", Pleroma.Web do
623 get("/:version", Nodeinfo.NodeinfoController, :nodeinfo)
626 scope "/", Pleroma.Web do
629 get("/web/manifest.json", MastoFEController, :manifest)
632 scope "/", Pleroma.Web do
633 pipe_through(:mastodon_html)
635 get("/web/login", MastodonAPI.AuthController, :login)
636 delete("/auth/sign_out", MastodonAPI.AuthController, :logout)
638 post("/auth/password", MastodonAPI.AuthController, :password_reset)
640 get("/web/*path", MastoFEController, :index)
643 pipeline :remote_media do
646 scope "/proxy/", Pleroma.Web.MediaProxy do
647 pipe_through(:remote_media)
649 get("/:sig/:url", MediaProxyController, :remote)
650 get("/:sig/:url/:filename", MediaProxyController, :remote)
653 if Pleroma.Config.get(:env) == :dev do
655 pipe_through([:mailbox_preview])
657 forward("/mailbox", Plug.Swoosh.MailboxPreview, base_path: "/dev/mailbox")
661 # Test-only routes needed to test action dispatching and plug chain execution
662 if Pleroma.Config.get(:env) == :test do
663 scope "/test/authenticated_api", Pleroma.Tests do
664 pipe_through(:authenticated_api)
666 for action <- [:skipped_oauth, :performed_oauth, :missed_oauth] do
667 get("/#{action}", OAuthTestController, action)
672 scope "/", Pleroma.Web.MongooseIM do
673 get("/user_exists", MongooseIMController, :user_exists)
674 get("/check_password", MongooseIMController, :check_password)
677 scope "/", Fallback do
678 get("/registration/:token", RedirectController, :registration_page)
679 get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
680 get("/api*path", RedirectController, :api_not_implemented)
681 get("/*path", RedirectController, :redirector)
683 options("/*path", RedirectController, :empty)