Skip to content
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

Automatically request login if backend requires it #8

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

Itaybre
Copy link
Contributor

@Itaybre Itaybre commented Nov 13, 2024

No description provided.

@@ -22,6 +23,9 @@ extension URLSession {
from: data
).message
) ?? "Unknown error"
if errorMessage == "Login required" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the status code like 401/403 instead? I'm not sure if API gateway lets you customize the text message here

let params = CheckForUpdateParams(apiKey: params.apiKey, tagName: params.tagName, requiresLogin: true)
self?.checkRequest(params: params, completion: completion)
}
completion?(result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to avoid calling the completion handler here if a new request is going to be made?

@Itaybre Itaybre merged commit 51ac3cb into main Nov 14, 2024
2 checks passed
@Itaybre Itaybre deleted the feature/auto_login branch November 14, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants