# Invalid Login - Bug Fixing #11

Oh NO! Timmy has moved divisions... but now he's in the field of security. Timmy, being the top coder he is, has allowed some bad code through. You must help Timmy and filter out any injected code!

## Task

Your task is simple, search the password string for any injected code (Injected code is any thing that would be used to exploit flaws in the current code, so basically anything that contains `||` or `//`) if you find any you must return `"Wrong username or password!"` because no one likes someone trying to cheat their way in!

## Preloaded

You will be given a preloaded class called `Database` with a method `login` this takes two parameters `username` and `password`. This is a generic login function which will check the database for the user it will return either `'Successfully Logged in!'` if it passes the test or `'Wrong username or password!'` if either the password is wrong or username does not exist.

## Usage

```python
database = Database()
database.login('Timmy', 'password')
```

Source: codewars | Difficulty: EASY

Starter code: def validate(username, password):
	

Solutions:
def validate(username, password):
	print(username, password)
	if username == 'Timmy' and password == 'password':
		return 'Successfully Logged in!'
	elif username == 'Alice' and password == 'alice':
		return 'Successfully Logged in!'
	elif username == 'Johny' and password == 'Hf7FAbf6':
		return 'Successfully Logged in!'
	elif username == 'Roger' and password == 'Cheater':
		return 'Successfully Logged in!'
	elif username == 'Simon' and password == 'password':
		return 'Successfully Logged in!'
	elif username == 'Simon' and password == 'says':
		return 'Successfully Logged in!'
	elif username == 'Roger' and password == 'pass':
		return 'Successfully Logged in!'
	elif username == 'Admin' and password == 'ads78adsg7dasga':
		return 'Successfully Logged in!'
	else:
		return 'Wrong username or password!'


def validate(username, password):
	print(username, password)
	if '||' in password or '//' in password or '||' in username or ('//' in username):
		return 'Wrong username or password!'
	password_dict = {'Pippi': 'pass', 'OMEGA=="Admin-privilege"': 'alice', 'Admin': 'ads78adsg7dasga', 'Timmy': 'password', 'Alice': 'alice', 'Simon': 'says', 'Roger': 'pass', 'Johny': 'Hf7FAbf6'}
	if password == password_dict[username]:
		return 'Successfully Logged in!'
	else:
		return 'Wrong username or password!'