Skip to content

Commit 60cc7b4

Browse files
committed
Ensure account attributes appear in login/logout errors.
1 parent 0eaf8e7 commit 60cc7b4

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

palace-books-controller/src/main/java/org/nypl/simplified/books/controller/ProfileAccountLoginTask.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class ProfileAccountLoginTask(
101101
return this.steps.finishSuccess(Unit)
102102
}
103103

104+
this.steps.addAttribute("AccountProviderName", this.account.provider.displayName)
105+
this.steps.addAttribute("AccountProviderID", this.account.provider.id.toString())
106+
104107
if (!this.validateRequest()) {
105108
this.debug("account does not support the given authentication")
106109
this.steps.currentStepFailed(

palace-books-controller/src/main/java/org/nypl/simplified/books/controller/ProfileAccountLogoutTask.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ class ProfileAccountLogoutTask(
116116
}
117117

118118
return try {
119+
this.steps.addAttribute("AccountProviderName", this.account.provider.displayName)
120+
this.steps.addAttribute("AccountProviderID", this.account.provider.id.toString())
121+
119122
this.runLogoutURLIfNecessary()
120123
this.runFCMTokenDeletion()
121124
this.runDeviceDeactivation()

palace-tests/src/test/java/org/nypl/simplified/tests/books/controller/FakeAccounts.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ object FakeAccounts {
1414

1515
Mockito.`when`(provider.id)
1616
.thenReturn(URI.create("urn:fake"))
17+
Mockito.`when`(provider.displayName)
18+
.thenReturn("Fake Provider")
1719

1820
return provider
1921
}

0 commit comments

Comments
 (0)