mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-20 01:53:57 +09:00
Backport #39792 Fixes #39790 Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Manas Choksi <162600900+choksi2212@users.noreply.github.com> Co-authored-by: choksi2212 <choksi2212@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
28 lines
707 B
Go
28 lines
707 B
Go
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package webauthn
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.dev/modules/setting"
|
|
|
|
"github.com/go-webauthn/webauthn/protocol"
|
|
"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)
|
|
assert.Equal(t, protocol.UnsolicitedOutputPolicyIgnore, WebAuthn.Config.ExtensionsUnsolicitedOutputPolicy)
|
|
}
|