5
justfile
5
justfile
@@ -15,9 +15,8 @@ install:
|
||||
cd {{ client_dir }} && {{ bun_cmd }} install
|
||||
|
||||
clean:
|
||||
rm -rf {{ output_dir }}
|
||||
mkdir -p {{ output_dir }}
|
||||
cp {{ join(project_dir, "config.default.yaml") }} {{ join(output_dir, "config.yaml") }}
|
||||
mkdir -p .outputs
|
||||
find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} +
|
||||
|
||||
client:
|
||||
cd {{ client_dir }} && {{ bun_cmd }} dev
|
||||
|
||||
@@ -18,18 +18,12 @@ func JWTAuth(required bool) gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
if required == true {
|
||||
if required == true && uid == "" {
|
||||
c.JSON(401, gin.H{"status": "unauthorized"})
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
if uid == "" {
|
||||
c.Set("user_id", "")
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
|
||||
c.Set("user_id", uid)
|
||||
c.Next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user