Changed default admin account web address
This commit is contained in:
@@ -5,7 +5,7 @@ WEB_PORT=3200
|
|||||||
DB_HOSTNAME=database
|
DB_HOSTNAME=database
|
||||||
DB_DATABASE=auth
|
DB_DATABASE=auth
|
||||||
DB_USERNAME=auth
|
DB_USERNAME=auth
|
||||||
DB_PASSWORD=venusaur
|
DB_PASSWORD=charizard
|
||||||
|
|
||||||
MAIL_SMTP=smtp.example.com
|
MAIL_SMTP=smtp.example.com
|
||||||
MAIL_USERNAME=foobar@example.com
|
MAIL_USERNAME=foobar@example.com
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ module.exports = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (adminRecord == null) {
|
if (adminRecord == null) {
|
||||||
|
const webAddress = process.env.WEB_ADDRESS == 'localhost' ? 'example.com' : process.env.WEB_ADDRESS; //can't log in as "localhost"
|
||||||
await accounts.create({
|
await accounts.create({
|
||||||
email: `${process.env.ADMIN_DEFAULT_USERNAME}@${process.env.WEB_ADDRESS}`,
|
email: `${process.env.ADMIN_DEFAULT_USERNAME}@${webAddress}`,
|
||||||
username: `${process.env.ADMIN_DEFAULT_USERNAME}`,
|
username: `${process.env.ADMIN_DEFAULT_USERNAME}`,
|
||||||
hash: await bcrypt.hash(`${process.env.ADMIN_DEFAULT_PASSWORD}`, await bcrypt.genSalt(11)),
|
hash: await bcrypt.hash(`${process.env.ADMIN_DEFAULT_PASSWORD}`, await bcrypt.genSalt(11)),
|
||||||
type: 'normal',
|
type: 'normal',
|
||||||
@@ -34,6 +35,6 @@ module.exports = async () => {
|
|||||||
mod: true
|
mod: true
|
||||||
});
|
});
|
||||||
|
|
||||||
console.warn(`Created default admin account (email: ${process.env.ADMIN_DEFAULT_USERNAME}@${process.env.WEB_ADDRESS}; password: ${process.env.ADMIN_DEFAULT_PASSWORD})`);
|
console.warn(`Created default admin account (email: ${process.env.ADMIN_DEFAULT_USERNAME}@${webAddress}; password: ${process.env.ADMIN_DEFAULT_PASSWORD})`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user