Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sets create magic link channel for email and phone identifiers #91

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

ctran88
Copy link
Contributor

@ctran88 ctran88 commented Dec 11, 2024

BEGIN_COMMIT_OVERRIDE
sets create magic link channel for email and phone identifiers
END_COMMIT_OVERRIDE

What's New?

  • Sets the channel when identifier is email or phone to their respective channels

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have manually tested my code thoroughly
  • I have added/updated inline documentation for public facing interfaces if relevant
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing integration and unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

Comment on lines +110 to +115
[
'identifier' => $identifier,
'channel' => $channel,
'type' => $args->type,
'send' => $args->send,
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to go with a dynamically typed constructor instead of using the more strongly typed setters because the PHP codegen has the channel prop typed as MagicLinkChannel, which looks like

class MagicLinkChannel
{
/**
* Possible values of this enum
*/
public const EMAIL = 'email';
public const PHONE = 'phone';

so MagicLinkChannel::EMAIL is actually a string, which throws a type error since CreateMagicLinkRequest->setChannel is expecting the class.

@ctran88 ctran88 marked this pull request as ready for review December 11, 2024 04:12
@ctran88 ctran88 requested a review from a team December 11, 2024 04:12
@agebhardt
Copy link
Contributor

Haven't QAed just yet, but code looks good to me.

@ctran88 ctran88 merged commit e090c3f into main Dec 11, 2024
4 checks passed
@ctran88 ctran88 deleted the PSG-5540-fix-create-magic-link-channel branch December 11, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants