Skip to content

Commit

Permalink
verify -> verification
Browse files Browse the repository at this point in the history
  • Loading branch information
joshk committed Dec 11, 2023
1 parent 7f23462 commit 06015f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nerves_hub_web/channels/device_socket_token_auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ defmodule NervesHubWeb.DeviceSocketTokenAuth do

def connect(_params, socket, %{x_headers: headers}) do
parsed_data = parse_headers(headers)
verify_opts = verification_options(parsed_data)
verification_options = verification_options(parsed_data)
salt = expected_salt(headers)

with {:ok, true} <- Application.fetch_env(:nerves_hub, __MODULE__)[:enabled],
{:ok, access_id} <- Keyword.fetch(parsed_data, :access_id),
{:ok, token_auth} <- get_product_token_auth(access_id),
{:ok, signature} <- Keyword.fetch(parsed_data, :signature),
{:ok, identifier} <- Crypto.verify(token_auth.secret, salt, signature, verify_opts),
{:ok, identifier} <- Crypto.verify(token_auth.secret, salt, signature, verification_options),
{:ok, device} <-
Devices.get_or_create_device(token_auth: token_auth, identifier: identifier) do
socket =
Expand Down

0 comments on commit 06015f1

Please sign in to comment.