forked from PeterSurda/inoreader2readwise
all template files(home,login)
This commit is contained in:
parent
754cc950b9
commit
0c69354aca
28
templates/home.html
Normal file
28
templates/home.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!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>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Logged In as {{ user_login }} - {{ user_email }}</h1>
|
||||
|
||||
<!-- show last synced and next synced time -->
|
||||
<p>Last Synced: {{ last_synced }}</p>
|
||||
<p>Next Sync: {{ next_sync }}</p>
|
||||
<br>
|
||||
|
||||
<!-- Take readiwse api key input -->
|
||||
<form action="/readwise" method="POST">
|
||||
<label for="api_key">Readwise API Key</label>
|
||||
<input type="text" name="readwise_api_key" id="api_key", value="{{ readwise_api_key }}" required>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
<!-- Logout -->
|
||||
<form action="/logout" method="POST">
|
||||
<input type="submit" value="Logout">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
25
templates/login.html
Normal file
25
templates/login.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!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>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="redirectToOAuth()">Login using inoreader</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 = `{{ 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>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user