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

Throw different error type if user cancels login #83

Merged
merged 3 commits into from
Aug 9, 2023

Conversation

bogdan-niculescu-sch
Copy link
Collaborator

@bogdan-niculescu-sch bogdan-niculescu-sch commented Jul 27, 2023

If user cancels login flow (from eiD) we should return NotAuthed.CancelledByUser so that it can be handled separately by the mobile apps.

This will allow mobile apps to handle this case the same way as if user canceled login flow by closing the custom tabs.

@bogdan-niculescu-sch bogdan-niculescu-sch marked this pull request as ready for review July 27, 2023 14:08
- throw NotAuthed.CancelledByUser error
Copy link
Contributor

@xserxses xserxses left a comment

Choose a reason for hiding this comment

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

LGTM
I've tested on my branch https://github.com/schibsted/account-sdk-android-web/tree/heremes-bank-id-cancelation-fix and integrating with Hermes those commits. It looks correct - when clicking "cancel" button, I'm getting CancelledByUser status

2023-08-09 16:25:21.998 4239-4239 [Auth] Web...henticator com.agens.android.vgsnarvei.debug D Received new UserAuthStatus: Left(value=com.schibsted.account.webflows.activities.NotAuthed$AuthInProgress@ad1b12e)
2023-08-09 16:25:21.998 4239-4239 [Auth] Web...henticator com.agens.android.vgsnarvei.debug D Received new UserAuthStatus: Left(value=com.schibsted.account.webflows.activities.NotAuthed$CancelledByUser@7f542bd)

From visual code verification - it looks correct.

@bogdan-niculescu-sch bogdan-niculescu-sch merged commit 695f214 into master Aug 9, 2023
3 checks passed
@bogdan-niculescu-sch bogdan-niculescu-sch deleted the custom-error-for-login-user-cancel branch August 9, 2023 15:01
xserxses pushed a commit that referenced this pull request Aug 22, 2023
* Throw different error type if user cancels login

* Check error before state

- throw NotAuthed.CancelledByUser error

* Fix typo
xserxses added a commit that referenced this pull request Aug 22, 2023
* Throw different error type if user cancels login

* Check error before state

- throw NotAuthed.CancelledByUser error

* Fix typo

Co-authored-by: bogdan-niculescu-sch <104439589+bogdan-niculescu-sch@users.noreply.github.com>
bogdan-niculescu-sch added a commit that referenced this pull request Aug 23, 2023
* Throw different error type if user cancels login

* Check error before state

- throw NotAuthed.CancelledByUser error

* Fix typo
bogdan-niculescu-sch added a commit that referenced this pull request Oct 6, 2023
* feat: login prompt content provider implementation

* refactor: content provider interaction logic moved to SessionInfoManager class

* feat: fetching content provider authorities from the package manager; checking is session on the device exists

* chore: refactored loginPrompt classes code style

* refactor: move sessionInfoManager to sharedPreferencesStorage class

* refactor: fix compatibility issues with PackageManager.MATCH_ALL

* refactor: login prompt content provider refactor on xserxses comments

* Add loginPromptManager (#73)

* Add loginPromptManager

* Add translations (#82)

* call loginPrompt from Client (#84)

* call loginPrompt from Client

clean main activity
Run requestLoginPrompt in background thread

* Login promp tracking (#80)

* Propose SchibstedAccountTracking public and internal API

* Present tracking API in ExampleApp

* Document API

* More readable logging

* Initial events for show/hide login prompt

* Tracking events for clicks

* Update events (#86)

* Add final tracking events

---------

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>
Co-authored-by: bogdan-niculescu-sch <104439589+bogdan-niculescu-sch@users.noreply.github.com>

* Fill in readme (#89)

- apply outstanding review remark

* Throw different error type if user cancels login (#83)

* Throw different error type if user cancels login

* Check error before state

- throw NotAuthed.CancelledByUser error

* Fix typo

* Update webflows/src/main/java/com/schibsted/account/webflows/util/Util.kt

Co-authored-by: Filip Misztal <filip.jan.misztal@gmail.com>

* Review remarks before merge (#90)

* initial cleanup

* make tracking thread safe

- small review remarks

* cleanup layout

* code cleanup

* add localized logos

* Update logos

* fix dialog showing check

* apply review remark

* Fix query period on content provider getSessions

* Change DB primary key to packageName for content provider (#91)

* Change db primary key to packagename for content provider

* On conclict - replace with new values

* user writable database for writting

---------

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* Use "use" to be more safe in case of failures + Nice syntax (#92)

* Use use to be more safe

* Even more idiomatic Kotlin

---------

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* Send cancel event on eid user cancel (#93)

* Send cancel event on eid user cancel

* Small Readme update

* Login prompt crash (#94)

* Pass intent via argument instead of whole client

* Prevent adding twice

---------

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* add support for norsk bokmal and norsk nynorsk (#96)

* add serverUrl to content provider query (#95)

* check for local session before showing login prompt (#97)

* check for local session before showing login prompt

* apply review remark

* Check also for presence - not only callback type (#98)

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* Dismiss prompt when login is initiated (#99)

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* Remove login promp on login click (#100)

* Dismiss prompt when login is initiated

* Better place

* This is no longer needed

---------

Co-authored-by: filip-misztal <filip.misztal@schibsted.com>

* add extra properties for events (#101)

* add extra properties for events

* Update readme and minor cleanup

---------

Co-authored-by: wbaklazec-sch <105283956+wbaklazec-sch@users.noreply.github.com>
Co-authored-by: bogdan-niculescu-sch <104439589+bogdan-niculescu-sch@users.noreply.github.com>
Co-authored-by: filip-misztal <filip.misztal@schibsted.com>
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.

None yet

2 participants