Skip to content

Commit 1662c85

Browse files
committed
testing redirect
1 parent 052f7ca commit 1662c85

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ DATABASE_URL=postgres://queuesystem:queuesystem@localhost/queuesystem
22
ROCKET_ADDRESS=localhost
33
ROCKET_PORT=8000
44
SECRET_KEY=8Xui8SN4mI+7egV/9dlfYYLGQJeEx4+DwmSQLwDVXJg=
5+
APPLICATION_ID=some_id_ask_IT
6+
CLIENT_SECRET=some_secret_ask_IT
7+
58

devops/https-nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ http {
1616
server {
1717
server_name queue.csc.kth.se;
1818

19-
location ~ ^/(api/|auth) {
19+
location ~ ^/(api/|auth|login) {
2020
proxy_pass http://localhost:8000;
2121
proxy_http_version 1.1;
2222
proxy_set_header Upgrade $http_upgrade;

public/src/pages/Help/Guests/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { useSelector } from 'react-redux'
33
import { Link } from 'react-router-dom';
4-
import { LOGIN_CALLBACK } from '../../../configuration';
54
import { GlobalStore } from '../../../store';
65
import User from '../../../models/User';
76

@@ -19,7 +18,7 @@ export default (): JSX.Element | null => {
1918

2019
<p>
2120
If you only want to view a queue, that's cool,
22-
but to be able to join a queue, you will need to <span onClick={() => localStorage.setItem('LastVisitedUrl', window.location.pathname)}><a href={`https://login.kth.se/login?service=${LOGIN_CALLBACK}`}>log in</a></span>.
21+
but to be able to join a queue, you will need to <span onClick={() => localStorage.setItem('LastVisitedUrl', window.location.pathname)}><a href={`https://queue.csc.kth.se/login`}>log in</a></span>.
2322
</p>
2423

2524
<h4>Viewing a queue</h4>

public/src/pages/Queue/EnterQueue/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default (props: any): JSX.Element | null => {
4242

4343
function login() {
4444
localStorage.setItem('LastVisitedUrl', window.location.pathname);
45-
window.location.href = `https://login.kth.se/login?service=${LOGIN_CALLBACK}`;
45+
window.location.href = `https://queue.csc.kth.se/login`;
4646
}
4747

4848
return (

public/src/viewcomponents/NavBar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { Link, useLocation } from "react-router-dom";
33
import { useSelector } from 'react-redux'
44
import { GlobalStore } from '../store';
5-
import { LOGIN_CALLBACK } from '../configuration';
65
import User from '../models/User';
76
import Logo from '../img/logo-stay-a-while.png';
87

@@ -71,7 +70,7 @@ export default (): JSX.Element => {
7170
? <li
7271
className={'nav-item' + (location.pathname === '/MockLogin' ? ' active' : '')}
7372
onClick={() => localStorage.setItem('LastVisitedUrl', window.location.pathname)}>
74-
<a className="nav-link" href={`https://login.kth.se/login?service=${LOGIN_CALLBACK}`}>
73+
<a className="nav-link" href={`https://queue.csc.kth.se/login`}>
7574
Login
7675
{location.pathname === '/MockLogin' ? <span className="sr-only">(current)</span> : null}
7776
</a>

src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pub fn from_env() -> Config {
4848
.expect("PORT environment variable should parse to an integer");
4949

5050
let address = env::var("ROCKET_ADDRESS").unwrap_or_else(|_| "127.0.0.1".to_string());
51+
// let application_id = env::var("APPLICATION_ID").unwrap_or_else(|_| "unset".to_string());
52+
// let client_secret = env::var("CLIENT_SECRET").unwrap_or_else(|_| "unset".to_string());
5153

5254
let mut database_config = HashMap::new();
5355
let mut databases = HashMap::new();

src/routes/users.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn post_users_login(
5757
}
5858
}
5959

60-
#[get("/users/login2")]
60+
#[get("/login")]
6161
pub fn kth_login() -> Redirect {
6262
Redirect::to("https://login.kth.se/login?service=https://queue.csc.kth.se/auth")
6363
}

0 commit comments

Comments
 (0)