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

Commit

Permalink
Merge pull request #11 from magiclabs/ariflo-sc-72436-remove-magic-link
Browse files Browse the repository at this point in the history
Removes Magic link Method
  • Loading branch information
Ariflo authored Jun 20, 2023
2 parents 38b4f3d + 9918ab3 commit b217d3e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# magic-unity
# Magic Unity

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

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

## ⚠️ Removal of `LoginWithMagicLink()` ⚠️
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)


## Supported Platform
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.

Expand Down Expand Up @@ -38,7 +42,7 @@ public class MagicUnity : MonoBehaviour
### User Authentication

```c#
await magic.Auth.LoginWithMagicLink("[email protected]");
await magic.Auth.LoginWithEmailOtp("[email protected]");
```

### Web3 interaction
Expand Down
2 changes: 1 addition & 1 deletion link.magic.unity.sdk/Prefabs/Scripts/MagicUnityButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void Update()
public async void Login()
{
Magic magic = Magic.Instance;
var token = await magic.Auth.LoginWithMagicLink("jerry+unity@magic.link");
var token = await magic.Auth.LoginWithEmailOtp("hiro@magic.link");
result.text = $"token {token}";
}

Expand Down
24 changes: 1 addition & 23 deletions link.magic.unity.sdk/Scripts/Modules/AuthModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ internal AuthModule(RpcProvider provider) : base(provider)
Provider = provider;
}

public async Task<string> LoginWithMagicLink(string email, bool showUI = true)
{
var config = new LoginWithMagicLinkConfiguration(email, showUI);
return await SendToProviderWithConfig<LoginWithMagicLinkConfiguration, string>(config,
nameof(AuthMethod.magic_auth_login_with_magic_link)
);
}

public async Task<string> LoginWithSms(string phoneNumber)
{
var config = new LoginWithSmsConfiguration(phoneNumber);
Expand All @@ -35,19 +27,6 @@ public async Task<string> LoginWithEmailOtp(string email)
}


[Serializable]
internal class LoginWithMagicLinkConfiguration : BaseConfiguration
{
public bool showUI;
public string email;

public LoginWithMagicLinkConfiguration(string email, bool showUI = true)
{
this.showUI = showUI;
this.email = email;
}
}

[Serializable]
internal class LoginWithSmsConfiguration : BaseConfiguration
{
Expand All @@ -74,8 +53,7 @@ public LoginWithEmailOtpConfiguration(string email)

internal enum AuthMethod
{
magic_auth_login_with_magic_link,
magic_auth_login_with_sms,
magic_auth_login_with_email_otp
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "link.magic.unity.sdk",
"displayName": "Magic Link Unity SDK",
"description": "The Magic Link Unity SDK provides access to Magic Key Management System and interact with Blockchain.",
"version": "1.1.0",
"version": "2.0.0",
"unity": "2021.3",
"author": {
"name": "Magic Labs Inc."
Expand Down

0 comments on commit b217d3e

Please sign in to comment.