Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Merge 61a5bee into 455f639
Browse files Browse the repository at this point in the history
  • Loading branch information
KvNGCzA committed Dec 11, 2018
2 parents 455f639 + 61a5bee commit eeb589e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"API_BASE_URL": {
"required": true
},
"API_BASE": {
"required": true
},
"CLOUDINARY_CLOUD_NAME": {
"required": true
},
Expand Down
6 changes: 4 additions & 2 deletions server/controllers/UsersController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Op } from 'sequelize';
import cloudinary from 'cloudinary';
import uniqueSlug from 'unique-slug';
import dotenv from 'dotenv';

import models from '../models';
import sendEmail from '../helpers/sendEmail';
Expand All @@ -14,6 +15,7 @@ import { createToken } from '../middlewares/tokenUtils';
import cloudinaryConfig from '../config/cloudinaryConfig';

cloudinary.config(cloudinaryConfig);
dotenv.config();

const { User } = models;

Expand Down Expand Up @@ -430,12 +432,12 @@ class UsersController {
};
user.token = createToken(id, '90d');
if (created) {
return res.status(201).json({
return res.status(201).redirect(process.env.API_BASE).json({
message: 'New account created successfully',
user
});
}
return res.status(200).json({
return res.status(200).redirect(process.env.API_BASE).json({
message: 'Log in successful',
user
});
Expand Down

0 comments on commit eeb589e

Please sign in to comment.