func sendMagicLink(email: String) async throws {
let url = "\(supabaseURL)/auth/v1/otp"
struct Body: Content {...}
let response = try await client.post(URI(string: url)) { req in
req.headers.add(name: "Authorization", value: "Bearer \(serviceRoleKey)")
req.headers.add(name: "apikey", value: serviceRoleKey)
req.headers.contentType = .json
try req.content.encode(Body(email: email, create_user: true))
}
try SupabaseError.throwIfError(response)
}
func sendMagicLink(email: String) async throws {
let url = "\(supabaseURL)/auth/v1/otp"
struct Body: Content {...}
let response = try await client.post(URI(string: url)) { req in
req.headers.add(name: "Authorization", value: "Bearer \(serviceRoleKey)")
req.headers.add(name: "apikey", value: serviceRoleKey)
req.headers.contentType = .json
try req.content.encode(Body(email: email, create_user: true))
}
try SupabaseError.throwIfError(response)
}