Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create.yml #1

Merged
merged 1 commit into from
Nov 1, 2024
Merged

Create.yml #1

merged 1 commit into from
Nov 1, 2024

Conversation

lovmyabhannah01
Copy link
Owner

<title>Device Authentication</title> <style> body { font-family: Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #f0f0f0; } .container { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } button { padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; } #result { margin-top: 20px; font-weight: bold; } </style>

Device Authentication

Authenticate Device
<script>
    function authenticateDevice() {
        const deviceInfo = "102,U:861211046513645,P:123456,Web:device.gpscx.net";
        const [type, udid, password, server] = deviceInfo.split(',');
        const deviceType = type;
        const deviceUDID = udid.split(':')[1];
        const devicePassword = password.split(':')[1];
        const serverAddress = server.split(':')[1];

        // Construct the authentication URL
        const authUrl = `http://${serverAddress}/api/authenticate`; // Assuming an /api/authenticate endpoint

        // Make the authentication request
        fetch(authUrl, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({
                type: deviceType,
                udid: deviceUDID,
                password: devicePassword
            })
        })
        .then(response => response.json())
        .then(data => {
            document.getElementById('result').textContent = 'Authentication successful: ' + JSON.stringify(data);
        })
        .catch(error => {
            document.getElementById('result').textContent = 'Authentication failed: ' + error.message;
        });
    }
</script>

@lovmyabhannah01 lovmyabhannah01 merged commit fa2fd84 into main Nov 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant