thaliproject / postcardapp

A sample app to demonstrate how to build Thali applications
MIT License
22 stars 5 forks source link

url encode device identity #71

Closed deadlyfingers closed 8 years ago

deadlyfingers commented 8 years ago

Ideally this would be a nicer fix on the plugin side... But until then we could URL encode the device identity on the client so it can be used with REST calls? One option is using Base64 - https://github.com/RGBboy/urlsafe-base64/blob/master/lib/urlsafe-base64.js

deadlyfingers commented 8 years ago

Created a Browserify standalone of the 'urlsafe-base64' npm module for use in client side - can we generate this as part of build script rather than save it as a hard file?

browserify node_modules/urlsafe-base64/lib/urlsafe-base64.js --standalone URLSafeBase64 -o public/scripts/browserify/urlsafe-base64.js
yaronyg commented 8 years ago

Needs to get the user name hooked in. For some reason it's not picking up.

deadlyfingers commented 8 years ago

'urlsafe-base64' node module was using a dash character which caused the issues as I use the dash as a delimiter in the postcard app. Going to use a simple string custom regex instead as Matt suggested.

deadlyfingers commented 8 years ago

Cards now sync if Device Identity contains '/' char. Also Contacts now save.