Skip to content

Commit

Permalink
Merge pull request #2 from minenwerfer/master
Browse files Browse the repository at this point in the history
refactor: strip unecessary conditionals
  • Loading branch information
SamCaliman authored Jul 30, 2024
2 parents a8ec86e + d5047dd commit 8d504dd
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions web/src/pages/OAuth.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
const {
VITE_GITHUB_CLIENT_ID,
VITE_GITHUB_URL,
Expand All @@ -13,7 +12,6 @@ const {
VITE_GOOGLE_SCOPE,
} = import.meta.env
// Redirect User to github OAuth page, passing the client id as an paramenter
async function githubAuth() {
const params = {
Expand All @@ -22,9 +20,7 @@ async function githubAuth() {
client_id: VITE_GITHUB_CLIENT_ID,
redirect_uri: VITE_GITHUB_REDIRECT_URI
}
if(VITE_GITHUB_CLIENT_ID){
window.open(`${VITE_GITHUB_URL}`+'?'+`${new URLSearchParams(params).toString()}`, '_self')
}
window.open(`${VITE_GITHUB_URL}`+'?'+`${new URLSearchParams(params).toString()}`, '_self')
}
async function twitchAuth() {
Expand All @@ -33,30 +29,26 @@ async function twitchAuth() {
client_id: VITE_TWITCH_CLIENT_ID,
redirect_uri: VITE_TWITCH_REDIRECT_URI,
}
if(VITE_TWITCH_CLIENT_ID){
window.open(`${VITE_TWITCH_URL}` + '?' + `${new URLSearchParams(params).toString()}`, '_self')
}
window.open(`${VITE_TWITCH_URL}` + '?' + `${new URLSearchParams(params).toString()}`, '_self')
}
async function googleAuth() {
const params = {
response_type: 'code',
client_id: VITE_GOOGLE_CLIENT_ID,
redirect_uri: VITE_GOOGLE_REDIRECT_URI,
scope:VITE_GOOGLE_SCOPE
}
if(VITE_GOOGLE_CLIENT_ID){
window.open(`${VITE_GOOGLE_URL}` + '?' + `${new URLSearchParams(params).toString()}`, '_self')
scope: VITE_GOOGLE_SCOPE
}
window.open(`${VITE_GOOGLE_URL}` + '?' + `${new URLSearchParams(params).toString()}`, '_self')
}
</script>

<template>
<section class="
tw-w-full
tw-h-[100vh]
tw-bg-neutral-800
tw-flex
tw-w-full
tw-h-[100vh]
tw-bg-neutral-800
tw-flex
">
<div
class="
Expand Down

0 comments on commit 8d504dd

Please sign in to comment.