forked from ebhomengo/niki
"fix(param):prevent admin to get password in login response"
This commit is contained in:
parent
fc040db1c0
commit
948a240282
|
@ -8,6 +8,18 @@ type LoginWithPhoneNumberRequest struct {
|
|||
}
|
||||
|
||||
type LoginWithPhoneNumberResponse struct {
|
||||
Admin entity.Admin `json:"admin"`
|
||||
AdminInfo AdminInfo `json:"admin_info"`
|
||||
Tokens Tokens `json:"tokens"`
|
||||
}
|
||||
|
||||
type AdminInfo struct {
|
||||
ID uint `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
Role entity.AdminRole `json:"role"`
|
||||
Description string `json:"description"`
|
||||
Email string `json:"email"`
|
||||
Gender entity.Gender `json:"gender"`
|
||||
Status entity.AdminStatus `json:"status"`
|
||||
}
|
||||
|
|
|
@ -35,7 +35,17 @@ func (s Service) LoginWithPhoneNumber(ctx context.Context, req adminserviceparam
|
|||
}
|
||||
|
||||
return adminserviceparam.LoginWithPhoneNumberResponse{
|
||||
Admin: admin,
|
||||
AdminInfo: adminserviceparam.AdminInfo{
|
||||
ID: admin.ID,
|
||||
FirstName: admin.FirstName,
|
||||
LastName: admin.LastName,
|
||||
PhoneNumber: admin.PhoneNumber,
|
||||
Role: admin.Role,
|
||||
Description: admin.Description,
|
||||
Email: admin.Email,
|
||||
Gender: admin.Gender,
|
||||
Status: admin.Status,
|
||||
},
|
||||
Tokens: adminserviceparam.Tokens{
|
||||
AccessToken: accessToken,
|
||||
RefreshToken: refreshToken,
|
||||
|
|
Loading…
Reference in New Issue