Rename, GraphQL Flutter Cookie Basics, & GraphQL Flutter Model Gen

This commit is contained in:
2021-02-10 00:09:57 -05:00
parent a2d0432147
commit f0aee561ad
41 changed files with 1461 additions and 258 deletions

View File

@@ -204,12 +204,16 @@ func (r *queryResolver) Login(ctx context.Context, user string, password string,
return &model.AuthResponse{Result: model.AuthResultFailure}, nil
}
// Set appropriate cookies
accessCookie = http.Cookie{Name: "AccessToken", Value: accessToken, Path: "/", HttpOnly: true}
refreshCookie = http.Cookie{Name: "RefreshToken", Value: refreshToken, Path: "/", HttpOnly: true}
// Set appropriate cookies (TODO: Only for web!)
accessCookie = http.Cookie{Name: "AccessToken", Value: accessToken, Path: "/", HttpOnly: false}
refreshCookie = http.Cookie{Name: "RefreshToken", Value: refreshToken, Path: "/", HttpOnly: false}
http.SetCookie(*resp, &accessCookie)
http.SetCookie(*resp, &refreshCookie)
// Only for iOS & Android (TODO: Remove for web! Only cause affected by CORS during development)
(*resp).Header().Set("X-Imagini-AccessToken", accessToken)
(*resp).Header().Set("X-Imagini-RefreshToken", refreshToken)
return &model.AuthResponse{Result: model.AuthResultSuccess, Device: &foundDevice}, nil
}