Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996221
password-reset-intents.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
980 B
Referenced Files
None
Subscribers
None
password-reset-intents.js
View Options
module
.
exports
=
app
=>
{
const
declaration
=
{
name
:
"password-reset-intents"
,
fields
:
[
{
name
:
"email"
,
type
:
"value-existing-in-collection"
,
params
:
{
collection
:
app
.
ChipManager
.
get_chip
(
"collection"
,
"users"
),
field
:
"email"
,
include_forbidden
:
true
,
},
},
{
name
:
"token"
,
type
:
"secret-token"
},
],
access_strategy
:
{
default
:
"super"
,
create
:
"public"
,
edit
:
"noone"
,
},
};
app
.
addHook
(
new
app
.
Sealious
.
EventMatchers
.
Collection
({
when
:
"after"
,
collection_name
:
"password-reset-intents"
,
action
:
"create"
,
}),
async
({
metadata
},
intent
)
=>
{
const
{
token
}
=
await
app
.
run_action
(
new
app
.
Sealious
.
SuperContext
(
metadata
.
context
),
[
"collections"
,
"password-reset-intents"
,
intent
.
id
],
"show"
);
const
message
=
await
app
.
MailTemplates
.
PasswordReset
(
app
,
{
email_address
:
intent
.
email
,
token
,
});
await
message
.
send
(
app
);
}
);
return
declaration
;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 14:02 (20 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557118
Default Alt Text
password-reset-intents.js (980 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment