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

Oauth updates #1642

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from
Open

Oauth updates #1642

wants to merge 44 commits into from

Conversation

gwbischof
Copy link
Contributor

@gwbischof gwbischof commented Dec 17, 2024

Oauth updates.
This PR depends on thunder-app/lemmy_api_client#28
This can be tested against the lemmy instance at hopandzip.com which I deployed with the lemmy:main

pubspec.yaml Outdated Show resolved Hide resolved
@gwbischof gwbischof marked this pull request as ready for review January 7, 2025 01:11
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Hey, I just wanted to say, nice going on this!! I know it was a beast to get working, but in the end the code doesn't seem too crazy!

I left a few comments, mostly stylistic things. I haven't actually tested the flow yet but I would love to!


await showBlockingInputDialog<String>(
context: context,
title: "Sign Up",
Copy link
Member

Choose a reason for hiding this comment

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

Remember to put these strings in the localization file!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which file do I update to do that?

} else if (state.status == AuthStatus.oauthContentWarning) {
bool acceptedContentWarning = false;

await showThunderDialog<void>(
Copy link
Member

Choose a reason for hiding this comment

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

Is this code similar enough to the existing content warning code that it could be refactored into a reusable method?

lib/core/auth/bloc/auth_bloc.dart Outdated Show resolved Hide resolved
lib/core/auth/bloc/auth_bloc.dart Outdated Show resolved Hide resolved
@@ -527,3 +527,78 @@ void showInputDialog<T>({
}),
);
}

/// Shows a dialog which takes input and offers suggestions
Future<String?> showBlockingInputDialog<T>({
Copy link
Member

Choose a reason for hiding this comment

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

This seems pretty similar to showInputDialog. Is there any way to combine these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

showInputDialog doesn't block, so it didn't work to display the dialog where you enter your username on your first oauth login. So I modified it to create showBlockingInputDialog. So yea, they are pretty similar. I think showInputDialog is used in one other place in the code, maybe we could make that one blocking also?

pubspec.yaml Outdated Show resolved Hide resolved
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