Hello !!
We can submit the attendance of the current user, as soon as the user login.
each activity stored a new record in the Activity log, so on successful login activity, we can trigger submit attendance.
if doc.operation == 'Login':
employee_name_for_auto_attandenace = doc.full_name
today_attendance_date = frappe.utils.today()
frappe.get_doc(dict(
doctype = 'Attendance',
employee_name = 'employee_name_for_auto_attandenace',
attendance_date = today_attendance_date
)).submit()
frappe.msgprint(msg=('Attendance for ' + doc.full_name + 'has been created'))