/
AwaitAuthentication (Unity)
AwaitAuthentication (Unity)
- Declaration
public static void AwaitAuthentication(Action<CavrnusAuthentication> onAuth)
- Description
Throws an event when user authentication is complete.
This will trigger alongside the onSuccess
from AuthenticateWithPassword or AuthenticateAsGuest. It is agnostic to the method used for authentication.
onAuth
provides a CavrnusAuthentication object, which can be stored or loaded on your local machine for use during a future run. This eliminates the need for the user to re-login.
- Sample
using CavrnusSdk.API;
using UnityEngine;
public class AwaitAuthentication : MonoBehaviour
{
public GameObject SpacesMenuPrefab;
private void Start()
{
CavrnusFunctionLibrary.AwaitAuthentication(auth => OnAuth(auth));
}
private void OnAuth(CavrnusAuthentication auth)
{
//Instantiate the Spaces Menu now that we are logged in
GameObject.Instantiate(SpacesMenuPrefab);
}
}
, multiple selections available,
Related content
AuthenticateWithPassword (Unity)
AuthenticateWithPassword (Unity)
More like this
AuthenticateAsGuest
AuthenticateAsGuest
Read with this
AwaitAnySpaceConnection (Unity)
AwaitAnySpaceConnection (Unity)
More like this
InitializeCavrnus (Unity)
InitializeCavrnus (Unity)
Read with this
FetchJoinableSpaces (Unity)
FetchJoinableSpaces (Unity)
More like this
ExitSpace
ExitSpace
More like this