mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Login via OpenID-2.0 (#618)
This commit is contained in:
parent
0693fbfc00
commit
71d16f69ff
44 changed files with 2298 additions and 57 deletions
|
@ -94,6 +94,8 @@ var migrations = []Migration{
|
|||
NewMigration("rewrite authorized_keys file via new format", useNewPublickeyFormat),
|
||||
// v22 -> v23
|
||||
NewMigration("generate and migrate wiki Git hooks", generateAndMigrateWikiGitHooks),
|
||||
// v23 -> v24
|
||||
NewMigration("add user openid table", addUserOpenID),
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
|
|
26
models/migrations/v23.go
Normal file
26
models/migrations/v23.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2017 Gitea. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
// UserOpenID is the list of all OpenID identities of a user.
|
||||
type UserOpenID struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UID int64 `xorm:"INDEX NOT NULL"`
|
||||
URI string `xorm:"UNIQUE NOT NULL"`
|
||||
}
|
||||
|
||||
|
||||
func addUserOpenID(x *xorm.Engine) error {
|
||||
if err := x.Sync2(new(UserOpenID)); err != nil {
|
||||
return fmt.Errorf("Sync2: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue