Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit a3cb0c0

Browse files
committed
More conway fixes
1 parent 1b937b7 commit a3cb0c0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cmd/profile-async/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,10 @@ func handleConwaySync(ctx context.Context, env *conf.Env, kc *keycloak.Keycloak[
9595
return fmt.Errorf("getting user: %w", err)
9696
}
9797

98-
ext, err := kc.ExtendUser(ctx, user, userID)
99-
if err != nil {
100-
return fmt.Errorf("extending user: %w", err)
101-
}
102-
10398
out := map[string]any{
10499
"email": user.Email,
105100
"created": user.CreationTime / 1000,
106-
"name": fmt.Sprintf("%s %s", user.First, user.Last),
101+
"name": user.First,
107102
"confirmed": true,
108103
// "leadership": false, // remember to just set this manually
109104
"non_billable": user.NonBillable,
@@ -117,6 +112,9 @@ func handleConwaySync(ctx context.Context, env *conf.Env, kc *keycloak.Keycloak[
117112
"paypal_last_payment": nil,
118113
"waiver": 1,
119114
}
115+
if user.Last != "" {
116+
out["name"] = fmt.Sprintf("%s %s", user.First, user.Last)
117+
}
120118
if out["discount_type"] == "" {
121119
out["discount_type"] = nil
122120
}
@@ -138,7 +136,7 @@ func handleConwaySync(ctx context.Context, env *conf.Env, kc *keycloak.Keycloak[
138136
if user.PaypalMetadata.TimeRFC3339.After(time.Unix(0, 0)) {
139137
out["paypal_last_payment"] = user.PaypalMetadata.TimeRFC3339.Unix()
140138
}
141-
if ext.ActiveMember && user.StripeSubscriptionID != "" {
139+
if user.StripeSubscriptionID != "" {
142140
out["stripe_subscription_state"] = "active"
143141
}
144142

0 commit comments

Comments
 (0)