From 54d88c531a7ae6f3a92932bf3edfbe7cb9028d72 Mon Sep 17 00:00:00 2001 From: msvetkov <44121460+msvetkov@users.noreply.github.com> Date: Sun, 1 Dec 2019 16:28:13 +0300 Subject: [PATCH] add user id to auth response --- src/main/kotlin/controllers/auth/AuthController.kt | 2 +- .../auth/responses/ok/UserAuthorisationOkResponse.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/controllers/auth/AuthController.kt b/src/main/kotlin/controllers/auth/AuthController.kt index c3e554b..f3dee19 100644 --- a/src/main/kotlin/controllers/auth/AuthController.kt +++ b/src/main/kotlin/controllers/auth/AuthController.kt @@ -55,7 +55,7 @@ class AuthController : BaseController { hibUser.restored = false userManager.saveUser(hibUser) } - UserAuthorisationOkResponse("${hibUser.firstName} ${hibUser.lastName}", hibUser.type, hibUser.token) + UserAuthorisationOkResponse("${hibUser.firstName} ${hibUser.lastName}", hibUser.type, hibUser.token, hibUser.id) }, gson::toJson) } diff --git a/src/main/kotlin/controllers/auth/responses/ok/UserAuthorisationOkResponse.kt b/src/main/kotlin/controllers/auth/responses/ok/UserAuthorisationOkResponse.kt index b756660..128aa23 100644 --- a/src/main/kotlin/controllers/auth/responses/ok/UserAuthorisationOkResponse.kt +++ b/src/main/kotlin/controllers/auth/responses/ok/UserAuthorisationOkResponse.kt @@ -10,4 +10,6 @@ class UserAuthorisationOkResponse( val type: Int, @Expose val token: String + @Expose + val id: Int ) : BaseOkResponse() \ No newline at end of file