Skip to content

Commit cf72b76

Browse files
author
Rajat
committed
Removed id field
1 parent 96b8e7d commit cf72b76

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/web/models/SSOProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ import mongoose from "mongoose";
33
const SSOProviderSchema = new mongoose.Schema(
44
{
55
domain: { type: mongoose.Schema.Types.ObjectId, required: true },
6-
id: { type: String, unique: true, required: true },
6+
providerId: { type: String, required: true },
77
issuer: { type: String },
88
domain_string: { type: String },
99
oidcConfig: { type: String },
1010
samlConfig: { type: String },
1111
userId: { type: String },
12-
providerId: { type: String, required: true, unique: true },
1312
organizationId: { type: String },
1413
},
1514
{
1615
collection: "ssoProviders",
1716
},
1817
);
1918

19+
SSOProviderSchema.index({ domain: 1, providerId: 1 }, { unique: true });
20+
2021
export default mongoose.models.SSOProvider ||
2122
mongoose.model("SSOProvider", SSOProviderSchema);

0 commit comments

Comments
 (0)