Skip to content

Commit

Permalink
feat: customauth vue app
Browse files Browse the repository at this point in the history
  • Loading branch information
guru-web3 committed Feb 3, 2025
1 parent ec71a75 commit 8cbd7e7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
16 changes: 8 additions & 8 deletions examples/vue-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions examples/vue-app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ import {
REDDIT,
sapphireDevnetVerifierMap,
sapphireDevnetVerifierOptions,
TELEGRAM,
testnetVerifierMap,
testnetVerifierOptions,
TWITTER,
Expand Down Expand Up @@ -289,6 +290,11 @@ const loginToConnectionMap = computed((): Record<string, Record<string, string |
[LINE]: { domain: AUTH_DOMAIN },
[COGNITO]: { domain: COGNITO_AUTH_DOMAIN, identity_provider: "Google", response_type: "token", user_info_endpoint: "userInfo" },
[REDDIT]: { domain: AUTH_DOMAIN, connection: "Reddit", verifierIdField: "name", isVerifierIdCaseSensitive: false },
[TELEGRAM]: {
identity_provider: "Telegram",
domain: "https://oauth.tg.dev/auth",
origin: "https://custom-auth-beta.vercel.app/serviceworker/redirect",
},
[WEB3AUTH_EMAIL_PASSWORDLESS]: {
login_hint,
},
Expand Down Expand Up @@ -378,20 +384,14 @@ const onLogin = async () => {
privKeyInfo = data?.finalKeyData;
localUserInfo = data?.userInfo;
} else {
const data = await customAuthSdk.value.triggerAggregateLogin({
aggregateVerifierType: "single_id_verifier",
subVerifierDetailsArray: [
{
clientId,
typeOfLogin,
verifier: "web3auth",
jwtParams,
},
],
verifierIdentifier: verifier,
const data = await customAuthSdk.value?.triggerLogin({
typeOfLogin,
verifier,
clientId,
jwtParams,
});
privKeyInfo = data?.finalKeyData;
localUserInfo = data?.userInfo[0];
localUserInfo = data?.userInfo;
}
if (privKeyInfo) {
Expand Down
15 changes: 14 additions & 1 deletion examples/vue-app/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SafeEventEmitterProvider } from "@web3auth/base";
export const GOOGLE = "google";
export const FACEBOOK = "facebook";
export const REDDIT = "reddit";
export const TELEGRAM = "telegram";
export const DISCORD = "discord";
export const TWITCH = "twitch";
export const GITHUB = "github";
Expand All @@ -26,7 +27,7 @@ export const WEB3AUTH_EMAIL_PASSWORDLESS = "email_passwordless";
export const WEB3AUTH_SMS_PASSWORDLESS = "sms_passwordless";
export const LOCAL_NETWORK = "network";
export const uxModeOptions = Object.values(UX_MODE).map((x) => ({ name: x, value: x }));
export const WEB3AUTH_CLIENT_ID = "BJ6l3_kIQiy6YVL7zDlCcEAvGpGukwFgp-C_0WvNI_fAEeIaoVRLDrV5OjtbZr_zJxbyXFsXMT-yhQiUNYvZWpo";
export const WEB3AUTH_CLIENT_ID = "BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ";

export interface LoginProviderItem {
name: string;
Expand All @@ -42,6 +43,12 @@ export const testnetVerifierMap = {
clientId: "221898609709-obfn3p63741l5333093430j3qeiinaa8.apps.googleusercontent.com",
verifier: "google-lrc",
},
[TELEGRAM]: {
name: "Telegram",
typeOfLogin: "telegram",
clientId: "7696397063",
verifier: "test-telegram-4",
},
[FACEBOOK]: { name: "Facebook", typeOfLogin: "facebook", clientId: "617201755556395", verifier: "facebook-lrc" },
[REDDIT]: { name: "Reddit", typeOfLogin: "jwt", clientId: "RKlRuuRoDKOItbJSoOZabDLzizvd1uKn", verifier: "torus-reddit-test" },
[TWITCH]: { name: "Twitch", typeOfLogin: "twitch", clientId: "f5and8beke76mzutmics0zu4gw10dj", verifier: "twitch-lrc" },
Expand Down Expand Up @@ -93,6 +100,12 @@ export const sapphireDevnetVerifierMap = {
clientId: "221898609709-qnfklddleh1m1m7bq6g8d8dakffp0n86.apps.googleusercontent.com",
verifier: "web3auth-google-sapphire-devnet",
},
[TELEGRAM]: {
name: "Telegram",
typeOfLogin: "telegram",
clientId: "7696397063",
verifier: "test-telegram-4",
},
[FACEBOOK]: { name: "Facebook", typeOfLogin: "facebook", clientId: "226597929760394", verifier: "web3auth-facebook-sapphire-devnet" },
[REDDIT]: { name: "Reddit", typeOfLogin: "jwt", clientId: "XfiFWQbsZ9t5WQ4TfzHWZOpEghkNskko", verifier: "web3auth-auth0-reddit-sapphire-devnet" },
[TWITCH]: { name: "Twitch", typeOfLogin: "twitch", clientId: "94nxxpy7inarina6kc9hyg2ao3mja2", verifier: "web3auth-twitch-sapphire-devnet" },
Expand Down

0 comments on commit 8cbd7e7

Please sign in to comment.