profile.rb 1.55 KB
Newer Older
1 2 3
# for secondary email confirmations - uses the same confirmation controller as :users
devise_for :emails, path: 'profile/emails', controllers: { confirmations: :confirmations }

4 5 6 7 8
resource :profile, only: [:show, :update] do
  member do
    get :audit_log
    get :applications, to: 'oauth/applications#index'

9
    put :reset_incoming_email_token
10
    put :reset_rss_token
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    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]
27
    resources :keys, only: [:index, :show, :create, :destroy]
28 29 30 31 32
    resources :gpg_keys, only: [:index, :create, :destroy] do
      member do
        put :revoke
      end
    end
33 34 35 36 37
    resources :emails, only: [:index, :create, :destroy] do
      member do
        put :resend_confirmation_instructions
      end
    end
38 39 40 41 42 43
    resources :chat_names, only: [:index, :new, :create, :destroy] do
      collection do
        delete :deny
      end
    end

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
    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