Skip to content

Commit

Permalink
Increase login for 1 year (thomiceli#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Apr 2, 2024
1 parent 915287d commit e1303c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/web/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/thomiceli/opengist/internal/utils"
"io"
"net/http"
"net/url"
"strings"

"github.com/labstack/echo/v4"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
Expand All @@ -22,9 +16,14 @@ import (
"github.com/rs/zerolog/log"
"github.com/thomiceli/opengist/internal/config"
"github.com/thomiceli/opengist/internal/db"
"github.com/thomiceli/opengist/internal/utils"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"gorm.io/gorm"
"io"
"net/http"
"net/url"
"strings"
)

const (
Expand Down Expand Up @@ -140,6 +139,7 @@ func processLogin(ctx echo.Context) error {
}

sess.Values["user"] = user.ID
sess.Options.MaxAge = 60 * 60 * 24 * 365 // 1 year
saveSession(sess, ctx)
deleteCsrfCookie(ctx)

Expand Down

0 comments on commit e1303c9

Please sign in to comment.