Adding todo user.

This commit is contained in:
sergiotarxz 2022-12-06 11:02:41 +01:00
parent 5624813020
commit cbccb35ee8
6 changed files with 86 additions and 2 deletions

View File

@ -19,6 +19,8 @@ my $build = Module::Build->new(
'Crypt::Bcrypt' => 0,
'SVG' => 0,
'JSON' => 0,
'Moo' => 0,
'Types::Standard' => 0,
},
);
$build->create_build_script;

View File

@ -9,7 +9,7 @@
<p>Para jugarlo desde Play Station necesitarás la aplicación Bedrock Together.</p>
<p>Ahora mismo estamos en <b>Beta Abierta</b>, el servidor cuando termine dicha beta costará una pequeña cantidad por persona para sufragar los gastos del servidor. (Nombre de dominio, alojamiento, desarrollo, etc.)</p>
<p>Ahora mismo estamos en <b>Beta Abierta</b>, el servidor cuando termine dicha beta costará una pequeña cantidad por persona para sufragar los gastos del servidor. (Nombre de dominio, alojamiento, desarrollo, promoción, etc.)</p>
</description>
<priority>0</priority>
<menu_text><img alt="Redland Official logo" class="index-image-menu" src="/img/redland-logo.webp"/></menu_text>

View File

@ -25,6 +25,17 @@ sub MIGRATIONS {
path TEXT,
FOREIGN KEY (path) REFERENCES paths(path)
)',
'ALTER TABLE requests ADD PRIMARY KEY (uuid)',
'CREATE TABLE lusers (
uuid UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
verified BOOLEAN DEFAULT false,
password TEXT NOT NULL,
mail_verification_payload TEXT NOT NULL
)',
'ALTER TABLE lusers ADD COLUMN avatar TEXT DEFAULT \'\'',
'ALTER TABLE lusers ADD COLUMN mail_verification_expiration TIMESTAMP DEFAULT NOW() + interval \'1 day\'',
);
}
1;

52
lib/MyRedland/Luser.pm Normal file
View File

@ -0,0 +1,52 @@
package MyRedland::Luser;
use v5.34.1;
use strict;
use warnings;
use Moo;
use Types::Standard qw/Str Bool/;
has uuid => (
is => 'ro',
isa => Str,
required => 0,
);
has username => (
is => 'ro',
isa => Str,
required => 1,
);
has email => (
is => 'rw',
isa => Str,
required => 1,
);
has verified => (
is => 'rw',
isa => Bool,
required => 1,
);
has password => (
is => 'rw',
isa => Str,
required => 1,
);
has mail_verification_payload => (
is => 'rw',
isa => Str,
required => 0,
);
has mail_verification_expiration => (
is => 'rw',
isa => Str,
required => 0,
);
1;

16
lib/MyRedland/Lusers.pm Normal file
View File

@ -0,0 +1,16 @@
package MyRedland::Lusers;
use v5.34.1;
use strict;
use warnings;
use Moo;
use Types::Standard qw/InstanceOf/;
has app => (
is => 'rw',
isa => InstanceOf['Mojolicious'],
required => 1,
);
1;

View File

@ -3,5 +3,8 @@
"bcrypt_pass_stats": ["change_for_bcrypted_password"],
"db": {
"database": "example"
}
},
"stripe_secret": "secret",
"stripe_public": "public",
"test_mode": 1
}