[WEB-5657] feat: add synchronization configuration for multiple providers in authentication adapter (#8336)
* feat: add sync functionality for OAuth providers - Implemented `check_sync_enabled` method to verify if sync is enabled for Google, GitHub, GitLab, and Gitea. - Added `sync_user_data` method to update user details, including first name, last name, display name, and avatar. - Updated configuration variables to include sync options for each provider. - Integrated sync check into the login/signup process. * feat: add sync toggle for OAuth providers in configuration forms * fix: remove default value for sync options in OAuth configuration forms * chore: delete old avatar and upload a new one * chore: update class method * chore: add email nullable * refactor: streamline sync check for multiple providers and improve avatar deletion logic * fix: ensure ENABLE_SYNC configurations default to "0" for Gitea, Github, Gitlab, and Google forms * fix: simplify toggle switch value handling in ControllerSwitch component --------- Co-authored-by: b-saikrishnakanth <bsaikrishnakanth97@gmail.com>
This commit is contained in:
parent
4908211fe6
commit
c2ce21e56c
10 changed files with 278 additions and 73 deletions
|
|
@ -172,6 +172,16 @@ class User(AbstractBaseUser, PermissionsMixin):
|
|||
|
||||
super(User, self).save(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def get_display_name(cls, email):
|
||||
if not email:
|
||||
return "".join(random.choice(string.ascii_letters) for _ in range(6))
|
||||
return (
|
||||
email.split("@")[0]
|
||||
if len(email.split("@")) == 2
|
||||
else "".join(random.choice(string.ascii_letters) for _ in range(6))
|
||||
)
|
||||
|
||||
|
||||
class Profile(TimeAuditModel):
|
||||
SUNDAY = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue