Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit b217d3e

Browse files
authored
Merge pull request #11 from magiclabs/ariflo-sc-72436-remove-magic-link
Removes Magic link Method
2 parents 38b4f3d + 9918ab3 commit b217d3e

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# magic-unity
1+
# Magic Unity
22

33
Magic empowers developers to protect their users via an innovative, passwordless authentication flow without the UX compromises that burden traditional OAuth implementations.
44

55
[Documentation](https://magic.link/docs/login-methods/email/integration/unity)
66

7+
## ⚠️ Removal of `LoginWithMagicLink()` ⚠️
8+
As of `v2.0.0`, passcodes (ie. `LoginWithSMS()`, `LoginWithEmailOTP()`) are replacing Magic Links (ie. `LoginWithMagicLink()`) for all of our Mobile SDKs⁠. [Learn more](https://magic.link/docs/auth/login-methods/email/email-link-update-march-2023)
9+
10+
711
## Supported Platform
812
It's recommended to apply this plugin in Unity 2021.3.3f1 or newer. Developers may build 2d Unity mobile Apps both in iOS and Android.
913

@@ -38,7 +42,7 @@ public class MagicUnity : MonoBehaviour
3842
### User Authentication
3943

4044
```c#
41-
await magic.Auth.LoginWithMagicLink("[email protected]");
45+
await magic.Auth.LoginWithEmailOtp("[email protected]");
4246
```
4347

4448
### Web3 interaction

link.magic.unity.sdk/Prefabs/Scripts/MagicUnityButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void Update()
2222
public async void Login()
2323
{
2424
Magic magic = Magic.Instance;
25-
var token = await magic.Auth.LoginWithMagicLink("jerry+unity@magic.link");
25+
var token = await magic.Auth.LoginWithEmailOtp("hiro@magic.link");
2626
result.text = $"token {token}";
2727
}
2828

link.magic.unity.sdk/Scripts/Modules/AuthModule.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ internal AuthModule(RpcProvider provider) : base(provider)
1111
Provider = provider;
1212
}
1313

14-
public async Task<string> LoginWithMagicLink(string email, bool showUI = true)
15-
{
16-
var config = new LoginWithMagicLinkConfiguration(email, showUI);
17-
return await SendToProviderWithConfig<LoginWithMagicLinkConfiguration, string>(config,
18-
nameof(AuthMethod.magic_auth_login_with_magic_link)
19-
);
20-
}
21-
2214
public async Task<string> LoginWithSms(string phoneNumber)
2315
{
2416
var config = new LoginWithSmsConfiguration(phoneNumber);
@@ -35,19 +27,6 @@ public async Task<string> LoginWithEmailOtp(string email)
3527
}
3628

3729

38-
[Serializable]
39-
internal class LoginWithMagicLinkConfiguration : BaseConfiguration
40-
{
41-
public bool showUI;
42-
public string email;
43-
44-
public LoginWithMagicLinkConfiguration(string email, bool showUI = true)
45-
{
46-
this.showUI = showUI;
47-
this.email = email;
48-
}
49-
}
50-
5130
[Serializable]
5231
internal class LoginWithSmsConfiguration : BaseConfiguration
5332
{
@@ -74,8 +53,7 @@ public LoginWithEmailOtpConfiguration(string email)
7453

7554
internal enum AuthMethod
7655
{
77-
magic_auth_login_with_magic_link,
7856
magic_auth_login_with_sms,
7957
magic_auth_login_with_email_otp
8058
}
81-
}
59+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "link.magic.unity.sdk",
33
"displayName": "Magic Link Unity SDK",
44
"description": "The Magic Link Unity SDK provides access to Magic Key Management System and interact with Blockchain.",
5-
"version": "1.1.0",
5+
"version": "2.0.0",
66
"unity": "2021.3",
77
"author": {
88
"name": "Magic Labs Inc."

0 commit comments

Comments
 (0)