How to return value from backend?

the function returns boolean value. But I can not get this value from login page .
You can see the return keyword.

This is my jsw file content:

import wixData from ‘wix-data’;

export function login(email, password) {

let isSuccessful = false ;
wixData.query(“AccessRightToSite”)
.eq(“email”, email)
.eq(“password”, password)
.find()
.then((result) => {
if (result.items.length === 1)
{
console.log(“Yes”);
return true ;
}
else
{
console.log(“No”);
return false ;
}
});
}

This is my login page : If you look to response side below, I don’t know the reason but response is null or undefined

import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
import { login } from ‘backend/security’;
import { session } from ‘wix-storage’;

$w.onReady( function () {
//TODO: write your page related code here…
});

export function btnLogin_click(event) {
let email = $w(“#txtEmail”).value;
let password = $w(“#txtPassword”).value;

login(email, password) 
    .then((response) => { 
        console.log(response); 

if (response === true )
{
wixLocation.to(‘/homepage’);
session.setItem(“email”, email);
session.setItem(“password”, password);
console.log(session);
console.log(“successful”)
}
else
{
console.log(“warning”)
wixWindow.openLightbox(“WarningMessage”);
}
})
}