MCPcopy Create free account
hub / github.com/devinterface/startersaas-go-api / GenerateSso

Method GenerateSso

endpoints/user.endpoint.go:74–88  ·  view source on GitHub ↗

GenerateSso function

(ctx *fiber.Ctx)

Source from the content-addressed store, hash-verified

72
73// GenerateSso function
74func (userEndpoint *UserEndpoint) GenerateSso(ctx *fiber.Ctx) error {
75 me, _ := userEndpoint.CurrentUser(ctx)
76 ssoUUID, _ := uuid.NewRandom()
77 inputMap := map[string]string{"sso": ssoUUID.String()}
78
79 updatedUser, err := userService.Update(me.GetID(), me.AccountID, inputMap)
80 if err != nil {
81 return ctx.Status(404).JSON(fiber.Map{
82 "message": err.Error(),
83 })
84 }
85 return ctx.JSON(fiber.Map{
86 "sso": updatedUser.Sso,
87 })
88}
89
90// ByID function
91func (userEndpoint *UserEndpoint) ByID(ctx *fiber.Ctx) error {

Callers

nothing calls this directly

Calls 2

CurrentUserMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected