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

[#15] Implement backend for logout functionality #82

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

chornerman
Copy link
Owner

@chornerman chornerman commented Dec 13, 2022

#15

What happened 👀

  • Create LogoutRequest
  • Add logout API call in service
  • Add logout service call in repository and add corresponding unit tests
  • Create LogoutUseCase and corresponding unit tests

Insight 📝

  • Once logging out, we will clear all of the caches (both surveys and tokens cache)

Proof Of Work 📹

flutter: *** Request ***
flutter: uri: https://survey-api.nimblehq.co/api/v1/oauth/revoke
flutter: method: POST
flutter: responseType: ResponseType.json
flutter: followRedirects: true
flutter: connectTimeout: 30000
flutter: sendTimeout: 0
flutter: receiveTimeout: 30000
flutter: receiveDataWhenStatusError: true
flutter: extra: {}
flutter: headers:
flutter:  content-type: application/json; charset=utf-8
flutter: data:
flutter: {token: HxfsCEPFRtBxIsuGLHG4R11AXUapQ73a5hibBwljPac, client_id: 4gg3bokkvPnMxWz7HHTdM_wf1RNg9k8iA6sZ2ZrA7EA, client_secret: y_GgV-GEjWd3VTzbZBS6tqEco0E68QuqHQv0QND2vKo}
flutter:
flutter: *** Response ***
flutter: uri: https://survey-api.nimblehq.co/api/v1/oauth/revoke
flutter: statusCode: 200
flutter: headers:
flutter:  connection: keep-alive
flutter:  cache-control: max-age=0, private, must-revalidate
flutter:  transfer-encoding: chunked
flutter:  date: Mon, 26 Dec 2022 07:43:53 GMT
flutter:  vary: Accept-Encoding, Origin
flutter:  content-encoding: gzip
flutter:  strict-transport-security: max-age=31536000; includeSubDomains
flutter:  referrer-policy: strict-origin-when-cross-origin
flutter:  report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=xUOFiSySBA6dm%2BAtixlwGZWXezDVwC0KUTbd2Q1OwlgG876dcdExKrN35wFEtaLX0owpBP6urhsB5nos9NC38gKHNuJOnXCnhTObwQ46ksLBqx6wycDgJAsCTEksKH3WAu2pKTuq%2FRKc"}],"group":"cf-nel","max_age":604800}
flutter:  cf-cache-status: DYNAMIC
flutter:  x-permitted-cross-domain-policies: none
flutter:  content-type: application/json; charset=utf-8
flutter:  x-xss-protection: 1; mode=block
flutter:  server: cloudflare
flutter:  x-request-id: 3092d64c-dc19-4ac6-92c9-826300e3037b
flutter:  alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
flutter:  nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
flutter:  x-download-options: noopen
flutter:  cf-ray: 77f830275cca5aca-BKK
flutter:  x-runtime: 0.013030
flutter:  etag: W/"5768fdcc51913951060b5cf9e59e6b77"
flutter:  via: 1.1 vegur
flutter:  x-frame-options: SAMEORIGIN
flutter:  x-content-type-options: nosniff
flutter: Response Text:
flutter: {}
flutter:

@chornerman chornerman added this to the 0.3.0 milestone Dec 13, 2022
@chornerman chornerman self-assigned this Dec 13, 2022
@chornerman chornerman linked an issue Dec 13, 2022 that may be closed by this pull request
@chornerman chornerman force-pushed the feature/#8-integrate-reset-password-screen branch from 1117afc to a39267b Compare December 15, 2022 16:46
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2022

Codecov Report

Base: 29.88% // Head: 31.48% // Increases project coverage by +1.59% 🎉

Coverage data is based on head (084b4a8) compared to base (208d1a4).
Patch coverage: 79.16% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #82      +/-   ##
===========================================
+ Coverage    29.88%   31.48%   +1.59%     
===========================================
  Files           50       52       +2     
  Lines          716      740      +24     
===========================================
+ Hits           214      233      +19     
- Misses         502      507       +5     
Impacted Files Coverage Δ
lib/database/shared_preferences_utils.dart 0.00% <0.00%> (ø)
lib/api/request/logout_request.dart 25.00% <25.00%> (ø)
lib/api/repository/auth_repository.dart 100.00% <100.00%> (ø)
lib/usecase/logout_use_case.dart 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@chornerman chornerman force-pushed the feature/#8-integrate-reset-password-screen branch from a39267b to 6dabf0d Compare December 17, 2022 11:27
@luongvo
Copy link
Collaborator

luongvo commented Dec 20, 2022

@chornerman please update the PR's description & detail to make it ready before marking a PR is ready for review 🙏

Also, what you wrote in the Insight section mostly belongs to What happened, please re-check and update the corresponding PR's detail. Note that, the Insight section does not always need to be longer than What happened https://nimblehq.co/compass/development/code-reviews/author-guidelines/#description. I see this issue is happening in some of your PRs, please take a look 🙏

image

Copy link
Collaborator

@luongvo luongvo left a comment

Choose a reason for hiding this comment

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

rest lgtm

@chornerman chornerman force-pushed the feature/#8-integrate-reset-password-screen branch from 6dabf0d to 208d1a4 Compare December 26, 2022 03:46
@chornerman
Copy link
Owner Author

@luongvo Updated 👍🏼

@luongvo
Copy link
Collaborator

luongvo commented Dec 27, 2022

@chornerman looks better 👍

Base automatically changed from feature/#8-integrate-reset-password-screen to develop December 27, 2022 14:05
@chornerman chornerman merged commit ee5f58c into develop Dec 27, 2022
@chornerman chornerman deleted the feature/#15-backend-logout branch December 27, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 😌
Development

Successfully merging this pull request may close these issues.

[Backend] As a user, I can logout from my account
4 participants