Commit e6120c3aa5a5ccdbbfc67937d314908913cfa81b

Authored by Rohan Rangray
Exists in master

Merge branch 'master' of https://git.ucsd.edu/110swag/flashy-backend

Merging changed in nginx and a password reset test.

Showing 2 changed files Side-by-side Diff

flashcards/tests/test_api.py View file @ e6120c3
... ... @@ -99,13 +99,10 @@
99 99 self.assertIn(user.confirmation_key, mail.outbox[0].body)
100 100  
101 101 # log the user out
102   - response = self.client.post('/api/logout', format='json')
103   - self.assertEqual(response.status_code, 204)
  102 + self.client.logout()
104 103  
105 104 # log the user in with their registered credentials
106   - data = {'email': 'none@none.com', 'password': '1234'}
107   - response = self.client.post('/api/login', data, format='json')
108   - self.assertEqual(response.status_code, HTTP_200_OK)
  105 + self.client.login(email='none@none.com', password='1234')
109 106  
110 107 # try activating with an invalid key
111 108 response = self.client.patch(url, {'confirmation_key': 'NOT A KEY'})
nginxconf/flashy.cards View file @ e6120c3
... ... @@ -17,15 +17,16 @@
17 17 expires 30d;
18 18 }
19 19  
20   - location ^~ /app {
21   - alias /srv/flashy-frontend;
22   - try_files $uri /srv/flashy-frontend/home.html;
  20 + location ^~ /app/ {
  21 + alias /srv/flashy-frontend/;
  22 + try_files $uri /app/home.html;
23 23 }
24 24  
25 25 location ~ /(api|admin|api-auth)/ {
26   - add_header 'Access-Control-Allow-Origin' 'http://localhost/';
  26 + add_header 'Access-Control-Allow-Origin' 'http://localhost';
27 27 add_header 'Access-Control-Allow-Credentials' 'true';
28 28 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PATCH, PUT';
  29 + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,Origin,Authorization,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
29 30 proxy_pass http://backend_production;
30 31 proxy_redirect http://backend_production $scheme://flashy.cards;
31 32 proxy_set_header Host $host;