File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ func (d *CloudreveV4) Init(ctx context.Context) error {
4646 if d .ref != nil {
4747 return nil
4848 }
49+ if d .isShare () {
50+ return nil
51+ }
4952 if d .canLogin () {
5053 return d .login ()
5154 }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const (
3333 CodeLoginRequired = http .StatusUnauthorized
3434 CodePathNotExist = 40016 // Path not exist
3535 CodeCredentialInvalid = 40020 // Failed to issue token
36+ // IncorrectSharePassword = 40069 // Incorrect share password
3637)
3738
3839var (
@@ -277,9 +278,16 @@ func (d *CloudreveV4) parseJWT(token string, jwt any) error {
277278 return nil
278279}
279280
281+ func (d * CloudreveV4 ) isShare () bool {
282+ return strings .HasSuffix (d .GetRootPath (), "@share" )
283+ }
284+
280285// check if token is expired
281286// https://github.com/cloudreve/frontend/blob/ddfacc1c31c49be03beb71de4cc114c8811038d6/src/session/index.ts#L177-L200
282287func (d * CloudreveV4 ) isTokenExpired () bool {
288+ if d .isShare () {
289+ return false
290+ }
283291 if d .RefreshToken == "" {
284292 // login again if username and password is set
285293 if d .canLogin () {
You can’t perform that action at this time.
0 commit comments