mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-02 14:09:26 +02:00
fix: auto redirect to home page when 401 (#3131)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
>
|
||||
{% block page %}
|
||||
<div class="text-center q-pa-md flex flex-center">
|
||||
<div>
|
||||
<div v-if="statusCode">
|
||||
<div class="error-code" v-text="statusCode"></div>
|
||||
|
||||
<div class="error-message" v-text="message"></div>
|
||||
@@ -88,8 +88,15 @@
|
||||
},
|
||||
created() {
|
||||
this.err = '{{ err }}'
|
||||
this.statusCode = '{{ status_code }}' || 404
|
||||
const statusCode = '{{ status_code }}' || 404
|
||||
this.message = String({{ message | tojson }}) || 'Page not found'
|
||||
if (statusCode == 401) {
|
||||
console.warn(`Unauthorized: ${this.message}`)
|
||||
this.goHome()
|
||||
return
|
||||
}
|
||||
this.statusCode = statusCode
|
||||
|
||||
if (this.isExtension) {
|
||||
this.extension = this.message.match(/'([^']+)'/)[1]
|
||||
}
|
||||
|
Reference in New Issue
Block a user