mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-08-13 09:02:22 +00:00
Yay!
This commit is contained in:
parent
832513a7fc
commit
519ccda5ed
@ -79,7 +79,6 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
|
|||||||
|
|
||||||
@client.get(prefix)
|
@client.get(prefix)
|
||||||
def ClientIndex():
|
def ClientIndex():
|
||||||
print(wireguardConfigurations.keys())
|
|
||||||
return render_template('client.html')
|
return render_template('client.html')
|
||||||
|
|
||||||
@client.get(f'{prefix}/api/validateAuthentication')
|
@client.get(f'{prefix}/api/validateAuthentication')
|
||||||
|
@ -20,7 +20,7 @@ const signIn = async (e) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await axios.post(requestURl("/client/api/signin"), formData).then(res => {
|
await axios.post(requestURl("/api/signin"), formData).then(res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (!data.status){
|
if (!data.status){
|
||||||
store.newNotification(data.message, "danger")
|
store.newNotification(data.message, "danger")
|
||||||
|
@ -25,7 +25,7 @@ const formFilled = computed(() => {
|
|||||||
const store = clientStore()
|
const store = clientStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
await axios.get(requestURl('/client/api/signin/totp'), {
|
await axios.get(requestURl('/api/signin/totp'), {
|
||||||
params: {
|
params: {
|
||||||
Token: props.totpToken
|
Token: props.totpToken
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ const verify = async (e) => {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (formFilled){
|
if (formFilled){
|
||||||
loading.value = true
|
loading.value = true
|
||||||
await axios.post(requestURl('/client/api/signin/totp'), {
|
await axios.post(requestURl('/api/signin/totp'), {
|
||||||
Token: props.totpToken,
|
Token: props.totpToken,
|
||||||
UserProvidedTOTP: formData.TOTP
|
UserProvidedTOTP: formData.TOTP
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -32,7 +32,7 @@ const router = createRouter({
|
|||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
if (to.meta.auth){
|
if (to.meta.auth){
|
||||||
await axios.get(requestURl('/client/api/validateAuthentication')).then(res => {
|
await axios.get(requestURl('/api/validateAuthentication')).then(res => {
|
||||||
next()
|
next()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
const store = clientStore()
|
const store = clientStore()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export const requestURl = (url) => {
|
export const requestURl = (url) => {
|
||||||
return import.meta.env.MODE === 'development' ? url
|
return import.meta.env.MODE === 'development' ? '/client' + url
|
||||||
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
|
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const signUp = async (e) => {
|
|||||||
}
|
}
|
||||||
if (validatePassword){
|
if (validatePassword){
|
||||||
loading.value = true
|
loading.value = true
|
||||||
await axios.post(requestURl('/client/api/signup'), formData).then((res) => {
|
await axios.post(requestURl('/api/signup'), formData).then((res) => {
|
||||||
let data = res.data
|
let data = res.data
|
||||||
if (!data.status){
|
if (!data.status){
|
||||||
store.newNotification(data.message, "danger")
|
store.newNotification(data.message, "danger")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user