Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996465
users.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
users.ts
View Options
import
{
Collection
,
App
}
from
"../../main"
;
module
.
exports
=
(
app
:
App
)
=>
{
app
.
on
(
"started"
,
async
()
=>
{
const
sealious_response
=
await
app
.
runAction
(
new
app
.
Sealious
.
SuperContext
(),
[
"collections"
,
"users"
],
"show"
,
{
filter
:
{
email
:
app
.
manifest
.
admin_email
}
}
);
if
(
sealious_response
.
empty
)
{
app
.
Logger
.
warning
(
`Creating an admin account for
${
app
.
manifest
.
admin_email
}
`
);
return
app
.
runAction
(
new
app
.
Sealious
.
SuperContext
(),
[
"collections"
,
"registration-intents"
],
"create"
,
{
email
:
app
.
manifest
.
admin_email
,
role
:
"admin"
}
);
}
});
return
Collection
.
fromDefinition
(
app
,
{
name
:
"users"
,
fields
:
[
{
name
:
"username"
,
type
:
"username"
,
required
:
true
,
},
{
name
:
"email"
,
type
:
"email"
,
required
:
true
,
},
{
name
:
"password"
,
type
:
"password"
,
params
:
{
min_length
:
6
,
},
required
:
true
,
},
{
name
:
"status"
,
type
:
"text"
,
},
{
name
:
"last_login_context"
,
type
:
"context"
,
},
{
name
:
"roles"
,
type
:
"reverse-single-reference"
,
params
:
{
collection
:
"user-roles"
,
field_name
:
"user"
,
},
},
],
access_strategy
:
{
default
:
"public"
,
show
:
"themselves"
,
},
});
};
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 14:04 (11 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557274
Default Alt Text
users.ts (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment