summaryrefslogtreecommitdiff
path: root/config/routes/profile.rb
blob: 52b9a565db8654ccce3746057e4b99df7fe00dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
resource :profile, only: [:show, :update] do
  member do
    get :audit_log
    get :applications, to: 'oauth/applications#index'

    put :reset_private_token
    put :reset_incoming_email_token
    put :update_username
  end

  scope module: :profiles do
    resource :account, only: [:show] do
      member do
        delete :unlink
      end
    end
    resource :notifications, only: [:show, :update]
    resource :password, only: [:new, :create, :edit, :update] do
      member do
        put :reset
      end
    end
    resource :preferences, only: [:show, :update]
    resources :keys, only: [:index, :show, :new, :create, :destroy]
    resources :emails, only: [:index, :create, :destroy]
    resource :avatar, only: [:destroy]

    resources :personal_access_tokens, only: [:index, :create] do
      member do
        put :revoke
      end
    end

    resource :two_factor_auth, only: [:show, :create, :destroy] do
      member do
        post :create_u2f
        post :codes
        patch :skip
      end
    end

    resources :u2f_registrations, only: [:destroy]
  end
end