```
request.url.split("/").slice(0...-1).join("/")
```
is too complex.

I suggest below code alternatively.
```
request.url.sub(/\/auth$/, "")
```