This commit is contained in:
Shailaja Kumari 2024-02-15 20:35:54 +05:30
parent 6da23cb97d
commit f3a096e8c1
Signed by: shailaja
GPG Key ID: 81C942771BB69898

View File

@ -6,20 +6,8 @@
<title>Inoreader To Readwise</title> <title>Inoreader To Readwise</title>
</head> </head>
<body> <body>
<button onclick="redirectToOAuth()">Login using inoreader</button> <!-- <button onclick="redirectToOAuth()">Login using inoreader</button> -->
<a href="{{oauth_url}}">Login via InoReader</a>
<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 = `{{ auth_url }}?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> </body>
</html> </html>