summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/query/map_load.erl')
-rw-r--r--src/map/query/map_load.erl17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/map/query/map_load.erl b/src/map/query/map_load.erl
index 8365521..3357c4f 100644
--- a/src/map/query/map_load.erl
+++ b/src/map/query/map_load.erl
@@ -48,6 +48,17 @@ parse_input (Req) ->
map_id = MapID
}.
+-spec authenticate_user (input()) -> 'ok'.
+authenticate_user (Input) ->
+ PlayerID = Input#input.player_id,
+ SessionToken = Input#input.session_token,
+
+ Player = shr_timed_cache:fetch(player_db, any, PlayerID),
+
+ shr_security:assert_identity(SessionToken, Player),
+
+ ok.
+
-spec fetch_data (input()) -> query_state().
fetch_data (Input) ->
PlayerID = Input#input.player_id,
@@ -72,11 +83,7 @@ generate_reply (QueryState) ->
-spec handle (binary()) -> binary().
handle (Req) ->
Input = parse_input(Req),
- shr_security:assert_identity
- (
- Input#input.player_id,
- Input#input.session_token
- ),
+ authenticate_user(Input),
shr_security:lock_queries(Input#input.player_id),
QueryState = fetch_data(Input),
shr_security:unlock_queries(Input#input.player_id),