Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# techfolio

// grading PR - DO NOT MERGE

Project: TechFolio App

Code Fellows 401d Final Project
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/about/about.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@

/* delete me */
1 change: 1 addition & 0 deletions app/src/components/blog/blog.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* put me out of my misery, I feel so empty... */
1 change: 1 addition & 0 deletions app/src/components/user-dash/user-dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function controller($auth, window, tokenService, ngDialog, $state, githubService
});
};

// nice use of integrating ngDialog...
this.personalForm = () => {
ngDialog.open({
template: '<personal-info success="success"></personal-info>',
Expand Down
1 change: 1 addition & 0 deletions app/src/components/welcome/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function controller($auth, linkedinService){
};

this.getLinkedIn = () => {
// but nothing hapens here...
linkedinService.get();
};
}
2 changes: 1 addition & 1 deletion app/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function routes($stateProvider, $urlRouterProvider) {

$stateProvider.state({
name: 'userProfiles',
url: '/user/:userUrl',
url: '/users/:userUrl',
resolve: {
userUrl: ['$transition$', t => t.params().userUrl],
profile: ['userService', 'userUrl', (userService, userUrl) => {
Expand Down
3 changes: 2 additions & 1 deletion server/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ app.use((req, res, next) => {

app.use(express.static('./public'));

// No authentication enforcement???
app.use('/github', github);
app.use('/linkedin', linkedin);
app.use('/user', user);
app.use('/users', user);
app.use('/auth', auth);
app.use('/admin', admin);
app.use(errorHandler);
Expand Down
15 changes: 8 additions & 7 deletions server/lib/routes/auth-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ensureLogin = require('../auth/ensure-login')();
const ensureToken = require('../auth/ensure-token')();

router

.get('/', ensureToken, (req, res, next) => {
User.findById(req.user.id)
.select('-ghaccess -liAccess -_id -password')
Expand Down Expand Up @@ -71,20 +71,21 @@ router
User.findById(req.user.id)
.then(user => {
if(user.personalInfo) {
PersonalInfo.findByIdAndUpdate(user.personalInfo, req.body)
.then(() => res.send(user));
return PersonalInfo
.findByIdAndUpdate(user.personalInfo, req.body)
.then(() => user);
} else {
new PersonalInfo(req.body)
return new PersonalInfo(req.body)
.save()
.then(profile => {
user.personalInfo = profile._id;
return user.save();
})
.then(user => {
res.send(user);
});
}
})
.then(user => {
res.send(user);
})
.catch(err => next(err));
});

Expand Down
1 change: 0 additions & 1 deletion server/lib/routes/oauth/github-oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ router
let userToken = req.headers.authorization;
accessToken = qs.parse(accessToken);

//Token hack until we can pass token through headers in Satellizer
token.verify(userToken)
.then(({id}) => User.findById(id) )
.then(user => {
Expand Down
2 changes: 1 addition & 1 deletion server/lib/routes/user-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const User = require('../models/user');
router
.get('/:userUrl', bodyParser, (req, res, next) => {
User.findOne({userUrl: req.params.userUrl})
.select('-ghaccess -liAccess -_id -password')
.select('-ghaccess -liAccess -_id -password') //nice!
.populate({path:'github'})
.populate({path:'linkedIn'})
.then(user => {
Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"start": "node server.js",
"pretest": "eslint .",
"test": "MONGODB_URI=mongodb://localhost/gallery-test mocha"
"//": "since you're using dotenv, don't have both ways:",
"test": "mocha"
},
"repository": {
"type": "git",
Expand Down