Skip to content

Commit

Permalink
Fix phone regex for E164.
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-descope committed Apr 8, 2024
1 parent 5b7fcf0 commit 429ca1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/descope/mixins/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module Common
DEFAULT_BASE_URL = 'https://api.descope.com' # pragma: no cover
DEFAULT_TIMEOUT_SECONDS = 60
DEFAULT_JWT_VALIDATION_LEEWAY = 5
PHONE_REGEX = %r{^(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[-./ \\]?(?:(?:\(?\d{1,}\)?[-./ \\]?){0,})(?:[-./ \\]?(?:#|ext\.?|extension|x)[-./ \\]?(\d+))?$}
# Using E164 format,\A and \z are start and end of string respectively, to prevent multiline matching
PHONE_REGEX = /\A\+[1-9]\d{1,14}\z/

SESSION_COOKIE_NAME = 'DS'
REFRESH_SESSION_COOKIE_NAME = 'DSR'
Expand Down

0 comments on commit 429ca1b

Please sign in to comment.