Skip to content

Commit

Permalink
feat: add ability to recognize early access code in header (hacktoolk…
Browse files Browse the repository at this point in the history
…it#444)

## Description
Django cannot receive cookie data from the react-native environment.
Instead of adding it as a query-parameter on every request, sending it
in the header was better.
This PR updates the `get_early_access_code` helper function to also get
the early access code from header `X-HTK-Early-Access-Code`
  • Loading branch information
goztrk authored Jul 28, 2024
1 parent 97dc302 commit bf22572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/prelaunch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ def is_prelaunch_exception_view(path):

def get_early_access_code(request):
key = 'early_access_code'
header = 'X-HTK-Early-Access-Code'
early_access_code = (
request.GET.get(key)
or request.COOKIES.get(key)
or request.session.get(key)
or request.headers.get(header)
)
return early_access_code

Expand Down

0 comments on commit bf22572

Please sign in to comment.