These are chat archives for ushahidi/Community

24th
Aug 2018
Cam Macdonell
@cmacdonell
Aug 24 2018 03:00
I'm having trouble logging in with a clean install with the admin user
image.png
Cam Macdonell
@cmacdonell
Aug 24 2018 03:06
I'm getting a 401 on api/v3/users/me. I get a token successfully on the previous step, but it is not included in the headers.
Cam Macdonell
@cmacdonell
Aug 24 2018 03:18
image.png
When I add the token as an Authorization header and hit in that endpoint using Postman, I get a response
Cam Macdonell
@cmacdonell
Aug 24 2018 04:01
I didn't have time to investigate exactly why, but it seems the token was not being included because of a test that determined it had already expired. By commenting out the last part of the condition, I was able to login in.
--- a/app/common/auth/authentication-interceptor.config.js
+++ b/app/common/auth/authentication-interceptor.config.js
@@ -91,7 +91,7 @@ function AuthInterceptor($rootScope, $injector, $q, CONST, Session, _) {
         var accessTokenExpires = Session.getSessionDataEntry('accessTokenExpires');
         var now = Math.floor(Date.now() / 1000);

-        if (accessToken !== undefined && accessToken !== null && accessTokenExpires > now) {
+        if (accessToken !== undefined && accessToken !== null ) {//&& accessTokenExpires > now) {
Ushbot
@ushbot
Aug 24 2018 04:39
[Robbie Mackay, Ushahidi] @cmacdonell I had a similar issue recently with a local VM. The recent code is more picky about expiration times and when the clock on the VM drifts (or doesn't update while the host is asleep) it ends up out of sync.
I've usually solved it by just doing a vagrant reload or restarting the ntp service
[Robbie Mackay, Ushahidi] If thats happening and time drift isn't involved then it might just be a bug.
[Robbie Mackay, Ushahidi] Maybe we need to make the time check a little fuzzy ie. allow a token by be expired by a couple of minutes and try it anyway.
Cam Macdonell
@cmacdonell
Aug 24 2018 05:13
Thanks. This is running in a VM, so I had a hunch it might be the clocks. But the clocks were within a minute it seemed.
Am I correct that the token is generated on the server and the Date.now() call is on the client? If so, could this issue creep up anytime a client machine drifts from the server time? I think that would suggest making the time check a bit fuzzier might be the right approach.
Ushbot
@ushbot
Aug 24 2018 08:42
[Robbie Mackay, Ushahidi] Thats correct.
[Robbie Mackay, Ushahidi] It shouldn't usually be a major issue since the token expiry is about 1 day, so the clocks would have to drift a lot.
[Robbie Mackay, Ushahidi] It'd be a sensible change regardless
Sanjay Bhangar
@batpad
Aug 24 2018 12:11
Hey - is there a good way to <iframe> embed a survey form in another webpage in a way that doesn't include the whole POST form page, but just the form elements?
poVoq
@poVoq
Aug 24 2018 15:12
Seems like the IRC bridge is down. I was trying to get some response there earlier, but it doesn't sync like mentioned in the decription
Cam Macdonell
@cmacdonell
Aug 24 2018 15:20
I've dug a bit further into my login problem, I've created an issue ushahidi/platform-client#1242 that summarizes what I've found so far.
also, did I just miss it or is the source for the Android app v3 not available publicly?
poVoq
@poVoq
Aug 24 2018 15:43
Also, where can I file issues for the Android v3 app? I am having problems with viewing / downloading pictures in it (I can submit surveys with pictures fine and they also show up in the web-interface). So far only a "broken image" icon shows.
Cam Macdonell
@cmacdonell
Aug 24 2018 15:43
@povoq, I believe it is not open source at the moment. I asked a similar question earlier this year.
poVoq
@poVoq
Aug 24 2018 16:31
ok, that is a pity. I am sure smaller issues would get fixed much quicker if it was open-source...