File: credential_options.rb

package info (click to toggle)
ruby-webauthn 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 384 kB
  • sloc: ruby: 2,138; sh: 4; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

require "securerandom"

module WebAuthn
  class CredentialOptions
    CHALLENGE_LENGTH = 32

    def challenge
      @challenge ||= SecureRandom.random_bytes(CHALLENGE_LENGTH)
    end

    def timeout
      @timeout = WebAuthn.configuration.credential_options_timeout
    end
  end
end