feat: Move to passport for authentication (#1934)
- Added `accountProvisioner` - Move authentication to use passport strategies - Make authentication more pluggable - Change language of services -> providers closes #1120
This commit is contained in:
@ -10,6 +10,7 @@ import {
|
||||
} from "../../shared/utils/domains";
|
||||
import { ValidationError } from "../errors";
|
||||
import { DataTypes, sequelize, Op } from "../sequelize";
|
||||
import { generateAvatarUrl } from "../utils/avatars";
|
||||
import { publicS3Endpoint, uploadToS3FromUrl } from "../utils/s3";
|
||||
|
||||
import Collection from "./Collection";
|
||||
@ -66,7 +67,6 @@ const Team = sequelize.define(
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
slackData: DataTypes.JSONB,
|
||||
},
|
||||
{
|
||||
paranoid: true,
|
||||
@ -85,7 +85,11 @@ const Team = sequelize.define(
|
||||
},
|
||||
logoUrl() {
|
||||
return (
|
||||
this.avatarUrl || (this.slackData ? this.slackData.image_88 : null)
|
||||
this.avatarUrl ||
|
||||
generateAvatarUrl({
|
||||
id: this.id,
|
||||
name: this.name,
|
||||
})
|
||||
);
|
||||
},
|
||||
},
|
||||
@ -164,17 +168,10 @@ Team.prototype.provisionFirstCollection = async function (userId) {
|
||||
"Our Editor",
|
||||
"What is Outline",
|
||||
];
|
||||
|
||||
for (const title of onboardingDocs) {
|
||||
const text = await readFile(
|
||||
path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"..",
|
||||
"..",
|
||||
"server",
|
||||
"onboarding",
|
||||
`${title}.md`
|
||||
),
|
||||
path.join(process.cwd(), "server", "onboarding", `${title}.md`),
|
||||
"utf8"
|
||||
);
|
||||
const document = await Document.create({
|
||||
|
Reference in New Issue
Block a user