Skip to content

Commit

Permalink
feat: add parameter guard for language in magic link options
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Jan 8, 2025
1 parent f012606 commit 6b7d08d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/passageidentity/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ def fetch_jwks
end

def create_magic_link(args, opts)
args['language'] = opts['language']
language = opts['language']
if language && !OpenapiClient::MagicLinkLanguage.all_vars.include?(language)
raise ArgumentError, "language must be one of #{OpenapiClient::MagicLinkLanguage.all_vars}"
end

args['language'] = language
args['magic_link_path'] = opts['magic_link_path']
args['redirect_url'] = opts['redirect_url']
args['ttl'] = opts['ttl']
Expand Down

0 comments on commit 6b7d08d

Please sign in to comment.