File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2024 The Gitea Authors. All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ package web
5
+
6
+ import (
7
+ "net/http"
8
+
9
+ "code.gitea.io/gitea/modules/context"
10
+ "code.gitea.io/gitea/modules/setting"
11
+ )
12
+
13
+ type passkeyEndpointsType struct {
14
+ Enroll string `json:"enroll"`
15
+ Manage string `json:"manage"`
16
+ }
17
+
18
+ func passkeyEndpoints (ctx * context.Context ) {
19
+ url := setting .AppURL + "user/settings/security"
20
+ ctx .JSON (http .StatusOK , passkeyEndpointsType {
21
+ Enroll : url ,
22
+ Manage : url ,
23
+ })
24
+ }
Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ func registerRoutes(m *web.Route) {
473
473
m .Get ("/change-password" , func (ctx * context.Context ) {
474
474
ctx .Redirect (setting .AppSubURL + "/user/settings/account" )
475
475
})
476
+ m .Get ("/passkey-endpoints" , passkeyEndpoints )
476
477
m .Methods ("GET, HEAD" , "/*" , public .FileHandlerFunc ())
477
478
}, optionsCorsHandler ())
478
479
You can’t perform that action at this time.
0 commit comments