Create flow to add password after account activation

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-17 17:08:05 +04:00
parent 5ab5d2cc4c
commit 7971f88fcd
10 changed files with 313 additions and 143 deletions

View File

@@ -384,9 +384,9 @@ func (r *mutationResolver) SignOut(ctx context.Context) (*types.SignOutPayload,
// ActivateAccount is the resolver for the signUpFromInvitation field.
func (r *mutationResolver) ActivateAccount(ctx context.Context, input types.ActivateAccountInput) (*types.ActivateAccountPayload, error) {
user, session, err := r.iam.AuthService.ActivateAccount(
user, createPasswordToken, err := r.iam.AuthService.ActivateAccount(
ctx,
&iam.CreateIdentityFromInvitationRequest{
&iam.ActivateAccountRequest{
InvitationToken: input.Token,
},
)
@@ -411,11 +411,9 @@ func (r *mutationResolver) ActivateAccount(ctx context.Context, input types.Acti
return nil, gqlutils.Internal(ctx)
}
w := gqlutils.HTTPResponseWriterFromContext(ctx)
r.sessionCookie.Set(w, session)
return &types.ActivateAccountPayload{
Profile: types.NewProfile(user),
CreatePasswordToken: createPasswordToken,
Profile: types.NewProfile(user),
}, nil
}