-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add user login related attempts to ParseCloudUser #51
Conversation
Codecov Report
@@ Coverage Diff @@
## main #51 +/- ##
==========================================
- Coverage 90.44% 90.41% -0.03%
==========================================
Files 163 163
Lines 16492 16492
==========================================
- Hits 14916 14912 -4
- Misses 1576 1580 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -15,4 +15,9 @@ | |||
public protocol ParseCloudUser: ParseUser { | |||
/// The session token of the `ParseUser`. | |||
var sessionToken: String? { get set } | |||
/// The number of unsuccessful login attempts. | |||
var _failed_login_count: Int? { get } |
Check warning
Code scanning / Tailor (reported by Codacy)
Variable names should be lowerCamelCase
var _failed_login_count: Int? { get } | ||
/// The date the lockout expires. After this date, the `ParseUser` | ||
/// can attempt to login again. | ||
var _account_lockout_expires_at: Date? { get } |
Check warning
Code scanning / Tailor (reported by Codacy)
Variable names should be lowerCamelCase
New Pull Request Checklist
Issue Description
ParseCloudUser
is missing properties:_failed_login_count
and_account_lockout_expires_at
. These these can be added to a conforming type directly by the developer, adding them to theParseCloudUser
can ensure they are used correctly.Approach
Add
_failed_login_count
and_account_lockout_expires_at
toParseCloudUser
as getters only, preventing them from being set from Cloud Code. The Parse Server has routes and checks to increment/delete these properties at the necessary time. In Cloud Code, the developer may need to read these values to make a decision.Though these properties are not written in a Swifty way (they are not lowerCamelCase) they are left as-is to prevent writing encoding keys for
ParseCloudUser
as this is how they look on the Parse Server.TODOs before merging