I want to fetch the logged in user details but currently we aren’t receiving from token so I need to call users api but as I am using sdk in my swift ui project when I was trying to use Users function to get the details from get function I am unable to receive any of the data only info , so can anyone help me on that ?
here is the :
public func loginWithBrowser(method: AuthMethod, process: AuthProcess) async throws -> JWTUser {
do {
let ids = getClientAuth0()
let credentials = try await webAuth.start(with: ids, method: method, process: process)
let staticDomain = <My Domain>
if let userInfo = try await webAuth.getUserDetails(token: credentials.accessToken, domain: staticDomain)?.get("user-id", fields: ["email", "user_id"]){
debugPrint("CPSAuthO line 84 : userInfo: \(userInfo)")
}
"CPSAuthO line 84 : userInfo: Request<Dictionary<String, Any>, ManagementError>(session: <__NSURLSessionLocal: 0x104206b50>, url: https://<domain>/api/v2/users/user-id?fields=email,user_id&include_fields=true, method: \"GET\", handle: (Function), parameters: [:], headers: [\"Authorization\": \"Bearer <token>\"], logger: nil, telemetry: Auth0.Telemetry(enabled: true, info: Optional(\"eyJuYW1lIjoiQXV0aDAuc3dpZnQiLCJ2ZXJzaW9uIjoiMi4xMC4wIiwiZW52Ijp7ImlPUyI6IjE4LjEiLCJzd2lmdCI6IjUueCJ9fQ\")))"