Skip to content

Commit

Permalink
cool! enforcing user must be confirmed to accept invites. we should d…
Browse files Browse the repository at this point in the history
…o this on the client too, obvis. that was the last todo in the server. bugs aside, it should be complete now. oh what a day! WHAT A LOVELY DAY!
  • Loading branch information
orthecreedence committed Apr 1, 2017
1 parent 83107a6 commit 5ad9d58
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
- disable sharing unless confirmed

1 change: 1 addition & 0 deletions models/invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ exports.accept = function(user_id, space_id, invite_id) {
return user_model.get_by_id(user_id)
.then(function(user) {
if(user.username != invite.to_user) throw error.forbidden('that invite wasn\'t sent to your email ('+user.username+')');
if(!user.confirmed) throw error.forbidden('you must confirm your account to accept an invite');
return space_model.user_is_in_space(user_id, space_id);
})
.then(function(spaceuser) {
Expand Down

0 comments on commit 5ad9d58

Please sign in to comment.