UAT account 0 creation
parent
be79a029fe
commit
bf2c901e64
|
@ -16,6 +16,19 @@ export async function getAccountFromEmail(email) {
|
||||||
return null;
|
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) {
|
export async function _dirtyCreateAccount(email, password, created, admin) {
|
||||||
logger.log('creating acount: ', email, password, created, admin);
|
logger.log('creating acount: ', email, password, created, admin);
|
||||||
return orm.models.accounts.create({
|
return orm.models.accounts.create({
|
||||||
|
@ -87,6 +100,7 @@ export async function getAllUsers() {
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
createAccount,
|
createAccount,
|
||||||
|
createBaseAccount,
|
||||||
verifyEmailToken,
|
verifyEmailToken,
|
||||||
getAccountFromId,
|
getAccountFromId,
|
||||||
getAllUsers,
|
getAllUsers,
|
||||||
|
|
|
@ -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) => {
|
router.post('/useradmin/auth', bodyParser.urlencoded({ extended: true }), runAsyncWrapper(async (req, res) => {
|
||||||
const signIn = await authenticationController.signIn(req.body.email, req.body.password);
|
const signIn = await authenticationController.signIn(req.body.email, req.body.password);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue