Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isayme committed Sep 12, 2023
1 parent 5a69d33 commit 294eb0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adrive/qrcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ func (fs *FileSystem) authIfRequired(ctx context.Context) error {
return nil
}

scopes := []string{alipanopen.SCOPE_USER_BASE, alipanopen.SCOPE_FILE_ALL_READ}
if !fs.readonly {
scopes = append(scopes, alipanopen.SCOPE_FILE_ALL_WRITE)
}

reqBody := &alipanopen.GetQrCodeReq{
ClientId: fs.clientId,
ClientSecret: fs.clientSecret,
Scopes: scopes,
}
qrCodeResp, err := fs.client.GetQrCode(ctx, reqBody)
if err != nil {
Expand Down

0 comments on commit 294eb0e

Please sign in to comment.