Class UsersControllerPublic

java.lang.Object
restapi.controllers.UsersControllerPublic

@RestController @RequestMapping("/public/users") final class UsersControllerPublic extends Object
  • Field Details

  • Constructor Details

    • UsersControllerPublic

      UsersControllerPublic()
  • Method Details

    • signup

      @PostMapping("/signup") public org.springframework.http.ResponseEntity<RestResponse> signup(@RequestParam("username") String username, @RequestParam("password") String password, @Param("authUID") String authUID, @Param("email") String email, @Param("country") String country)
      Creates a user, logs in, and returns access token. endpoint /public/users/signup
      Parameters:
      username - Username must be unique
      password - Username must be unique
      authUID - Firebase authUID corresponding to a user logged with phone
      email - Email must be unique
      country - Country code. ex: "ES"
      Returns:
      Authentication Token
    • loginToken

      @PostMapping("/logintoken") public org.springframework.http.ResponseEntity<RestResponse> loginToken(@RequestParam("authUID") String authUID)
      Login after verifying phone with Firebase. Returns Token. endpoint /public/users/logintoken
      Parameters:
      authUID - Firebase authUID corresponding to a user logged with phone
      Returns:
      Authentication Token
    • loginUsername

      @PostMapping("/login") public org.springframework.http.ResponseEntity<RestResponse> loginUsername(@RequestParam("username") String username, @RequestParam("password") String password)
      Login with username and password. Returns Token. endpoint /public/users/login
      Parameters:
      username - user's id
      password - Password must match with the one on the database
      Returns:
      Authentication Token
    • loginEmail

      @PostMapping("/loginemail") public org.springframework.http.ResponseEntity<RestResponse> loginEmail(@RequestParam("email") String email, @RequestParam("password") String password)
      Login with email and password. Returns Token. endpoint /public/users/loginemail
      Parameters:
      email - user's id
      password - Password must match with the one on the database
      Returns:
      Authentication Token
    • loginPhone

      @PostMapping("/loginphone") public org.springframework.http.ResponseEntity<RestResponse> loginPhone(@RequestParam("phone") String phone, @RequestParam("password") String password)
      Login with phone and password. Returns Token. endpoint /public/users
      Parameters:
      phone - user's id
      password - Password must match with the one on the database
      Returns:
      Authentication Token
    • login

      public org.springframework.http.ResponseEntity<RestResponse> login(String username, String password)
      Common function to internally make the login
      Parameters:
      username - username id
      password - Password must match with the one on the database
      Returns:
      Authentication Token