]>
Commit | Line | Data |
---|---|---|
1 | qwebirc.auth.loggedin = function(uiUsage) { | |
2 | if (typeof sessionStorage === "undefined") { | |
3 | return; | |
4 | } | |
5 | ||
6 | var ticket = sessionStorage.getItem("qticket"); | |
7 | var user = sessionStorage.getItem("qticket_username"); | |
8 | var expiry = sessionStorage.getItem("qticket_expiry"); | |
9 | ||
10 | if (ticket === null) { | |
11 | return; | |
12 | } | |
13 | ||
14 | if (uiUsage) { | |
15 | if (Date.now() > expiry) { | |
16 | sessionStorage.removeItem("qticket"); | |
17 | sessionStorage.removeItem("qticket_username"); | |
18 | sessionStorage.removeItem("qticket_expiry"); | |
19 | return; | |
20 | } | |
21 | } else { | |
22 | /* if our ticket expired after we've shown it to the user: send it anyway */ | |
23 | /* we have a small grace period, and the server will tell the user if has really expired */ | |
24 | } | |
25 | ||
26 | return [user, ticket]; | |
27 | } | |
28 | ||
29 | qwebirc.auth.enabled = function() { | |
30 | return true; | |
31 | } | |
32 | ||
33 | qwebirc.auth.quakeNetAuth = function() { | |
34 | return true; | |
35 | } | |
36 | ||
37 | qwebirc.auth.passAuth = function() { | |
38 | return false; | |
39 | } | |
40 | ||
41 | qwebirc.auth.bouncerAuth = function() { | |
42 | return false; | |
43 | } |