getCurrentAuthToken
MaestroKit provides the getCurrentAuthToken
function to retrieve the current authentication token used by the SDK. This asynchronous function returns an optional String
that contains the JWT token if it has been configured; otherwise, it returns nil
.
Return Type | Description | Example |
---|---|---|
String? | The current authentication token (JWT) if available; nil if not configured. | "exampleJWTToken" |
Code Example
Task {
if let authToken = await MaestroManager.shared.getCurrentAuthToken() {
print("Current Authentication Token: \(authToken)")
} else {
print("No authentication token configured.")
}
}