Skip to content

Commit

Permalink
Create change-password.put.hl
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Dec 18, 2023
1 parent 551fd86 commit c89046d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions backend/files/system/auth/change-password.put.hl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

// Changes the password of the currently authenticated user.
.arguments
password:string
.description:Changes the password of the currently authenticated user
.type:public

// Sanity checking invocation.
validators.mandatory:x:@.arguments/*/password
validators.string:x:@.arguments/*/password
min:12

// Ensures user is authorized to access endpoint.
auth.ticket.verify

/*
* Invokes the slot that does the heavy lifting, and updates the user's current password.
*
* This slot will change the password of the currently logged in user.
*/
unwrap:x:+/*
signal:magic.auth.change-password
password:x:@.arguments/*/password

// Returns success to caller.
return-nodes
result:success

0 comments on commit c89046d

Please sign in to comment.