Skip to content

Commit 09105b7

Browse files
committed
fix user does not have github handle
1 parent 0e7c98c commit 09105b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/models/Oauth-model.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ interface UserDocument extends Document {
88

99
const userSchema = new mongoose.Schema<UserDocument>({
1010
username: { type: String },
11-
githubId: { type: String, unique: true },
12-
googleId: { type: String, unique: true }
11+
githubId: { type: String }, // removed unique constraint because you can have null values.
12+
googleId: { type: String } // unique:true
1313
});
1414

1515
const User = mongoose.model<UserDocument>('OauthUsers', userSchema);
1616

17-
1817
export default User;

0 commit comments

Comments
 (0)