This commit is contained in:
hexlocation 2025-06-08 21:13:32 +02:00
parent 57137a08d3
commit c5aa21b75e
6 changed files with 23 additions and 9 deletions

View file

@ -38,10 +38,13 @@ func RegisterAuthRoutes(cfg *types.StereoConfig, api *gin.RouterGroup) {
}
// TODO: redirect to dashboard
c.JSON(http.StatusOK, gin.H{
/*c.JSON(http.StatusOK, gin.H{
"jwt": jwt,
"known": res.RowsAffected == 0,
})
*/
c.SetCookie("jwt", jwt, int(t.ExpiresIn), "", cfg.Domain, true, true)
c.Redirect(http.StatusTemporaryRedirect, cfg.FrontendUri)
})
api.GET("/auth/me", auth.JwtMiddleware(cfg.JWTSecret), func(c *gin.Context) {

View file

@ -48,7 +48,6 @@ func RegisterFileRoutes(cfg *types.StereoConfig, api *gin.RouterGroup) {
fileMeta := types.File{
ID: uid + "_" + file.Filename,
Path: filePath,
Owner: uid,
CreatedAt: time.Now(),
Size: file.Size,