chore: move auth to apiv1

This commit is contained in:
Steven 2023-07-10 21:40:55 +08:00
parent 05bc21b660
commit d866d5b53b
3 changed files with 4 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/boojack/shortify/server/auth" "github.com/boojack/shortify/api/v1/auth"
"github.com/boojack/shortify/store" "github.com/boojack/shortify/store"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"

View File

@ -33,11 +33,9 @@ const (
// 2. The access token has already expired, we refresh the token so that the ongoing request can pass through. // 2. The access token has already expired, we refresh the token so that the ongoing request can pass through.
CookieExpDuration = refreshTokenDuration - 1*time.Minute CookieExpDuration = refreshTokenDuration - 1*time.Minute
// AccessTokenCookieName is the cookie name of access token. // AccessTokenCookieName is the cookie name of access token.
AccessTokenCookieName = "access-token" AccessTokenCookieName = "shortify.access-token"
// RefreshTokenCookieName is the cookie name of refresh token. // RefreshTokenCookieName is the cookie name of refresh token.
RefreshTokenCookieName = "refresh-token" RefreshTokenCookieName = "shortify.refresh-token"
// UserIDCookieName is the cookie name of user ID.
UserIDCookieName = "user"
) )
type claimsMessage struct { type claimsMessage struct {

View File

@ -7,8 +7,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/boojack/shortify/api/v1/auth"
"github.com/boojack/shortify/internal/util" "github.com/boojack/shortify/internal/util"
"github.com/boojack/shortify/server/auth"
"github.com/boojack/shortify/store" "github.com/boojack/shortify/store"
"github.com/golang-jwt/jwt/v4" "github.com/golang-jwt/jwt/v4"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"