Commit 1f50b710 authored by 0Tyler's avatar 0Tyler

fixed AUTHENTICATE button no response

parent 9131c78d
......@@ -35,6 +35,7 @@ import com.google.webauthn.gaedemo.objects.AuthenticatorAttestationResponse;
import com.google.webauthn.gaedemo.objects.CredentialPublicKey;
import com.google.webauthn.gaedemo.service.UserProxyService;
import com.google.webauthn.gaedemo.storage.Credential;
import org.apache.http.HttpStatus;
/**
* Servlet implementation class RegisteredKeys
......@@ -58,7 +59,13 @@ public class RegisteredKeys extends HttpServlet {
/* Tyler start -----------------*/
UserProxyService userProxyService = UserProxyService.getInstance();
User user = userProxyService.getCurrentUser();
String currentUser = (user != null) ? user.getEmail() : userService.getCurrentUser().getEmail();
if(user == null){
response.setContentType("application/json");
response.getWriter().println("no username input");
response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
return;
}
String currentUser = user.getEmail();
log.info("Get " + currentUser);
/* Tyler end -----------------*/
/* Original code
......
......@@ -70,7 +70,14 @@ public class RemoveCredential extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
/* Tyler start -----------------*/
UserProxyService userProxyService = UserProxyService.getInstance();
User user = userProxyService.getCurrentUser();
String currentUser = user.getEmail();
/* Tyler end -----------------*/
/* Original code
String currentUser = userService.getCurrentUser().getEmail();
*/
Credential.remove(currentUser, request.getParameter("credentialId"));
response.setContentType("application/json");
......
......@@ -598,7 +598,9 @@ document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('load', () => {
onClick('#credential-button', registerNewCredential);
onClick('#platform-button', registerPlatformAuthenticator);
// Tyler disable annotation
// onClick('#platform-button', registerPlatformAuthenticator);
onClick('#authenticate-button', getAssertion);
onClick('#isuvpaa-button', isUVPAA);
// Tyler disable annotation
// onClick('#isuvpaa-button', isUVPAA);
});
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