-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from KimangKhenng/features/Handle-SSO
Handle SSO
- Loading branch information
Showing
28 changed files
with
827 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Vercel Preview Deployment | ||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
jobs: | ||
Deploy-Preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Vercel CLI | ||
run: npm install --global vercel@latest | ||
- name: Pull Vercel Environment Information | ||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Build Project Artifacts | ||
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Deploy Project Artifacts to Vercel | ||
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Vercel Production Deployment | ||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
Deploy-Production: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Vercel CLI | ||
run: npm install --global vercel@latest | ||
- name: Pull Vercel Environment Information | ||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Build Project Artifacts | ||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Deploy Project Artifacts to Vercel | ||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<button | ||
class="flex items-center justify-center px-6 py-3 mt-4 bg-white text-gray-600 transition-colors duration-300 transform border rounded-lg dark:border-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600" | ||
@click="handleClick" | ||
> | ||
<img | ||
v-if="type === 'google'" | ||
class="w-6 h-6 mx-2" | ||
src="https://www.svgrepo.com/show/475656/google-color.svg" | ||
alt="" | ||
/> | ||
|
||
<img | ||
v-if="type === 'facebook'" | ||
class="w-6 h-6 mx-2" | ||
src="https://www.svgrepo.com/show/448224/facebook.svg" | ||
alt="" | ||
/> | ||
|
||
<img | ||
v-if="type === 'github'" | ||
class="w-6 h-6 mx-2" | ||
src="https://www.svgrepo.com/show/512317/github-142.svg" | ||
alt="" | ||
/> | ||
|
||
<span class="mx-2 capitalize">{{ $t("continue_with") }} {{ type }}</span> | ||
</button> | ||
</template> | ||
<script> | ||
export default { | ||
props: { | ||
type: { | ||
type: String, | ||
default: "google", | ||
}, | ||
}, | ||
methods: { | ||
handleClick() { | ||
if (this.type === "google") { | ||
this.$auth.loginWith("google", { | ||
params: { prompt: "select_account" }, | ||
}); | ||
} else { | ||
this.$auth.loginWith(this.type); | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<template> | ||
<div class="mt-6"> | ||
<div class="relative"> | ||
<div class="absolute inset-0 flex items-center"> | ||
<div class="w-full border-t border-gray-300"></div> | ||
</div> | ||
<div class="relative flex justify-center text-sm"> | ||
<span class="px-2 bg-gray-100 text-gray-500"> | ||
{{ $t("or_sign_in_with") }} | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="mt-6 grid grid-cols-3 gap-3"> | ||
<div> | ||
<button | ||
class="w-full flex items-center justify-center px-8 py-3 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" | ||
@click="facebookLogin" | ||
> | ||
<img | ||
class="h-6 w-6" | ||
src="https://www.svgrepo.com/show/448224/facebook.svg" | ||
alt="" | ||
/> | ||
</button> | ||
</div> | ||
<div> | ||
<button | ||
class="w-full flex items-center justify-center px-8 py-3 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" | ||
@click="githubLogin" | ||
> | ||
<img | ||
class="h-6 w-6" | ||
src="https://www.svgrepo.com/show/512317/github-142.svg" | ||
alt="" | ||
/> | ||
</button> | ||
</div> | ||
<div> | ||
<button | ||
class="w-full flex items-center justify-center px-8 py-3 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" | ||
@click="googleLogin" | ||
> | ||
<img | ||
class="h-6 w-6" | ||
src="https://www.svgrepo.com/show/475656/google-color.svg" | ||
alt="" | ||
/> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
import { mapMutations } from "vuex"; | ||
export default { | ||
methods: { | ||
...mapMutations({ | ||
setLoginType: "setting/SET_LOGIN_TYPE", | ||
}), | ||
googleLogin() { | ||
this.setLoginType("google"); | ||
this.$auth.loginWith("google", { | ||
params: { prompt: "select_account" }, | ||
}); | ||
}, | ||
githubLogin() { | ||
this.setLoginType("github"); | ||
this.$auth.loginWith("github"); | ||
}, | ||
facebookLogin() { | ||
this.setLoginType("facebook"); | ||
this.$auth.loginWith("facebook"); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<template> | ||
<ModalTemplate id="integration-info"> | ||
<template #content> | ||
<label | ||
for="integration-info" | ||
class="btn btn-sm btn-circle absolute right-2 top-2" | ||
>✕</label | ||
> | ||
<div class="flex space-x-4"> | ||
<img | ||
class="h-7 w-7" | ||
:src=" | ||
getCurrent.provider === 'GOOGLE' | ||
? 'https://www.svgrepo.com/show/475656/google-color.svg' | ||
: getCurrent.provider === 'FACEBOOK' | ||
? 'https://www.svgrepo.com/show/448224/facebook.svg' | ||
: 'https://www.svgrepo.com/show/512317/github-142.svg' | ||
" | ||
alt="" | ||
/> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="32" | ||
height="32" | ||
viewBox="0 0 48 48" | ||
> | ||
<title>app-store</title> | ||
<g> | ||
<rect | ||
x="3" | ||
y="3" | ||
width="17" | ||
height="17" | ||
rx="3" | ||
fill="#6cc4f5" | ||
></rect> | ||
<path | ||
d="M46.138,9.419,38.581,1.862a2.945,2.945,0,0,0-4.162,0L26.862,9.419a2.943,2.943,0,0,0,0,4.162l7.557,7.557a2.948,2.948,0,0,0,4.162,0l7.557-7.557a2.943,2.943,0,0,0,0-4.162Z" | ||
fill="#c456eb" | ||
></path> | ||
<rect | ||
x="28" | ||
y="28" | ||
width="17" | ||
height="17" | ||
rx="3" | ||
fill="#6cc4f5" | ||
></rect> | ||
<rect | ||
x="3" | ||
y="28" | ||
width="17" | ||
height="17" | ||
rx="3" | ||
fill="#6cc4f5" | ||
></rect> | ||
</g> | ||
</svg> | ||
<h3 class="text-lg font-bold"> | ||
{{ $t("integration") }} | ||
</h3> | ||
</div> | ||
<p class="py-4 leading-loose text-sm text-center"> | ||
{{ getCurrent.provider }} | ||
{{ $t("integration_description") }} | ||
</p> | ||
<p class="leading-loose text-sm text-center"> | ||
{{ $moment(getCurrent.createdDate).format("ll") }} | ||
</p> | ||
<div class="flex flex-row space-x-2 justify-center"> | ||
<label for="integration-info"> | ||
<ShadowButton text="acceptAll" color="bg-green-600" /> | ||
</label> | ||
</div> | ||
</template> | ||
</ModalTemplate> | ||
</template> | ||
<script> | ||
import ModalTemplate from "@/components/modals/modal-template.vue"; | ||
import ShadowButton from "@/components/buttons/shadow-button.vue"; | ||
import { mapGetters } from "vuex"; | ||
export default { | ||
components: { ShadowButton, ModalTemplate }, | ||
computed: { | ||
...mapGetters({ | ||
getCurrent: "integration/getCurrent", | ||
}), | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.