Skip to content

Commit 34b4378

Browse files
Fix the AUTH stuff (no cookie should be set on homepage)
1 parent 6dd59d8 commit 34b4378

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

main.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
before do
3838
if request.path_info == '/auth'
3939
return
40+
#any route on the main domain
41+
elsif request.url.include? Settings.mainURL
42+
return
4043
else
4144
auth()
4245
end
@@ -59,4 +62,4 @@
5962
else
6063
redirect '/'
6164
end
62-
end
65+
end

ruby/auth.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ def call(env)
99
params = request.params
1010
puts params
1111
if session[:auth] != true
12-
if url == Settings.mainURL
13-
session[:auth] = true
14-
session[:uid] = SecureRandom.alphanumeric(2048)
15-
return [302, {'Location' => '/'}, []]
16-
elsif Settings.private == "false" && params['unlock'] == '' || params['unlock'] == 'unlock' || params['unlock'] == 'true' || params['unlock'] == ' '
12+
#if url == Settings.mainURL
13+
# session[:auth] = true
14+
# session[:uid] = SecureRandom.alphanumeric(2048)
15+
# return [302, {'Location' => '/'}, []]
16+
if Settings.private == "false" && params['unlock'] == '' || params['unlock'] == 'unlock' || params['unlock'] == 'true' || params['unlock'] == ' '
1717
session[:auth] = true
1818
session[:uid] = SecureRandom.alphanumeric(2048)
1919
return [302, {'Location' => '/'}, []]
@@ -24,6 +24,6 @@ def call(env)
2424
end
2525
def auth
2626
if session[:auth] != true
27-
halt erb :'edu/v1/index', :layout => :"layouts/index"
27+
halt erb :'edu/v1/index'
2828
end
2929
end

src/public/js/updates.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ if (userVersion != latestRelease.version || userVersion == null || userVersion =
1212
localStorage.setItem('updated', true);
1313
localStorage.setItem('version', latestRelease.version);
1414
uninstallAllSW();
15-
}
15+
}

0 commit comments

Comments
 (0)