-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): add passwordless request options for magiclink (#3385)
- Loading branch information
1 parent
75a4039
commit 3ad7de2
Showing
7 changed files
with
65 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
Amplify/Categories/Auth/Request/AuthSignInWithMagicLinkRequest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
/// Request to sign in a user with Passwordless Magic Link flow | ||
public struct AuthSignInWithMagicLinkRequest: AmplifyOperationRequest { | ||
|
||
/// User name for which the magic link was requested | ||
public let username: String | ||
|
||
/// The flow that the request should begin with. | ||
public let flow: AuthPasswordlessFlow | ||
|
||
/// The redirect url that the magic link will be configured with | ||
public let redirectURL: String | ||
|
||
/// Extra request options defined in `AuthSignInWithMagicLinkRequest.Options` | ||
public var options: Options | ||
|
||
public init(username: String, flow: AuthPasswordlessFlow, redirectURL: String, options: Options) { | ||
self.username = username | ||
self.flow = flow | ||
self.redirectURL = redirectURL | ||
self.options = options | ||
} | ||
} | ||
|
||
public extension AuthSignInWithMagicLinkRequest { | ||
|
||
struct Options { | ||
|
||
/// Extra plugin specific options, only used in special circumstances when the existing options do not provide | ||
/// a way to utilize the underlying auth plugin functionality. See plugin documentation for expected | ||
/// key/values | ||
public let pluginOptions: Any? | ||
|
||
public init(pluginOptions: Any? = nil) { | ||
self.pluginOptions = pluginOptions | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters