MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / auth_login

Function auth_login

webapp_modern.py:4652–4679  ·  view source on GitHub ↗

Login with username and password.

()

Source from the content-addressed store, hash-verified

4650 m = re.search(
4651 r'_([0-9a-fA-F]{2})_([0-9a-fA-F]{2})_([0-9a-fA-F]{2})'
4652 r'_([0-9a-fA-F]{2})_([0-9a-fA-F]{2})_([0-9a-fA-F]{2})$', name)
4653 if m:
4654 bssid = ':'.join(m.group(i).lower() for i in range(1, 7))
4655 return name[:m.start()] or None, bssid, ext
4656
4657 return name, None, ext
4658
4659
4660def _read_gps_json_safe(filepath: str) -> Optional[dict]:
4661 """Read a Pwnagotchi .gps.json file. Returns dict with lat/lng or None."""
4662 try:
4663 with open(filepath, 'r', encoding='utf-8') as fh:
4664 data = json.load(fh)
4665 lat = data.get('Latitude') or data.get('latitude')
4666 lng = data.get('Longitude') or data.get('longitude')
4667 if lat is None or lng is None:
4668 return None
4669 lat, lng = float(lat), float(lng)
4670 if lat == 0.0 and lng == 0.0:
4671 return None
4672 return {
4673 'latitude': lat,
4674 'longitude': lng,
4675 'altitude': data.get('Altitude') or data.get('altitude'),
4676 'accuracy': data.get('Accuracy') or data.get('accuracy'),
4677 'updated': data.get('Updated') or data.get('updated'),
4678 }
4679 except (OSError, json.JSONDecodeError, ValueError, TypeError):
4680 return None
4681
4682

Callers

nothing calls this directly

Calls 6

_auth_client_ipFunction · 0.85
_auth_rate_limitedFunction · 0.85
_auth_clear_failuresFunction · 0.85
_auth_record_failureFunction · 0.85
loginMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected