rotur.dev/auth
If you are making a website that connects to rotur, your users will often trust it more if it uses the official way to login to rotur.
About
https://rotur.dev/auth is a pretty simple api, you just redirect your page to it and then the user decides the next course of action.
How do i get a rotur token using this?
Have a look at the example page here:
You can view the source of this page here:
https://github.com/RoturTW/rotur.dev/blob/main/example%20auth.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Token Checker</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
.container {
margin-top: 50px;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
button {
background-color: #4CAF50;
color: white;
padding: 12px 24px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
#token-display {
margin-top: 20px;
padding: 15px;
background-color: #f8f9fa;
border-radius: 4px;
word-break: break-all;
}
</style>
</head>
<body>
<div class="container" id="main-container">
<h1>Authentication Required</h1>
<p>Please click the button below to authenticate.</p>
<button id="auth-button">Authenticate</button>
</div>
<div class="container" id="token-container" style="display: none;">
<h1>Authentication Successful</h1>
<p>Your token:</p>
<div id="token-display"></div>
</div>
<script>
// Check for token parameter when page loads
window.onload = function() {
// Get URL parameters using URLSearchParams
const urlParams = new URLSearchParams(window.location.search);
const token = urlParams.get('token');
if (token) {
// If token exists, show the token display
document.getElementById('main-container').style.display = 'none';
document.getElementById('token-container').style.display = 'block';
document.getElementById('token-display').textContent = token;
// Remove token from URL by replacing current history state
window.history.replaceState({}, document.title, window.location.pathname);
} else {
// If no token, setup auth button
document.getElementById('auth-button').addEventListener('click', function() {
window.location.href = "https://rotur.dev/auth";
});
}
};
</script>
</body>
</html>
Last updated