MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / Signup

Method Signup

internal/grpcsrv/handlers/authorizer.go:38–63  ·  view source on GitHub ↗

Signup delegates to service.SignUp, applies session/MFA cookie side-effects to the outgoing stream (grpc-gateway lifts them to Set-Cookie for REST callers), and projects the AuthResponse. Proto3 scalars carry no presence, so optional string inputs collapse empty -> nil via optionalString to match th

(ctx context.Context, req *authorizerv1.SignupRequest)

Source from the content-addressed store, hash-verified

36// the GraphQL "field omitted" semantics. Signup is intentionally NOT MCP-
37// exposed (it returns credentials).
38func (h *AuthorizerHandler) Signup(ctx context.Context, req *authorizerv1.SignupRequest) (*authorizerv1.AuthResponse, error) {
39 res, side, err := h.Service.SignUp(ctx, transport.MetaFromGRPC(ctx), &model.SignUpRequest{
40 Email: optionalString(req.Email),
41 PhoneNumber: optionalString(req.PhoneNumber),
42 Password: req.Password,
43 ConfirmPassword: req.ConfirmPassword,
44 GivenName: optionalString(req.GivenName),
45 FamilyName: optionalString(req.FamilyName),
46 MiddleName: optionalString(req.MiddleName),
47 Nickname: optionalString(req.Nickname),
48 Gender: optionalString(req.Gender),
49 Birthdate: optionalString(req.Birthdate),
50 Picture: optionalString(req.Picture),
51 Roles: req.Roles,
52 Scope: req.Scope,
53 RedirectURI: optionalString(req.RedirectUri),
54 IsMultiFactorAuthEnabled: &req.IsMultiFactorAuthEnabled,
55 State: optionalString(req.State),
56 AppData: appDataToMap(req.AppData),
57 })
58 if err != nil {
59 return nil, err
60 }
61 _ = transport.ApplyToGRPC(ctx, side)
62 return projectAuthResponse(res), nil
63}
64
65// Revoke delegates to service.Revoke and projects the result.
66func (h *AuthorizerHandler) Revoke(ctx context.Context, req *authorizerv1.RevokeRequest) (*authorizerv1.RevokeResponse, error) {

Callers

nothing calls this directly

Calls 6

MetaFromGRPCFunction · 0.92
ApplyToGRPCFunction · 0.92
optionalStringFunction · 0.85
appDataToMapFunction · 0.85
projectAuthResponseFunction · 0.85
SignUpMethod · 0.65

Tested by

no test coverage detected