generated from fluffy-bunny/fluffycore-grpc-starterkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login-finish.go
49 lines (39 loc) · 1.18 KB
/
login-finish.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package loginfinish
import (
"net/http"
di "github.com/fluffy-bunny/fluffy-dozm-di"
contracts_util "github.com/fluffy-bunny/fluffycore-rage-identity/pkg/contracts/util"
wellknown_echo "github.com/fluffy-bunny/fluffycore-rage-identity/pkg/wellknown/echo"
contracts_handler "github.com/fluffy-bunny/fluffycore/echo/contracts/handler"
echo "github.com/labstack/echo/v4"
)
type (
service struct {
someUtil contracts_util.ISomeUtil
}
)
var stemService = (*service)(nil)
func init() {
var _ contracts_handler.IHandler = stemService
}
func (s *service) Ctor(someUtil contracts_util.ISomeUtil) (*service, error) {
return &service{
someUtil: someUtil,
}, nil
}
// AddScopedIHandler registers the *service as a singleton.
func AddScopedIHandler(builder di.ContainerBuilder) {
contracts_handler.AddScopedIHandleWithMetadata[*service](builder,
stemService.Ctor,
[]contracts_handler.HTTPVERB{
contracts_handler.POST,
},
wellknown_echo.WebAuthN_Login_Finish,
)
}
func (s *service) GetMiddleware() []echo.MiddlewareFunc {
return []echo.MiddlewareFunc{}
}
func (s *service) Do(c echo.Context) error {
return c.JSON(http.StatusOK, "ok")
}