Skip to content

How to use verify-account? #254

Answered by pboling
pboling asked this question in Q&A
Dec 8, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Update & Solution

You can't use the account.verification_key.key directly. In the email that is sent (which I have had trouble actually seeing, or it might have been obvious) it uses the following to generate the "key".

    def token_link(route, param, key)
      route_url(route, param => token_param_value(key))
    end

    def token_param_value(key)
      "#{account_id}#{token_separator}#{convert_email_token_key(key)}"
    end
    
    def convert_email_token_key(key)
      convert_token_key(key)
    end
    
    def convert_token_key(key)
      if key && hmac_secret
        compute_hmac(key)
      else
        key
      end
    end
    
    def compute_hmac(data)
      _process_raw_hma…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pboling
Comment options

@pboling
Comment options

@janko
Comment options

@pboling
Comment options

Answer selected by pboling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants