# Facebook authentication - solved

**URL:** <https://forums.kodeco.com/t/facebook-authentication-solved/140954>\
**Category:** Server Side Swift with Vapor\
**Created:** [May 26, 2021, 8:02pm UTC](https://forums.kodeco.com/t/facebook-authentication-solved/140954 "2021-05-26T20:02:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oleg.dr](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/oleg.dr/32/102075_2.png) [@oleg.dr](https://forums.kodeco.com/u/oleg.dr)\
**Post date:** [May 26, 2021, 8:02pm UTC](https://forums.kodeco.com/t/facebook-authentication-solved/140954/1 "2021-05-26T20:02:46Z")

</div>

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
