-
Notifications
You must be signed in to change notification settings - Fork 12
feat:[HL-76] create FirebaseLoginRequest 🍕 #97
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
base: develop
Are you sure you want to change the base?
Conversation
| public var path: String { "AIzaSyB0UczrurqM1STyI8tvx4QZVTyQVw4UJ7Q" } | ||
| public var method: String = "POST" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I have actually written the Unit tests last week. I've been waiting for your approval 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no the path... pease check the register request as an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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