feat:[HL-76] create FirebaseLoginRequest 🍕 #97
Conversation
| public var path: String { "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" } | ||
| public var method: String = "POST" |
There was a problem hiding this comment.
is it right to pass the apiKey for the path
or should it be act like a query parameter
@ahmdmhasn
There was a problem hiding this comment.
And I have actually written the Unit tests last week. I've been waiting for your approval 😅
There was a problem hiding this comment.
Please unit test this clss to make sure the parameters and other values are sent as expected
ahmdmhasn
left a comment
There was a problem hiding this comment.
Great effort, just a few steps...
|
|
||
| public var baseUrl: URL { Constants.firebaseAuth } | ||
| public var path: String { "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" } | ||
| public var method: String = "POST" |
There was a problem hiding this comment.
You either use
| public var method: String = "POST" | |
| public var method: String { "POST" } |
or
| public var method: String = "POST" | |
| public let method: String = "POST" |
| public var path: String { "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" } | ||
| public var method: String = "POST" |
There was a problem hiding this comment.
Please unit test this clss to make sure the parameters and other values are sent as expected
| } | ||
|
|
||
| public var baseUrl: URL { Constants.firebaseAuth } | ||
| public var path: String { "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" } |
There was a problem hiding this comment.
This is no the path... pease check the register request as an example
There was a problem hiding this comment.
i get a little confused about that
| public struct FirebaseLoginResponse: Codable { | ||
| let kind, localID, email, displayName: String | ||
| let idToken: String | ||
| let registered: Bool | ||
| let refreshToken, expiresIn: String | ||
| } | ||
|
|
||
| // MARK: - FirebaseLoginRequest | ||
| public struct FirebaseLoginRequest: RequestType { |
There was a problem hiding this comment.
| public struct FirebaseLoginResponse: Codable { | |
| let kind, localID, email, displayName: String | |
| let idToken: String | |
| let registered: Bool | |
| let refreshToken, expiresIn: String | |
| } | |
| // MARK: - FirebaseLoginRequest | |
| public struct FirebaseLoginRequest: RequestType { | |
| public struct LoginResponse: Codable { | |
| let email, displayName: String | |
| let idToken: String | |
| let registered: Bool | |
| let refreshToken, expiresIn: String | |
| } | |
| // MARK: - FirebaseLoginRequest | |
| public struct LoginRequest: RequestType { |
| let kind, localID, email, displayName: String | ||
| let idToken: String | ||
| let registered: Bool | ||
| let refreshToken, expiresIn: String |
There was a problem hiding this comment.
expiresIn should be converted to Date
Proposed Changes
implement login and register functionality using Firebase without adding the SDK, you can make HTTP requests directly to Firebase's Authentication REST API.
Related Issues
HL-76
List any related issues or pull requests.
HL-75
Networking
Provide any additional information or context that may be relevant.
Screenshot
Required for any UI changes
Checklist