fix: minor bugfixes in the authentication process

This commit is contained in:
Chneemann 2025-04-22 13:19:32 +02:00
parent 66bbb57548
commit 99098dd9cf
5 changed files with 8 additions and 9 deletions

View file

@ -75,7 +75,7 @@ class RegisterView(APIView):
message = EmailMultiAlternatives(
subject='Confirm your email',
body=strip_tags(html_body), # Plain text fallback
body=strip_tags(html_body),
from_email=settings.DEFAULT_FROM_EMAIL,
to=[user.email]
)
@ -153,7 +153,6 @@ class ChangePasswordView(APIView):
class AuthView(ObtainAuthToken):
authentication_classes = [authentication.TokenAuthentication]
permission_classes = [permissions.IsAuthenticated]
def get(self, request):
if request.user.is_authenticated:

View file

@ -68,7 +68,7 @@ export class ForgotPasswordComponent implements OnInit {
async verifyEmail() {
const body = {
email: this.authData.mail,
email: this.authData.mail.toLowerCase(),
};
try {
this.authData.send = true;
@ -84,7 +84,7 @@ export class ForgotPasswordComponent implements OnInit {
async changePassword() {
const body = {
email: this.authData.mail,
email: this.authData.mail.toLowerCase(),
token: this.authData.token,
new_password: this.authData.password,
};

View file

@ -40,12 +40,12 @@ export class LandingPageComponent {
async checkDuplicatesEmail() {
const body = {
email: this.authData.mail,
email: this.authData.mail.toLowerCase(),
};
try {
this.authData.send = true;
await this.authService.checkAuthUserMail(body);
const queryParams = { mail: this.authData.mail };
const queryParams = { mail: this.authData.mail.toLowerCase() };
this.router.navigate(['/register'], { queryParams });
this.errorService.clearError();
} catch (error) {

View file

@ -44,7 +44,7 @@ export class RegisterComponent implements OnInit {
async onSubmit(ngForm: NgForm) {
if (ngForm.submitted && ngForm.form.valid) {
const body = {
email: this.authData.mail,
email: this.authData.mail.toLowerCase(),
username: this.authData.mail.split('@')[0],
password: this.authData.password,
};

View file

@ -37,7 +37,7 @@ export class VerifyEmailComponent {
async verifyEmail() {
const body = {
email: this.authData.mail,
email: this.authData.mail.toLowerCase(),
token: this.authData.token,
};
try {