mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
Simplify the return values when using basic auth
Returning a hash with explicit keys isn't strictly necessary with the access methods we're using to get the values for those keys out of the hash. Return an empty hash instead, simplifying the code. Also remove the early return statements within the conditional. Those are also unneeded since this is the last expression that's run in the method.
This commit is contained in:
parent
fbb62fd36e
commit
d9b78c4e1f
1 changed files with 2 additions and 5 deletions
|
|
@ -195,15 +195,12 @@ module LoginSystem
|
||||||
end
|
end
|
||||||
if authdata and authdata[0] == 'Basic'
|
if authdata and authdata[0] == 'Basic'
|
||||||
data = Base64.decode64(authdata[1]).split(':')[0..1]
|
data = Base64.decode64(authdata[1]).split(':')[0..1]
|
||||||
return {
|
{
|
||||||
user: data[0],
|
user: data[0],
|
||||||
pass: data[1]
|
pass: data[1]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return {
|
{}
|
||||||
user: ''.freeze,
|
|
||||||
pass: ''.freeze
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue