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

feat: Implemented basic login #742

Merged
merged 20 commits into from
Dec 22, 2021
Merged

feat: Implemented basic login #742

merged 20 commits into from
Dec 22, 2021

Conversation

M123-dev
Copy link
Member

@M123-dev M123-dev commented Dec 20, 2021

Closes: #700

Added new DaoSecuredString, UserManagementHelper and LoginPage

Added temporary login check + route to LoginPage to UserPreferencesPage

Mocks:

Screenshot 2021-12-20 223422

Screenshot:

Screenshot_20211220-222741.jpg

@M123-dev M123-dev added the 👥 User management Account login, signup, signout label Dec 20, 2021
Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Good morning @M123-dev, I have tons of comments for you: enjoy! ;)

@@ -42,6 +42,7 @@ android {
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a good sign if we need to turn the multidex on: we're getting fatter and fatter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we are able to finetune some minify settings but yes looks like it

packages/smooth_app/lib/database/dao_secured_string.dart Outdated Show resolved Hide resolved
packages/smooth_app/lib/database/dao_secured_string.dart Outdated Show resolved Hide resolved
@M123-dev
Copy link
Member Author

Thanks for once again a very huge review @monsieurtanuki, a simple approval would certainly be more pleasant but being made to revise my code and bringing it to its best shape keeps the codebase clean, forces me to write higher quality code and I can learn from it. And isn't that what it's all about

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

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

Hi @M123-dev!
Not 100% convinced, feel free to ignore my comments.

packages/smooth_app/lib/database/dao_secured_string.dart Outdated Show resolved Hide resolved
Comment on lines 42 to 47
try {
rightCredentials = await OpenFoodAPIClient.login(user);
} catch (e) {
// Returning null to show a error
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Already talked about try catch: if you catch the error in the method and just return null, you propagate nothing about the error.
I would return Future<bool> and throw an exception if relevant: in the exception I can have a message like 'server down' or 'time out' or 'you don't have internet connection`.

Copy link
Member Author

Choose a reason for hiding this comment

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

I now simply throw an exception, but this is not yet visible to the end user

@monsieurtanuki
Copy link
Contributor

You're welcome @M123-dev: I guess it's the purpose of peer review. Especially with peers from different backgrounds and with different signature strengths.

@monsieurtanuki
Copy link
Contributor

Just comparing your screenshot and the mock: you could add an AppBar.

@M123-dev
Copy link
Member Author

@monsieurtanuki, there actually isn't one in the mocks, there is just the color of the os notification bar

@M123-dev M123-dev merged commit bc02b75 into develop Dec 22, 2021
@M123-dev M123-dev deleted the user_management branch December 22, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let users log into Smoothie
2 participants