Commit 36f872b0 authored by ls1947's avatar ls1947
Browse files

add simple possibility to show back tans

parent ceeaab65
......@@ -60,6 +60,8 @@ public class TwoFaUserBean implements Serializable {
private String totpCode, yubicoCode;
private String defaultButton;
private LinotpGetBackupTanListResponse backupTanList;
private Long returnServiceId;
public void preRenderView(ComponentSystemEvent ev) {
......@@ -156,7 +158,7 @@ public class TwoFaUserBean implements Serializable {
public void getBackupTanList(String serial) {
if (! getReadOnly()) {
try {
LinotpGetBackupTanListResponse response = twoFaService.getBackupTanList(user.getId(), serial, "user-" + user.getId());
backupTanList = twoFaService.getBackupTanList(user.getId(), serial, "user-" + user.getId());
} catch (TwoFaException e) {
logger.warn("TwoFaException", e);
......@@ -309,4 +311,8 @@ public class TwoFaUserBean implements Serializable {
}
}
public LinotpGetBackupTanListResponse getBackupTanList() {
return backupTanList;
}
}
......@@ -108,7 +108,8 @@
<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
</p:commandButton>
<p:commandButton action="#{twoFaUserBean.getBackupTanList(token.serial)}" value="#{messages.token_get_tanlist_values}"
update="@form" rendered="#{token.isactive and token.tokenType == 'HMAC'}"/>
update="@form" rendered="#{token.isactive and token.tokenType == 'HMAC'}"
oncomplete="PF('showBackupTanDlg').show();"/>
</p:outputPanel>
</p:panelGrid>
</p:panel>
......@@ -129,7 +130,13 @@
</p:link>
</p:outputPanel>
</p:panel>
<p:dialog header="#{messages.twofa_backup_tan_list_values}"
widgetVar="showBackupTanDlg" id="showBackupTanId" modal="true" closable="true" closeOnEscape="true"
showEffect="fade" hideEffect="fade">
<h:outputText value="#{twoFaUserBean.backupTanList.result.value.otp}" />
</p:dialog>
<p:dialog header="#{messages.twofa_create_totp_token}"
widgetVar="addTotpDlg" id="addTotpDlgId" modal="true" closable="true" closeOnEscape="true"
showEffect="fade" hideEffect="fade">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment