Facebook authentication - solved

Facebook returns email address with ‘\u0040’ Unicode symbol instead of ‘\u{0040}’ or ‘@’, it causes an exception during the decoding. So there is the workaround:

guard let body = response.body else {
throw Abort(.internalServerError)
}
var content = String(buffer: body)
content = content.replacingOccurrences(of: “\u0040”, with: “@”)
let data = Data(content.utf8)
let userInfo = try JSONDecoder().decode(FacebookUserInfo.self, from: data)
return userInfo