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