got the code
This commit is contained in:
parent
a5378f37fa
commit
6885fe7f0e
3 changed files with 20 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
||||||
<meta name="description" content="Change the fucking channel already!">
|
<meta name="description" content="Change the fucking channel already!">
|
||||||
|
|
||||||
<title>The Fediverse</title>
|
<title>The Fediverse</title>
|
||||||
|
<script type="module" src="../JS/mail.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="margin: 0px; text-align: center;">
|
<body style="margin: 0px; text-align: center;">
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
<h1>Mail</h1>
|
<h1>Mail</h1>
|
||||||
</header>
|
</header>
|
||||||
<p>Just go back. It ain't ready yet...</p>
|
<p>Just go back. It ain't ready yet...</p>
|
||||||
|
<p class="Login">Login</p>
|
||||||
<p onclick="history.back()"><b>OK</b></p>
|
<p onclick="history.back()"><b>OK</b></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
export const Scopes = "read write follow push";
|
||||||
|
|
||||||
export async function GetPublicTimeline(Local = false, Remote = false) {
|
export async function GetPublicTimeline(Local = false, Remote = false) {
|
||||||
let Timeline;
|
let Timeline;
|
||||||
if (Local == true && Remote == true) {
|
if (Local == true && Remote == true) {
|
||||||
|
|
16
JS/mail.js
Normal file
16
JS/mail.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import * as ActivityPub from "./ActivityPub.js";
|
||||||
|
|
||||||
|
let LoginButton = document.getElementsByClassName("Login")[0];
|
||||||
|
|
||||||
|
LoginButton.onclick = (event) => {
|
||||||
|
HandleLogin();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function HandleLogin() {
|
||||||
|
let Origin = window.location.origin + "/HTML/mail";
|
||||||
|
let InstanceData = await fetch("https://wetdry.world/api/v1/apps?client_name=Channel Viewer&redirect_uris=" + Origin + "&scopes=" + ActivityPub.Scopes, {method: "POST"})
|
||||||
|
.then((response) => response.json());
|
||||||
|
let InstanceInfo = await fetch("https://wetdry.world/api/v1/instance", {method: "GET"})
|
||||||
|
.then((response) => response.json());
|
||||||
|
document.location.href = "https://wetdry.world/oauth/authorize?client_id=" + InstanceData.client_id + "&redirect_uri=" + Origin + "&response_type=code&scope=" + ActivityPub.Scopes;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue