Press a step to see its codeFind the JumpCloud user, lines 87 to 105Unlock the account, lines 107 to 128Reset MFA, lines 119 to 127Note it on the ticket, lines 130 to 141
Find the JumpCloud user
Suspended and not-yet-activated accounts go to a person instead.
search.status_code !== 200
Fail
JumpCloud returned ${search.status_code} — check the API key.
user === undefined
Fail
No JumpCloud user has the email ${email} — ask which they use.
user.suspended
Fail
${email} is suspended in JumpCloud — hand this to an admin.
!user.activated
Fail
${email} hasn't activated JumpCloud yet — hand this to an admin.
Unlock the account
Nothing happens here when the account isn't locked.
user.account_locked
unlock.status_code !== 200
Fail
Unlock failed (${unlock.status_code}) — use the Admin Portal.
params.problem === "lost_mfa_device"
Reset MFA
They enroll a new authenticator at their next User Portal sign-in.
reset.status_code !== 200
Fail
MFA reset failed (${reset.status_code}) — use the Admin Portal.
Note it on the ticket
ticket !== null
Return
return
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
true
false
true
false
true
false
true
false
true
true
false
false
true
true
false
false
true
false
1// Get someone back into JumpCloud: unlock a locked account, clear the way
2// for a password reset, or reset MFA after a lost phone. Then note what
3// happened on the ticket.
4//
5// Before publishing: set the JUMPCLOUD_API_KEY config value to an API key
6// from a JumpCloud admin who can manage users. A multi-tenant (MSP) key also
7// needs an x-org-id header naming the org: add it to the requests below as a
8// plain header. It isn't a config value because every config value must be
9// set, and single-org keys don't send one.
10//
11// JumpCloud's API has no call that sends a password reset email, so
12// forgot_password unlocks the account if it's locked and points the person
13// to Reset User Password on the User Portal login page, which emails a link.
14
15exportconst input = z.object({
16user_email: z
17.string()
18.email()
19.describe("The email the person signs in to JumpCloud with"),