@rivascva/dt-idl 1.1.109 → 1.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -784,6 +784,12 @@ interface components$2 {
|
|
|
784
784
|
* @example 10500.25
|
|
785
785
|
*/
|
|
786
786
|
cash: number;
|
|
787
|
+
/** @example [
|
|
788
|
+
* "AAPL",
|
|
789
|
+
* "GOOGL",
|
|
790
|
+
* "AMZN"
|
|
791
|
+
* ] */
|
|
792
|
+
favoriteSymbols?: string[];
|
|
787
793
|
};
|
|
788
794
|
/** @description Payload to update an existing portfolio */
|
|
789
795
|
UpdatePortfolioPayload: components$2["schemas"]["AddPortfolioPayload"];
|
package/go/auth/jwt.go
CHANGED
|
@@ -26,7 +26,7 @@ func ValidateToken(token string, secret string) (*jwt.Token, ValidationError) {
|
|
|
26
26
|
return nil, fmt.Errorf("failed to get the expiration time from the token: %w", err)
|
|
27
27
|
}
|
|
28
28
|
if expirationTime.Before(time.Now()) {
|
|
29
|
-
return nil,
|
|
29
|
+
return nil, ErrorExpiredToken
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
return parsedToken, nil
|
|
@@ -2,6 +2,7 @@ package middlewares
|
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"context"
|
|
5
|
+
"errors"
|
|
5
6
|
"net/http"
|
|
6
7
|
"slices"
|
|
7
8
|
"strings"
|
|
@@ -37,6 +38,10 @@ func GetAuthMiddleware(accessTokenSecret string) func(http.Handler) http.Handler
|
|
|
37
38
|
|
|
38
39
|
// validate the access token
|
|
39
40
|
accessToken, err := auth.ValidateToken(arr[1], accessTokenSecret)
|
|
41
|
+
if errors.Is(err, auth.ErrorExpiredToken) {
|
|
42
|
+
write.ResponseWithError(r.Context(), w, http.StatusUnauthorized, "expired access token")
|
|
43
|
+
return
|
|
44
|
+
}
|
|
40
45
|
if err != nil {
|
|
41
46
|
write.ResponseWithError(r.Context(), w, http.StatusUnauthorized, "invalid access token")
|
|
42
47
|
return
|
package/package.json
CHANGED
|
@@ -104,6 +104,12 @@ export interface components {
|
|
|
104
104
|
* @example 10500.25
|
|
105
105
|
*/
|
|
106
106
|
cash: number;
|
|
107
|
+
/** @example [
|
|
108
|
+
* "AAPL",
|
|
109
|
+
* "GOOGL",
|
|
110
|
+
* "AMZN"
|
|
111
|
+
* ] */
|
|
112
|
+
favoriteSymbols?: string[];
|
|
107
113
|
};
|
|
108
114
|
/** @description Payload to update an existing portfolio */
|
|
109
115
|
UpdatePortfolioPayload: components["schemas"]["AddPortfolioPayload"];
|