dc-popup-auth

1.0.8 • Public • Published

dc-popup-auth

dc-popup-auth is a simple and useful Discord Vuejs plugin.

ss

Discord Setup:

Developer Console Link: discord.com/developers/applications/you-bot-id/oauth2/general

Screen Shot

Main File:

import { createApp } from 'vue'
import App from './App.vue'

import discord from 'dc-popup-auth'
import router from './router'

const app = createApp(App)

app.use(discord, {
    key: 'Your Discord Bot Secret Key',
    id: 'Your Discord Bot Application ID',
    router
})
app.use(router)
app.mount('#app')

Vue Template:

<template>

    <section >
        <login-button v-if="!user" :callback="callback" title="Login" />
        <div v-else >
            <logout-button title="Logout" @click="logout" />
            <span> {{ user.username }} </span>
        </div>
    </section>
    
</template>

Script:

<script setup>
    import { ref } from 'vue'

    const user = ref(null)

    const callback = (data) => {
        console.log(data)
        user.value = data
    }

    const logout = () => {
        user.value = null
    }

</script>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.81latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.81
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.11
1.0.00

Package Sidebar

Install

npm i dc-popup-auth

Weekly Downloads

2

Version

1.0.8

License

ISC

Unpacked Size

7.62 kB

Total Files

9

Last publish

Collaborators

  • gosmac