diff --git a/apiserver/plane/authentication/utils/redirection_path.py b/apiserver/plane/authentication/utils/redirection_path.py index 12de25cc2..62cc1f019 100644 --- a/apiserver/plane/authentication/utils/redirection_path.py +++ b/apiserver/plane/authentication/utils/redirection_path.py @@ -3,7 +3,7 @@ from plane.db.models import Profile, Workspace, WorkspaceMemberInvite def get_redirection_path(user): # Handle redirections - profile = Profile.objects.get(user=user) + profile, _ = Profile.objects.get_or_create(user=user) # Redirect to onboarding if the user is not onboarded yet if not profile.is_onboarded: diff --git a/apiserver/plane/authentication/views/app/magic.py b/apiserver/plane/authentication/views/app/magic.py index 8b2d1accd..12f8a0c0b 100644 --- a/apiserver/plane/authentication/views/app/magic.py +++ b/apiserver/plane/authentication/views/app/magic.py @@ -120,7 +120,7 @@ class MagicSignInEndpoint(View): callback=post_user_auth_workflow, ) user = provider.authenticate() - profile = Profile.objects.get(user=user) + profile, _ = Profile.objects.get_or_create(user=user) # Login the user and record his device info user_login(request=request, user=user, is_app=True) if user.is_password_autoset and profile.is_onboarded: