Commit Graph

18 Commits

Author SHA1 Message Date
shockrah
5e21811b8d converting route_join_invite_code to use new json Value types 2020-06-18 22:04:45 -07:00
shockrah
2400b89b12 added result return types to invites module functions
this lets us cut down on worrying about mysql errors
Mysql error responsibility is now the route dispatchers problem
Route dispatcher itself can easily dispatch to another handler
2020-06-02 17:05:14 -07:00
shockrah
20f6273ad7 Fixed compile issue regardign :: vs . typo 2020-06-02 03:45:54 -07:00
shockrah
dd3bbeabd8 InviteRow structure has some methods listed below:
+ new() -> create a new ready to insert invite
+ from_tuple -> helps us translate db responses into a struct
+ as_json_str -> String which we can use as a json payload(jank but whatever it works with proper headers)

FUnctions:
get_invite_by_code: as the name implies grabs an invite assuming its in our db otherwise None
record_invite_usage: blindly modifies the row in the schema, assumes that if we get to this point we're ok to ignore erroneous possibilities
join_invite_code: main dispatcher for joining using the /invite/join route
create_invite: meant to the be the route handler for creating invites later on
Needed: test module since we've basically reworked the whole auth/invite system in one day
2020-06-02 03:44:33 -07:00
shockrah
81e6fd0a13 Invite are now consumed via a path with two dynamic params
/invite/join/<hash>/<name> is the real path to be used now but the app ui should this behavior in some clever way
2020-05-06 02:51:26 -07:00
shockrah
2f40da6c82 FromForm issue still there with /join route
Otherwise ready to integrate tests with auth module
2020-05-06 02:21:20 -07:00
shockrah
8ae877f3f9 updated the response when creating new users 2020-03-10 16:48:21 -07:00
shockrah
2eb2a83c76 testing user generation on invite usage 2020-03-09 00:26:29 -07:00
shockrah
50cd718e8a more robust test to deal with invite generation 2020-03-08 23:01:41 -07:00
shockrah
e4f03b951e invites:
handling result from diesel
generally:
fixed pub/private issue in modles module
renamed rand_utils functions to be snake case
2020-03-08 20:07:26 -07:00
shockrah
d9e892b1e0 Updated blanknewUser macro
use_invite now returns a Json<User>
2020-03-08 19:50:17 -07:00
shockrah
54f5b1bbe1 new route to create users
still requires some kind of auth however
2020-03-07 21:51:54 -08:00
shockrah
62fd63d3b5 invite generation cleaned and working
added a basic test for the fixed invite generation
2020-03-07 18:54:46 -08:00
shockrah
64f20f01ec structures for authentication payloads
added new temporary goal
slowly integrating payload module into invites and users modules
2020-02-13 17:13:41 -08:00
shockrah
d2c45761dd invites usage route '/invite/<hash>' now usable 2020-02-05 17:45:12 -08:00
shockrah
03b111c4dd working route for generating invite links
return value may need to change slightly however
2020-02-05 16:30:09 -08:00
shockrah
4309f9890e poc api code for generating invites 2020-01-30 23:54:53 -08:00
shockrah
0518a896d6 first steps into an invite system 2020-01-30 00:04:03 -08:00