UAT account 0 creation

pull/4/head
Jose Vera 2022-03-02 22:37:16 -05:00
parent be79a029fe
commit bf2c901e64
2 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,19 @@ export async function getAccountFromEmail(email) {
return null;
}
export async function createBaseAccount() {
await orm.models.accounts.create({
id: 0,
email: 'dummy@retropilot.org',
password: '123123',
created: Date.now(),
last_ping: Date.now(),
email_verify_token: 'notokenplease',
});
return { success: true, status: 200 };
}
export async function _dirtyCreateAccount(email, password, created, admin) {
logger.log('creating acount: ', email, password, created, admin);
return orm.models.accounts.create({
@ -87,6 +100,7 @@ export async function getAllUsers() {
export default {
createAccount,
createBaseAccount,
verifyEmailToken,
getAccountFromId,
getAllUsers,

View File

@ -24,6 +24,12 @@ function runAsyncWrapper(callback) {
};
}
if(process.env.NODE_ENV === 'development') {
router.get('/useradmin/createbaseaccount', runAsyncWrapper(async (req, res) => {
res.send(await userController.createBaseAccount());
}));
}
router.post('/useradmin/auth', bodyParser.urlencoded({ extended: true }), runAsyncWrapper(async (req, res) => {
const signIn = await authenticationController.signIn(req.body.email, req.body.password);