Skip to content

Commit

Permalink
ketinggalan satu
Browse files Browse the repository at this point in the history
  • Loading branch information
jrione committed Mar 1, 2024
1 parent 9204b3d commit 8300ae9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions controller/login_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func (l LoginController) Login(gctx *gin.Context) {
return
}

var newAccessToken string
resp := &domain.LoginResponse{
if hasRefreshTokenData == nil {
newAccessToken, err = l.LoginUseCase.CreateAccessToken(data, l.Env.Server.AccessTokenSecret, l.Env.Server.AccessTokenExpiry)
resp.AccessToken, err = l.LoginUseCase.CreateAccessToken(data, l.Env.Server.AccessTokenSecret, l.Env.Server.AccessTokenExpiry)
if err != nil {
gctx.JSON(http.StatusInternalServerError, gin.H{
"error": "Internal Server Error",
Expand Down Expand Up @@ -97,9 +97,6 @@ func (l LoginController) Login(gctx *gin.Context) {
return
}

resp := &domain.LoginResponse{
AccessToken: newAccessToken,
}
gctx.JSON(http.StatusOK, resp)
}

Expand Down

0 comments on commit 8300ae9

Please sign in to comment.