Initial commit

This commit is contained in:
2026-04-17 23:26:01 +00:00
commit 2ea4ca5d52
409 changed files with 63459 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/// <reference path="../pb_data/types.d.ts" />
onRecordRequestOTPRequest((e) => {
// create a user with the OTP email if it doesn't exist
if (!e.record) {
const email = e.requestInfo().body['email']
const record = new Record(e.collection)
record.setEmail(email)
record.setPassword($security.randomString(30))
const language = e.requestInfo().headers['language'] || 'en'
record.set('language', language)
e.app.save(record)
e.record = record
}
return e.next()
}, 'users')