inoreader2readwise/app/templates/login.html

27 lines
1.1 KiB
HTML
Raw Normal View History

2024-01-24 12:29:35 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inoreader To Readwise</title>
2024-01-24 12:29:35 +01:00
</head>
<body>
<button onclick="redirectToOAuth()">Login using inoreader</button>
2024-01-24 12:29:35 +01:00
<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
2024-01-30 06:25:52 +01:00
// var oauthUrl = `https://www.inoreader.com/oauth2/auth?client_id={{ client_id }}&redirect_uri=${encodedRedirectUri}&response_type=code&scope=${encodedOptionalScopes}&state={{ csrf_protection_string }}`;
var oauthUrl = `https://github.com/login/oauth/authorize?client_id={{ client_id }}&redirect_uri=${encodedRedirectUri}&response_type=code&scope=${encodedOptionalScopes}&state={{ csrf_protection_string }}`;
2024-01-24 12:29:35 +01:00
// Redirect to the constructed URL
window.location.href = oauthUrl;
}
</script>
</body>
</html>