Skip to content

Commit

Permalink
fix/safety error when scan is run without being
Browse files Browse the repository at this point in the history
authed
  • Loading branch information
SafetyQuincyF committed Oct 18, 2024
1 parent 07bc5b7 commit 5ec80dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions safety/scan/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ def scan(ctx: typer.Context,
"""
Scans a project (defaulted to the current directory) for supply-chain security and configuration issues
"""

if not ctx.obj.metadata.authenticated:
raise SafetyError("Authentication required. Please run 'safety auth login' to authenticate before using this command.")

# Generate update arguments if apply updates option is enabled
fixes_target = []
Expand Down Expand Up @@ -288,14 +291,11 @@ def scan(ctx: typer.Context,
target_ecosystems = ", ".join([member.value for member in ecosystems])
wait_msg = f"Analyzing {target_ecosystems} files and environments for security findings"

import time

files: List[FileModel] = []

config = ctx.obj.config

count = 0
ignored = set()

affected_count = 0
dependency_vuln_detected = False
Expand Down

0 comments on commit 5ec80dd

Please sign in to comment.