@@ -22,7 +22,6 @@ public static class UserEndpoints
2222 public static void ConfigureAuthApi ( this WebApplication app )
2323 {
2424 app . MapPost ( "/login" , Login ) . WithSummary ( "Localhost Login" ) ;
25- app . MapGet ( "/me" , Me ) . WithSummary ( "Return user associated with token" ) ;
2625
2726 var users = app . MapGroup ( "users" ) ;
2827 users . MapPost ( "/" , Register ) . WithSummary ( "Create user" ) ;
@@ -32,19 +31,6 @@ public static void ConfigureAuthApi(this WebApplication app)
3231
3332 }
3433
35- [ Authorize ]
36- [ ProducesResponseType ( StatusCodes . Status200OK ) ]
37- private static IResult Me ( IRepository < User > repository , IMapper mapper , ClaimsPrincipal claims )
38- {
39- int ? id = claims . UserRealId ( ) ;
40- User ? user = repository . GetById ( id ) ;
41- if ( user == null ) {
42- return TypedResults . BadRequest ( ) ;
43- }
44- //UserDTO userDTO = Mapper.Map<UserDTO>(user);
45- return TypedResults . Ok ( ) ;
46- }
47-
4834 /// <summary>
4935 /// Retrieves users, optionally filtered by a case-insensitive search on first name, last name, or full name.
5036 /// </summary>
@@ -156,7 +142,11 @@ private static IResult Login(IRepository<User> repository, IMapper mapper, Login
156142 return Results . BadRequest ( new ResponseDTO < Object > ( ) { Message = "Invalid email and/or password provided" } ) ;
157143 }
158144
159- string token = CreateToken ( user , config ) ;
145+ string token ;
146+ token = CreateToken ( user , config ) ;
147+ //if (request.longlifetoken != null && request.longlifetoken) token = CreateToken(user, config);
148+ //else token = CreateToken(user, config);
149+
160150
161151 ResponseDTO < LoginSuccessDTO > response = new ResponseDTO < LoginSuccessDTO >
162152 {
0 commit comments