KEYCLOAK-84 add totp remove button functionality
This commit is contained in:
parent
91c5fe5e4e
commit
a0808ad224
4 changed files with 19 additions and 1 deletions
|
@ -120,6 +120,10 @@ public class UrlBean {
|
|||
return Urls.accountTotpPage(baseURI, realm.getId()).toString();
|
||||
}
|
||||
|
||||
public String getTotpRemoveUrl() {
|
||||
return Urls.accountTotpRemove(baseURI, realm.getId()).toString();
|
||||
}
|
||||
|
||||
public String getEmailVerificationUrl() {
|
||||
return Urls.accountEmailVerification(baseURI, realm.getId()).toString();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
<tr>
|
||||
<td class="provider"><span class="social googleplus">Google</span></td>
|
||||
<td class="soft">Connected as john@google.com</td>
|
||||
<td class="action"><a href="user-totp-setup.html" class="button">Remove Google</a></td>
|
||||
<td class="action">
|
||||
<a href="${url.totpRemoveUrl}" class="button">Remove Google</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -164,6 +164,14 @@ public class AccountService {
|
|||
return accessCodeEntry;
|
||||
}
|
||||
|
||||
@Path("totp-remove")
|
||||
@GET
|
||||
public Response processTotpRemove() {
|
||||
UserModel user = getUserFromAuthManager();
|
||||
user.setTotp(false);
|
||||
return Flows.forms(realm, request, uriInfo).setUser(user).forwardToTotp();
|
||||
}
|
||||
|
||||
@Path("totp")
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
|
||||
|
|
|
@ -55,6 +55,10 @@ public class Urls {
|
|||
return accountBase(baseUri).path(AccountService.class, "totpPage").build(realmId);
|
||||
}
|
||||
|
||||
public static URI accountTotpRemove(URI baseUri, String realmId) {
|
||||
return accountBase(baseUri).path(AccountService.class, "processTotpRemove").build(realmId);
|
||||
}
|
||||
|
||||
public static URI accountEmailVerification(URI baseUri, String realmId) {
|
||||
return accountBase(baseUri).path(AccountService.class, "emailVerification").build(realmId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue