Skip to content

Commit

Permalink
fix: set channel for magic link with user id args
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Dec 5, 2024
1 parent dbd6248 commit 3cba199
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom/lib/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function createMagicLink(
break;
case $args instanceof MagicLinkWithUserArgs:
$payload->setUserId($args->userId);
$payload->setChannel($args->channel);
break;
default:
throw new InvalidArgumentException("args must contain an email, phone, or userId");
Expand Down
3 changes: 3 additions & 0 deletions custom/lib/MagicLinkWithUserArgs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

namespace Passage\Client;

use OpenAPI\Client\Model\MagicLinkChannel;

final readonly class MagicLinkWithUserArgs extends MagicLinkArgsBase
{
public function __construct(
public readonly string $userId,
public readonly MagicLinkChannel $channel,
) {
}
}

0 comments on commit 3cba199

Please sign in to comment.