Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
41 stars 5 forks source link

Email addresses with `+` cannot be used for Oauth #404

Closed andrewdmontgomery closed 1 month ago

andrewdmontgomery commented 1 month ago

When attempting to login with OAuth, email addresses containing a + can't be used because the + is converted to a space.

enter email address OAuth prompt
Image Image

This appears to be caused by how URLComponents encodes URLQueryItem: https://stackoverflow.com/a/27724627/10486646

Essentially, the + is a valid character in a query. But the server will convert that character to a space. So if the character is meant to be literally, it needs to be percent-encoded.