-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.go
30 lines (25 loc) · 894 Bytes
/
type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package auth
import "github.com/M15t/gram/internal/types"
// Credentials represents login request data
// swagger:model
type Credentials struct {
// example: loki@gram.sky
Email string `json:"email" form:"email" validate:"required_without=Username"`
// example: user123!@#
Password string `json:"password" form:"password" validate:"required"`
// This is for SwaggerUI authentication which only support `username` field
// swagger:ignore
Username string `json:"username" form:"username"`
// example: app
GrantType string `json:"grant_type" form:"grant_type" validate:"required"`
}
// RefreshTokenData represents refresh token request data
// swagger:model
type RefreshTokenData struct {
RefreshToken string `json:"refresh_token" validate:"required"`
}
// AuthenticateInput represents internal authenticate data
type AuthenticateInput struct {
User *types.User
IsLogin bool
}