|
30 | 30 | import com.sismics.util.filter.TokenBasedSecurityFilter; |
31 | 31 | import com.sismics.util.totp.GoogleAuthenticator; |
32 | 32 | import com.sismics.util.totp.GoogleAuthenticatorKey; |
33 | | -import org.apache.commons.lang3.StringUtils; |
34 | | - |
35 | 33 | import jakarta.json.Json; |
36 | 34 | import jakarta.json.JsonArrayBuilder; |
37 | 35 | import jakarta.json.JsonObjectBuilder; |
|
40 | 38 | import jakarta.ws.rs.core.MediaType; |
41 | 39 | import jakarta.ws.rs.core.NewCookie; |
42 | 40 | import jakarta.ws.rs.core.Response; |
| 41 | +import org.apache.commons.lang3.StringUtils; |
| 42 | + |
43 | 43 | import java.util.Date; |
44 | 44 | import java.util.List; |
45 | 45 | import java.util.Set; |
@@ -256,39 +256,6 @@ public Response update( |
256 | 256 | return Response.ok().entity(response.build()).build(); |
257 | 257 | } |
258 | 258 |
|
259 | | - /** |
260 | | - * Checks if a username is available. |
261 | | - * Search only on active accounts. |
262 | | - * |
263 | | - * @api {get} /user/check_username Check username availability |
264 | | - * @apiName GetUserCheckUsername |
265 | | - * @apiGroup User |
266 | | - * @apiParam {String} username Username |
267 | | - * @apiSuccess {String} status Status OK or KO |
268 | | - * @apiPermission none |
269 | | - * @apiVersion 1.5.0 |
270 | | - * |
271 | | - * @param username Username to check |
272 | | - * @return Response |
273 | | - */ |
274 | | - @GET |
275 | | - @Path("check_username") |
276 | | - public Response checkUsername( |
277 | | - @QueryParam("username") String username) { |
278 | | - UserDao userDao = new UserDao(); |
279 | | - User user = userDao.getActiveByUsername(username); |
280 | | - |
281 | | - JsonObjectBuilder response = Json.createObjectBuilder(); |
282 | | - if (user != null) { |
283 | | - response.add("status", "ko") |
284 | | - .add("message", "Username already registered"); |
285 | | - } else { |
286 | | - response.add("status", "ok"); |
287 | | - } |
288 | | - |
289 | | - return Response.ok().entity(response.build()).build(); |
290 | | - } |
291 | | - |
292 | 259 | /** |
293 | 260 | * This resource is used to authenticate the user and create a user session. |
294 | 261 | * The "session" is only used to identify the user, no other data is stored in the session. |
|
0 commit comments