Skip to content

Commit

Permalink
Update testing grounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-A-Normal-Robot committed May 18, 2024
1 parent 7269e0a commit a6c0eba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions js/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createClient } from 'https://cdn.jsdelivr.net/npm/@supabase/supabase-js
export const SUPABASE_URL = "https://fohgyexhzptaxjqrrrfd.supabase.co";
export const SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZvaGd5ZXhoenB0YXhqcXJycmZkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDUwMjQxNTcsImV4cCI6MjAyMDYwMDE1N30.fa7XvwiBbWSe2MLIR6Wkh_OC95uV7UXxt7_25PlyAlc"
export const SUPABASE = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
window.SUPABASE = SUPABASE;

/**
* @typedef {Object} User
Expand Down
17 changes: 13 additions & 4 deletions testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@

<button id="login">Test button</button>

<script src="https://cdn.jsdelivr.net/npm/@supabase/[email protected]/dist/umd/supabase.min.js"></script>
<script type="module">
import { SUPABASE_URL, SUPABASE_ANON_KEY } from '/js/db.js';
window.supabaseInstance = supabase.createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
<script>
import { SUPABASE } from '/js/db.js';

SUPABASE.auth.getUser().then(console.log).catch(console.error); // DEBUG

document.getElementById("login").addEventListener("click", async () =>
await SUPABASE.auth.signInWithOAuth({
provider: "discord",
options: {
redirectTo: "https://techmino-hub.github.io/auth/discord_callback.html"
}
})
);
</script>
</body>
</html>

0 comments on commit a6c0eba

Please sign in to comment.