Handbook
Glossary
<edit-profile-action> ( -- action )
Vocabulary
furnace
.
auth
.
features
.
edit-profile
Inputs
None
Outputs
action
an
object
Definition
USING:
accessors
furnace.actions
furnace.asides
furnace.auth
html.forms
kernel
namespaces
sequences
urls
validators
;
IN:
furnace.auth.features.edit-profile
:
<edit-profile-action>
( -- action )
<page-action>
[
logged-in-user
get
[
username>>
"username"
set-value
]
[
realname>>
"realname"
set-value
]
[
email>>
"email"
set-value
]
tri
]
>>init
{
realm
"features/edit-profile/edit-profile"
}
>>template
[
username
"username"
set-value
{
{
"realname"
[
[
v-one-line
]
v-optional
]
}
{
"password"
[
]
}
{
"new-password"
[
[
v-password
]
v-optional
]
}
{
"verify-password"
[
[
v-password
]
v-optional
]
}
{
"email"
[
[
v-email
]
v-optional
]
}
}
validate-params
{
"password"
"new-password"
"verify-password"
}
[
value
empty?
not
]
any?
[
"password"
value
username
check-login
[
"incorrect password"
validation-error
]
unless
same-password-twice
]
when
]
>>validate
[
logged-in-user
get
"new-password"
value
[
>>encoded-password
]
unless-empty
"realname"
value
>>realname
"email"
value
>>email
t
>>changed?
drop
URL" %24realm"
end-aside
]
>>submit
<protected>
"edit your profile"
>>description
;