@@ -0,0 +1,1310 @@
+package com.google.sps.servlets;%0A%0Aimport com.google.appengine.api.users.UserService;%0Aimport com.google.appengine.api.users.UserServiceFactory;%0Aimport com.google.gson.Gson;%0Aimport com.google.sps.data.AuthInfo;%0Aimport java.io.IOException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A@WebServlet(%22/login%22)%0Apublic class AuthServlet extends HttpServlet %7B%0A%0A  @Override%0A  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A    response.setContentType(%22application/json%22);%0A    Gson gson = new Gson();%0A%0A    UserService userService = UserServiceFactory.getUserService();%0A    if (userService.isUserLoggedIn()) %7B%0A      String redirectAfterLogout = %22/%22;%0A      String logoutURL = userService.createLogoutURL(redirectAfterLogout);%0A%0A      AuthInfo userLoginStatus = AuthInfo.createLoggedInInfo(logoutURL);%0A      response.getWriter().println(gson.toJson(userLoginStatus));%0A    %7D else %7B%0A      String redirectAfterLogin = %22/%22;%0A      String loginURL = userService.createLoginURL(redirectAfterLogin);%0A%0A      AuthInfo userLoginStatus = AuthInfo.createLoggedOutInfo(loginURL);%0A      response.getWriter().println(gson.toJson(userLoginStatus));%0A    %7D%0A  %7D%0A%7D

Add servlet to handle user authentication