Compare commits

...

3 Commits

Author SHA1 Message Date
Patrick Cleavelin 17ec2185d0 add link to old UI for moderators to access un-ported features
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
2023-08-01 00:12:01 -05:00
Patrick Cleavelin 25bb24694c redirect correctly on login, and save cookie to proper path 2023-08-01 00:09:22 -05:00
Patrick Cleavelin 83a0eadf6d TESTING
ci/woodpecker/tag/woodpecker Pipeline was successful Details
2023-07-31 23:44:03 -05:00
3 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
tag = "v0.1.4_4-alpha"; tag = "super_test";
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;

View File

@ -129,7 +129,7 @@ pub(crate) async fn guild_dashboard(
b.attribute("class", "container") b.attribute("class", "container")
.builder(Tag::Article, |b| { .builder(Tag::Article, |b| {
b.builder_text(Tag::Header, "Wow, you're a moderator") b.builder_text(Tag::Header, "Wow, you're a moderator")
.push_builder(moderator_dashboard()) .push_builder(moderator_dashboard(&state))
.builder_text(Tag::Footer, "End of super cool mod section") .builder_text(Tag::Footer, "End of super cool mod section")
}) })
}) })
@ -198,8 +198,8 @@ pub(crate) async fn guild_dashboard(
)) ))
} }
fn moderator_dashboard() -> HtmxBuilder { fn moderator_dashboard(state: &ApiState) -> HtmxBuilder {
HtmxBuilder::new(Tag::Empty) HtmxBuilder::new(Tag::Empty).link("Go back to old UI", &format!("{}/old", state.origin))
} }
pub(crate) async fn login(State(state): State<ApiState>) -> Html<String> { pub(crate) async fn login(State(state): State<ApiState>) -> Html<String> {

View File

@ -222,10 +222,10 @@ pub(crate) async fn v2_auth(
// TODO: add permissions based on roles // TODO: add permissions based on roles
let mut cookie = Cookie::new("access_token", token.clone()); let mut cookie = Cookie::new("access_token", token.clone());
cookie.set_path("/"); cookie.set_path(format!("{}/", state.origin));
cookie.set_secure(true); cookie.set_secure(true);
Ok((jar.add(cookie), Redirect::to("/"))) Ok((jar.add(cookie), Redirect::to(&format!("{}/", state.origin))))
} }
pub(crate) async fn auth( pub(crate) async fn auth(