Skip to content

Commit 20055d3

Browse files
author
Visnu Pitiyanuvath
committed
login via github is ok before registering a team
1 parent 63254d7 commit 20055d3

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

models/person.coffee

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PersonSchema.plugin auth,
3939
appSecret: env.secrets.github
4040
findOrCreateUser: (sess, accessTok, accessTokExtra, ghUser) ->
4141
promise = @Promise()
42-
Person.findOne 'github.id': ghUser.id, role: 'contestant',
42+
Person.findOne 'github.id': ghUser.id,
4343
(err, foundUser) ->
4444
if foundUser
4545
foundUser.updateWithGithub ghUser, accessTok, (err, updatedUser) ->
@@ -54,7 +54,9 @@ PersonSchema.plugin auth,
5454
return promise.fail err if err
5555
promise.fulfill createdUser
5656
else
57-
promise.fulfill id: null
57+
Person.createWithGithub ghUser, accessTok, (err, createdUser) ->
58+
return promise.fail err if err
59+
promise.fulfill createdUser
5860
promise
5961
twitter:
6062
everyauth:

views/errors/401.jade

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ h1= title('Unauthorized (401)')
22
:markdown
33
You're not authorized to do whatever it is you were doing.
44

5-
**If you were trying to [register a team][register], don't sign in first.**
6-
75
**If you were trying to add yourself to a team, make sure you follow the link
86
that you received in your invite email.**
97

views/layout.jade

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ html
2525
| |
2626
a( href='/logout' ) Sign out
2727
- else
28-
// a.button( href='#', disabled=true ) Registration open soon
2928
a.button( href='/login' ) Sign in
3029

3130
h3 Important dates

0 commit comments

Comments
 (0)