Skip to content

Commit

Permalink
feat: Add user login related attempts to ParseCloudUser (#51)
Browse files Browse the repository at this point in the history
* feat: Add user login related attempts to ParseCloudUser

* add doc badges

* nits

* Update README.md
  • Loading branch information
cbaker6 authored Jan 22, 2023
1 parent 6cca2ff commit d6a05a9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ deprecation warnings when building your app in Xcode before upgrading
to [Corey Baker](https://github.com/cbaker6).

__New features__
* Add user login related attempts to ParseCloudUser. This allows developers to decode login related information when using Parse-Swift for Cloud Code ([#51](https://github.com/netreconlab/Parse-Swift/pull/51)), thanks to [Corey Baker](https://github.com/cbaker6).
* Add option to set the serverURL for a particular call. This is useful when using the Swift SDK for Cloud Code in a multi-server environment ([#50](https://github.com/netreconlab/Parse-Swift/pull/50)), thanks to [Corey Baker](https://github.com/cbaker6).
* ParseVersion now supports pre-release versions of the SDK ([#49](https://github.com/netreconlab/Parse-Swift/pull/49)), thanks to [Corey Baker](https://github.com/cbaker6).
* Adds the the ability to watch particular keys with LiveQueries. Requires Parse-Server 6.0.0 ([#48](https://github.com/netreconlab/Parse-Swift/pull/48)), thanks to [Corey Baker](https://github.com/cbaker6).
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

---

[![Playgrounds](http://img.shields.io/badge/swift-playgrounds-2196f3.svg)](https://github.com/netreconlab/Parse-Swift/tree/main/ParseSwift.playground/Pages)
[![Documentation](http://img.shields.io/badge/read_-docs-2196f3.svg)](https://swiftpackageindex.com/netreconlab/Parse-Swift/documentation)
[![Tuturiol](http://img.shields.io/badge/read_-tuturials-2196f3.svg)](https://netreconlab.github.io/Parse-Swift/release/tutorials/parseswift/)
[![Build Status CI](https://github.com/netreconlab/Parse-Swift/workflows/ci/badge.svg?branch=main)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Aci+branch%3Amain)
[![Build Status Release](https://github.com/netreconlab/Parse-Swift/workflows/release/badge.svg)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Arelease)
[![Coverage](https://codecov.io/gh/netreconlab/Parse-Swift/branch/main/graph/badge.svg)](https://codecov.io/gh/netreconlab/Parse-Swift/branches)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/403b74d0f2514e288b0a1b2e52b6d841)](https://www.codacy.com/gh/netreconlab/Parse-Swift/dashboard?utm_source=github.com&utm_medium=referral&utm_content=netreconlab/Parse-Swift&utm_campaign=Badge_Grade)
[![Carthage](https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat)](https://github.com/carthage/carthage)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)][license-link]

[![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/netreconlab/Parse-Swift)
[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/netreconlab/Parse-Swift)

Expand Down
5 changes: 5 additions & 0 deletions Sources/ParseSwift/Objects/ParseCloudUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ import Foundation
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 }
/// The date the lockout expires. After this date, the `ParseUser`
/// can attempt to login again.
var _account_lockout_expires_at: Date? { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class ParseHookFunctionRequestCombineTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
4 changes: 4 additions & 0 deletions Tests/ParseSwiftTests/ParseHookFunctionRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class ParseHookFunctionRequestTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ParseHookTriggerRequestCombineTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
4 changes: 4 additions & 0 deletions Tests/ParseSwiftTests/ParseHookTriggerRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class ParseHookTriggerRequestTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down

0 comments on commit d6a05a9

Please sign in to comment.