mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 21:53:39 +09:00
1. remove useless options 2. set AppDataPath instead of repo root path 3. make "disable self-registration" default enabled 4. avoid writing corrupted ini file 5. avoid auto-sign-in the existing admin user
26 lines
555 B
Go
26 lines
555 B
Go
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package webauthn
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.dev/modules/setting"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
setting.AppDomain = "domain"
|
|
setting.AppName = "AppName"
|
|
setting.AppURL = "https://domain/"
|
|
rpOrigin := []string{"https://domain"}
|
|
|
|
Init()
|
|
|
|
assert.Equal(t, setting.AppDomain, WebAuthn.Config.RPID)
|
|
assert.Equal(t, setting.AppName, WebAuthn.Config.RPDisplayName)
|
|
assert.Equal(t, rpOrigin, WebAuthn.Config.RPOrigins)
|
|
}
|