26 lines
721 B
Go
26 lines
721 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type AuthorizationCode struct {
|
|
gorm.Model
|
|
Code string `gorm:"uniqueIndex;not null"`
|
|
ClientID string `gorm:"not null"`
|
|
UserID uint `gorm:"not null"`
|
|
RedirectURI string `gorm:"not null"`
|
|
Scope string `gorm:"not null"`
|
|
ExpiresAt time.Time `gorm:"not null"`
|
|
Used bool `gorm:"default:false"`
|
|
CodeChallenge string `gorm:"type:varchar(128)"`
|
|
CodeChallengeMethod string `gorm:"type:varchar(20)"`
|
|
Nonce string `gorm:"type:varchar(255)"`
|
|
}
|
|
|
|
func (ac *AuthorizationCode) TableName() string {
|
|
return "oauth_authorization_codes"
|
|
}
|