remove error from url

peertube v0.3.0
Namekuji 2023-01-29 23:12:07 -05:00
rodzic 150ad6df05
commit fec8e75a74
3 zmienionych plików z 4 dodań i 17 usunięć

Wyświetl plik

@ -15,8 +15,8 @@ const router = createRouter({
component: ErrorView,
},
{
path: "/error/:type",
name: "error",
path: "/offline",
name: "offline",
meta: {
noauth: true,
},

Wyświetl plik

@ -6,10 +6,7 @@ export default {
};
},
created() {
const type = this.$route.params.type;
if (!type) return;
if (type === "offline") {
if (this.name === "offline") {
alert(this.$t("errors.offline"));
this.$router.push({ name: "home" });
}

12
user.go
Wyświetl plik

@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"net/url"
"time"
"github.com/labstack/echo/v4"
@ -110,16 +109,7 @@ func redirectUserHandler(c echo.Context) error {
}
}
query := make(url.Values)
query.Add("url", user.RemoteURL)
result := url.URL{
Path: "/error/offline",
ForceQuery: true,
OmitHost: true,
RawQuery: query.Encode(),
}
return c.Redirect(http.StatusFound, result.String())
return c.Redirect(http.StatusFound, "/offline")
}
func (a *AudonUser) Equal(u *AudonUser) bool {