mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 19:40:19 +08:00
feat: support webauthn (#407)
* feat: support webauthn * Update init.go * Update user_webauthn.go * Update UserEditPage.js * Update WebauthnCredentialTable.js * Update LoginPage.js Co-authored-by: Gucheng <85475922+nomeguy@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
208dc11d25
commit
7f3b2500b3
@ -15,9 +15,11 @@
|
||||
package object
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
"github.com/duo-labs/webauthn/webauthn"
|
||||
)
|
||||
|
||||
func InitDb() {
|
||||
@ -29,6 +31,8 @@ func InitDb() {
|
||||
initBuiltInCert()
|
||||
initBuiltInLdap()
|
||||
}
|
||||
|
||||
initWebAuthn()
|
||||
}
|
||||
|
||||
func initBuiltInOrganization() bool {
|
||||
@ -72,6 +76,7 @@ func initBuiltInOrganization() bool {
|
||||
{Name: "Is global admin", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
|
||||
{Name: "Is forbidden", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
|
||||
{Name: "Is deleted", Visible: true, ViewRule: "Admin", ModifyRule: "Admin"},
|
||||
{Name: "WebAuthn credentials", Visible: true, ViewRule: "Self", ModifyRule: "Self"},
|
||||
},
|
||||
}
|
||||
AddOrganization(organization)
|
||||
@ -221,3 +226,7 @@ func initBuiltInProvider() {
|
||||
}
|
||||
AddProvider(provider)
|
||||
}
|
||||
|
||||
func initWebAuthn() {
|
||||
gob.Register(webauthn.SessionData{})
|
||||
}
|
||||
|
Reference in New Issue
Block a user