User Session
When a user logs in to your app and becomes authenticated, Openfort issues the user an app access token. This token is signed by Openfort and cannot be spoofed.
Get accessToken
Usage
let accessToken = try await OFSDK.shared.getAccessToken()Returns
StringThrows
{
method: method,
success: false,
error: error
}Get getUser
let result = try await openfort.getUser()Returns
struct OFAuthPlayerResponse: OFCodableSendable {
public let player: OFAuthPlayerResponsePlayer?
public let id: String
public let object: String // "player"
public let createdAt: Int
public let linkedAccounts: [OFLinkedAccountResponse]
}Throws
{
method: method,
success: false,
error: error
}