♻️ Move throwing redirect exception into method
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / LoginPage.kt
index 9e47049..5be34ac 100644 (file)
@@ -23,7 +23,7 @@ class LoginPage @Inject constructor(webInterface: WebInterface, loaders: Loaders
                        soneRequest.core.getLocalSone(soneId)?.let { sone ->
                                setCurrentSone(soneRequest.toadletContext, sone)
                                val target = soneRequest.httpRequest.getParam("target").emptyToNull ?: "index.html"
                        soneRequest.core.getLocalSone(soneId)?.let { sone ->
                                setCurrentSone(soneRequest.toadletContext, sone)
                                val target = soneRequest.httpRequest.getParam("target").emptyToNull ?: "index.html"
-                               throw RedirectException(target)
+                               redirectTo(target)
                        }
                }
                templateContext["sones"] = soneRequest.core.localSones.sortedWith(Sone.NICE_NAME_COMPARATOR)
                        }
                }
                templateContext["sones"] = soneRequest.core.localSones.sortedWith(Sone.NICE_NAME_COMPARATOR)