Skip to content
Snippets Groups Projects
Unverified Commit 4fe2d7cb authored by Daniel M Brasil's avatar Daniel M Brasil Committed by GitHub
Browse files

Fix HTTP 500 in `/api/v1/emails/check_confirmation` (#25595)

parent cea9db5a
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ class Api::V1::Emails::ConfirmationsController < Api::BaseController
before_action -> { doorkeeper_authorize! :write, :'write:accounts' }, except: :check
before_action :require_user_owned_by_application!, except: :check
before_action :require_user_not_confirmed!, except: :check
before_action :require_authenticated_user!, only: :check
def create
current_user.update!(email: params[:email]) if params.key?(:email)
......
......@@ -130,5 +130,13 @@ RSpec.describe Api::V1::Emails::ConfirmationsController do
end
end
end
context 'without an oauth token and an authentication cookie' do
it 'returns http unauthorized' do
get :check
expect(response).to have_http_status(401)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment