Commit 8ac11886 authored by 0Tyler's avatar 0Tyler

add UserProxyService to get username

parent e0ce6997
......@@ -14,8 +14,10 @@
package com.google.webauthn.gaedemo.servlets;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.webauthn.gaedemo.service.UserProxyService;
import com.google.webauthn.gaedemo.storage.Credential;
import java.io.IOException;
import java.util.List;
......@@ -42,7 +44,14 @@ public class RemoveCredential extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
/* Tyler start -----------------*/
UserProxyService userProxyService = UserProxyService.getInstance();
User user = userProxyService.getCurrentUser();
String currentUser = (user != null) ? user.getEmail() : userService.getCurrentUser().getEmail();
/* Tyler end -----------------*/
/* Original code
String currentUser = userService.getCurrentUser().getEmail();
*/
Credential.remove(currentUser, request.getParameter("id"));
......
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