Add OAuth integration for multiple providers and implement user linking
Some checks failed
Deploy to production / deploy (push) Failing after 49s

- Created OAuth credentials setup guide for Google, Microsoft, Keycloak, ORY, and ZITADEL.
- Added migration for oauth_identity table to store OAuth identities linked to users.
- Implemented OAuthIdentity model for managing OAuth identities in the database.
- Developed oauthService to handle OAuth login, user creation, and identity linking.
- Created OAuthCallbackView and OAuthUserCallbackView components for handling OAuth responses in the frontend.
- Added error handling and user feedback during the OAuth process.
This commit is contained in:
Torsten Schulz (local)
2026-05-15 13:59:40 +02:00
parent 464208e30e
commit ac57931928
16 changed files with 7620 additions and 949 deletions

View File

@@ -0,0 +1,54 @@
import { sequelize } from '../../utils/sequelize.js';
import { DataTypes } from 'sequelize';
const OAuthIdentity = sequelize.define('oauth_identity', {
userId: {
type: DataTypes.INTEGER,
allowNull: false,
field: 'user_id'
},
provider: {
type: DataTypes.STRING(64),
allowNull: false
},
issuer: {
type: DataTypes.TEXT,
allowNull: false
},
subject: {
type: DataTypes.TEXT,
allowNull: false
},
email: {
type: DataTypes.TEXT,
allowNull: true
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
field: 'created_at',
defaultValue: DataTypes.NOW
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
field: 'updated_at',
defaultValue: DataTypes.NOW
}
}, {
tableName: 'oauth_identity',
schema: 'community',
underscored: true,
timestamps: false,
indexes: [
{
unique: true,
fields: ['provider', 'subject']
},
{
fields: ['user_id']
}
]
});
export default OAuthIdentity;