inoreader2readwise/app/templates/index.html
2024-01-24 16:59:35 +05:30

26 lines
925 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Frontend</title>
</head>
<body>
<button onclick="redirectToOAuth()">Click Me</button>
<script>
function redirectToOAuth() {
// Encode URL components using Jinja filters
var encodedRedirectUri = encodeURIComponent('{{ redirect_uri }}');
var encodedOptionalScopes = encodeURIComponent('{{ optional_scopes }}');
// Construct the URL using Jinja variables
var oauthUrl = `https://www.inoreader.com/oauth2/auth?client_id={{ client_id }}&redirect_uri=${encodedRedirectUri}&response_type=code&scope=${encodedOptionalScopes}&state={{ csrf_protection_string }}`;
// Redirect to the constructed URL
window.location.href = oauthUrl;
}
</script>
</body>
</html>