添加 OIDC 和 OAuth2 服务器的基础结构,包括配置、数据库模型、服务、处理器和路由。新增登录页面模板,支持用户认证和授权流程。
This commit is contained in:
22
models/authorization_code.go
Normal file
22
models/authorization_code.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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"`
|
||||
}
|
||||
|
||||
func (ac *AuthorizationCode) TableName() string {
|
||||
return "oauth_authorization_codes"
|
||||
}
|
||||
Reference in New Issue
Block a user