blob: 72d4c2e54106850a5c2824618cbc85126cacec16 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
class UploaderController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :authenticate_user_from_token!
def submit
ExtractSaveDataJob.perform_later params[:game].as_json
render json: { message: "Data submitted for processing." }
end
private
def authenticate_user_from_token!
login = request.headers["X-User-Login"].presence
token = request.headers["X-User-Token"].presence
# TODO: Replace this.
unless authenticate_pokeviewer(login, token)
head :unauthorized
end
end
end
|