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, component: ErrorView,
}, },
{ {
path: "/error/:type", path: "/offline",
name: "error", name: "offline",
meta: { meta: {
noauth: true, noauth: true,
}, },

Wyświetl plik

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

12
user.go
Wyświetl plik

@ -4,7 +4,6 @@ import (
"context" "context"
"fmt" "fmt"
"net/http" "net/http"
"net/url"
"time" "time"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
@ -110,16 +109,7 @@ func redirectUserHandler(c echo.Context) error {
} }
} }
query := make(url.Values) return c.Redirect(http.StatusFound, "/offline")
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())
} }
func (a *AudonUser) Equal(u *AudonUser) bool { func (a *AudonUser) Equal(u *AudonUser) bool {