added refresh tocken
This commit is contained in:
+15
-2
@@ -26,8 +26,21 @@ type LoginRequest struct {
|
||||
}
|
||||
|
||||
type AuthResponse struct {
|
||||
Token string `json:"token" example:"eyJhbGciOiJIUzI1NiIs..."`
|
||||
User UserPublic `json:"user"`
|
||||
Token string `json:"token" example:"eyJhbGciOiJIUzI1NiIs..."`
|
||||
RefreshToken string `json:"refresh_token" example:"dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="`
|
||||
User UserPublic `json:"user"`
|
||||
}
|
||||
|
||||
type RefreshRequest struct {
|
||||
RefreshToken string `json:"refresh_token" binding:"required" example:"dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="`
|
||||
}
|
||||
|
||||
type RefreshTokenDoc struct {
|
||||
ID bson.ObjectID `json:"id" bson:"_id"`
|
||||
UserID bson.ObjectID `json:"user_id" bson:"user_id"`
|
||||
TokenHash string `json:"token_hash" bson:"token_hash"`
|
||||
ExpiresAt time.Time `json:"expires_at" bson:"expires_at"`
|
||||
CreatedAt time.Time `json:"created_at" bson:"created_at"`
|
||||
}
|
||||
|
||||
type UserPublic struct {
|
||||
|
||||
Reference in New Issue
Block a user