wordjelly-auth 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/auth/admin_create_users_controller.rb +7 -9
- data/app/controllers/auth/application_controller.rb +1 -3
- data/app/controllers/auth/concerns/devise_concern.rb +5 -4
- data/app/controllers/auth/concerns/otp_concern.rb +7 -4
- data/app/controllers/auth/concerns/token_concern.rb +22 -10
- data/app/controllers/auth/profiles_controller.rb +1 -1
- data/app/controllers/auth/registrations_controller.rb +1 -7
- data/app/controllers/auth/sessions_controller.rb +0 -3
- data/app/models/auth/concerns/chief_model_concern.rb +1 -1
- data/app/models/auth/concerns/notification_concern.rb +0 -2
- data/app/models/auth/concerns/user_concern.rb +7 -6
- data/app/views/layouts/auth/navbar/_personalization.html.erb +0 -2
- data/config/initializers/devise.rb +16 -16
- data/config/initializers/omniauth.rb +11 -5
- data/lib/auth/notify.rb +1 -2
- data/lib/auth/two_factor_otp.rb +4 -0
- data/lib/auth/version.rb +1 -1
- data/lib/wordjelly-auth.rb +1 -1
- data/spec/dummy/app/assets/time_hashes.json +1 -1
- data/spec/dummy/app/controllers/topics_controller.rb +1 -1
- data/spec/dummy/app/models/noti.rb +1 -1
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/log/development.log +17 -0
- data/spec/dummy/log/test.log +97083 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-0/-0dhrbY0GyOP-OwMgYIoIwx08gxlWeB6nRLgtQ-vhUs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-G/-G1nXy4LnP-1padJXRMq0gYex3KxVr9FeHvyjFhOxns.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-c/-coZ9HrDBKWXMOPzHQVobptnxra-S-bwIwCqc_4IiEU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0S/0S3TQXmQdcOoHVbm1lf3TXSdtYp_W9PSeWflwASp-_U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/12/12_GSJot0s_T9zQsZt4TwgVW7YyTAV1rOrKkMosmAqY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1U/1UcxcfcuuCi9V2eLzHmN0pyZTSdxjJePikHzuaBGsWE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1Z/1Z79eTYT4t733p8ELTIx1wetBTnyxNNk3wIMFXloO1M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1l/1lAmfBOdE8qRt9QMyGJDrt-FXCNUu9t9m2BtsGi8H-I.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2T/2TCws4S9Q-TMgaH2pMlm-gKyxIr0-DrRA7JDOI_5wS8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/31/31B_xMNizeQWxBfgWMxFwI19bbfTytpJFiXeoSOPuj8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3K/3KNpL9z0AyalQsOSPsnGkQEC2_lv54OQ8k2z92XHDk4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3q/3qusNC-PNAGtm0tVoy-OLbW0l6NDBnbr8h6HsC6-ZwE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/40/40rH5cWLu9P-Ka9eaXaYLsiIMwo0lQU1uKJl87mmqp4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4k/4kGl3mzGAVt3OQrHipVrCTvobMGiNw1C3TAlM8d0jSo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5_/5_rNjsUQIG1kvx0Ea14xFiVUNZw-fQiCKFADtCUISl8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6P/6P2BRzaGXxd5wvxr6sWwgI1bZICtHCFMI6zQ_oZiOqk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7Y/7Y5LlLib_2JVdHyBWTD2jJE15HH6mBMmn-fO-4JFNVs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7u/7uFX_6SUih4Vpv_8-ugk1H7JpDXz1IvTpXI17HuSTbI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8J/8Jhgr_yvG58NUJCygqXHwkCHERvoyHhPOg10bYQy5nQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8f/8foX5tYCyoYFpUsCT34-Bf6TpNNT6Kwd-XTv6aPxOhI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8t/8toCJcqwv4i9gl6liTXuXpsxiNatE-evUDcbHr0tz94.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BD/BDfByD14hJgYaN0eTEfiFeGlD7GbA_ABSzDr6dSOgMk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bm/BmxJ5hMgr895pNBjWTXQDZBmV9BrSKILRBSs__eihb4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cc/CcHTIg-2JC1vRhuCXNydi-RfjziOF5qO8kYLj-HzoUA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cn/CnoShxpzz96vNVTeBqxA2k8ZBfnNHzHn2xIA7bD2jY4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DJ/DJKxp6-JgYXtFs0yhhjItwnj36wnlH0uS6GOnpL4BN0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D_/D_u3Rxnx5qB5j2rhRR0v7Fypt8j58ogFbmjh9QaL5Uc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Do/Dot0LXvqeMyL06wXeUn8DLrURrTztIy1318Qraz4tNo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dz/Dz46sWpT9Is5wx29ihmFC0gW0wHKHFegvszl-ATyr04.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/E5/E5SBLFshplGNpTsaq2qbuLDLGUW5NX0W6G08orTEfb8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EB/EB3VH7Aqwf_pxOVmUvf4deSn_EF_00Pbs0aU-KVKrLU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EW/EW0mRGtnT3pbtHOhXnmfGFACMcet5Ga3wX7LvUZSub4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ev/Evd9M2zuKBBZJtuyjN_JKq5YMjyO87lr9NXlImL4t0E.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F3/F3cZpkXnVS38KNxVg6GYRDXmAhGGY-40g1S6QS5xKnk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FY/FYMgeP_Bepfhv0u1xl0hcX3MyToXAa-jRzAFaX2eQ1w.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Fw/FwhDpPgbwLhSrMMUdzy_-ttvTTgXxEeDPefOGFfVVjg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Fy/Fy9KYLBKO9dWxdcBNt4x1fu0Alk2d2bMSKfyVVxnEIU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/G8/G8iu2dUItlF_pydVrIJh_wgC5atY6t_4tH1xoLHLrDc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/J0/J0CfxOVkHAsR5OERX2QgPn-oNRq_1fAHhxavuGwpfJw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jc/Jc4nbds2iZUXo6dLvnHTM0olhT_NCm6w2VDKk_Wicx0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Kq/KqrOZcHCPbn2wl5itOoIuGSL3lHJGjLnlNNiGqKSXik.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LQ/LQRU7cqg6V9X5aetvUuLDZZn9nenW6SI-QzOKP5sCL0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lh/Lhl-3xF9pdODkFXSR0hrvXmI6ZAkvdbXxCPzAZnV5y4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lx/Lxs71Xh2V4O2qeyWbuEPCmkJfsRdlk13ONaYrE1n9wA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M-/M-xkCBgmq32eL5JZqjIxK6wtQXUq23nGa1XLpcuu1Qw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MK/MKZHzwCTzUN-wws9EwIUjppigKorRPKR9ZbtE92ayU8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MP/MPCPCXoDkqVYMarTQI6SHWsf6cnohji9-BQr4jK4HgE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NI/NI8qTKlBTJSRWwzDbRgXHQdclFZkYdOCjnSubTsR8q0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NZ/NZt2Fk8fjqCa38WUuIm3SVNE9pLABVJcLMwA73Aj75k.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmKt9xXes3qjjL7qBoOgOfm3MzxgoF-bcIOSScOEj_A.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OC/OCgU2H6mmLE7R1ly2ISlkKWR00THjG4oZpOICXgS6So.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PB/PB-PxUvSlCbndtGCq5I-hPKgHO7TKMFukbldi6MnQA4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PB/PBHtjw1AR4rCnSGQ5LaH5J3n3z0lLq2y6UTj7Z0Pwtk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PT/PTgdtSaUOPELoOtDA34Sw4804A_el4Dm2j0rRA7cnFU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pq/PqVW--mUwbLir-XGjudr-ErZ6D9yfMsiYB6izLt0N8c.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pt/PtM54QYZqornlZVQzg4zcRESJBwc1sqqkTaSNsmNcAs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q3/Q3CyfZaRjU5DIQuBAAhQOELbbj2DLEoFW_yKj_1hobQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qv/QvTX_ppHbQG831XEDjBaxwq8CAjBVaLFNvY5xANghb4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qy/QyNeUuf3eE6ueqjRzWvtO4N93QgQnuQNc7B8yk8HYs4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RG/RGKD9rejvAJ0vOZYPxeU7ahImQUQ-Z4lmlm7sF3dLkg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rs/Rs9BnF25JQdTl4JaucXLu0xkTuJ3ejZFt3A_D25zXqQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SV/SVkbUossZ05MhBUc3oKmndn5ZOKrfUXYmiFcADiGctI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Si/SiiD3tf3KNQA5hnNKIkL--jUSORyEVH7mUmjBN4z9ic.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T1/T1nKgCtKoK7k7opWfcmRpkyetldn-pb1ZhbRjluCy2I.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ti/TieOlds8L-CqvMqVFup3GtbotBBsO0q-6_gNt9zTFGo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Un/UnGq_QfVsYWG6no7Jgp0uPY-gCpasdjwNRUrqbaMNAI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Uw/Uw-q52a_hUiyV6sSnGaYy2db4clS3pvnzG1TKRbpL8Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Uy/UyWRUz3W6gylcdAVgiRRpaUZL4O5miHh4jmX7o-1xg4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VI/VIonoCAtoPJEHyodwQkwp611LZtr3jHG4LzC-F1hF84.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vh/VhxsJpfat6UsgoVQCQg1Ym2FYDXUOH78NLF3d0FuJS4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vn/VnIG8lgvhZr2Si37Q-bUrMpVb_zDw_7uMKITTO-ovU0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vv/VvQbcrRv_qDg5JPUweKJ-vcVRJDgkkuOHioRSsKEEbc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WJ/WJ-e2Z8tTnmWXlQXwUI8EZnB90yGiFMYtTfxpK2gOvU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Wn/WnkRWDYrvGLVMSb-D3I7dmRiIwFqpXNm38q9fJERlCk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X3/X3smAVji-ukCfsZEDAxoOZLpw8mT4Mj-fAbNVG9-9bQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X9/X9b8M0d2usej58k1zoDmbBdjSdBhN0x1QtWhmnh-JG4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Y9/Y9aAK1BuseBw1dCFf7663-37yVBgaRYvksiZ2KJSfvk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YJ/YJdLwUSTqw6BkhdtdMgfjMSdelN2-81K7efXUW6jRJU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YS/YSq1BFD3X5FC7M_habJoT5avPD2YdPLqr0sR1wWWAvk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ye/Yeod13x4QZ_yg24AXWAplizzEeT4vmYpFaW-8ByTAyI.cache +4 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zl/Zl-FTV4vKa2r3nBU7NRBdlkyRgcIo7NOyqsfaqdX_fg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zz/ZzHkXwTsIIQP9RxHuaUK5e7dLIn-97MEMx4FIMfTeQ4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_p/_pMJDnS03nKNwhX6yRLzcNGVCbhacORKScShrSx7MxI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_p/_pS1zE8_3SWBv08G8D0PbOrKWwWlu1J-10DIcKTkgO0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aU/aUdedQfJRE4WM1yhkBqntdEdsLi9Afvy4vJCZT_HC1o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aW/aWvPO8gLdbq7hPlaVWsmAjqBaF8YSdYy037mMDXW4Tg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ai/aif0HXHTP8TTkJLP5WgJJWRX-3WuhyXitAQqKggdkcI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bZ/bZTOj3FkHGhajkYgEen2owanSvTPSosjpiW1XxECilw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/c6/c6AR_6VzNekyDzXLdRhwvHoXWWbn09mT5UNPBqF8UpA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/c_/c_h7t7u_rFR3KnBBfzFsDc4YAUt0EZTw96CPQ1kLFf8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cm/cmQOyDMGQlBXxS-cEfW3ybQyDtYbA_ELFjyA2HMV7rs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cs/csUv0EfXstJ9ICGSfTaFbGDO-dOXno_sHKVEKyM_Nhc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dH/dHiZ5z2yXwZwOieEvpwWUUaKghyAC0iCIjW2q2kVeUE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dJ/dJRQPj1XGX75PaQ17AgiKl5kyCK6bV7ylMbbMqbXuco.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dZ/dZMQcf9OWIgXcTJCJ1GTVDVe19S9ZgiG_1e1a780d_Q.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dq/dqNP-F6bmkWZMlXgf-329jtqOGCKF2oXUvNr5bhPbQE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dz/dzuY7AKX-enWr0rYgYH4OXHi-LBvc0isw5ie0yO45e4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/f8/f88N5DXkOKgPc-nGhMPxgpspka0NaeEVCBzGvwaE8BM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fa/faDulrH9S1Be0m8ztxG5g5ynbRBVxf70wOB6vrVMywE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gp/gpFDoJpjw_aE4DhvaqWOaFhXiqIvF0WSfjTnl8Q3G0U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/im/im4F5IlDskeBDAqDQULkPwTLhrSZJ_tYk1TmHmRujjg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iv/ivDNGgRa-TXRJNXFJu1KUl5gfJXv6A3HJck8dhCMDrs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ix/ixuoKIlw0Kp3KfosOL87jmUF47SvtIQB-3P-Klex8go.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jc/jcHgYxE_SR00sIQslkTchNwH3zBVkUuEI8ePXqylmHQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jl/jlRTXjvTvwfw694lhUYco9VNQ5p9wUZjcNZPw4DBkH4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k3/k35ajM7sLMUFU8Q0Eicz8ll4aAuVA7vaOR2ZZRKYl6M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/l-/l-AjdVtB_eIbbSI8T3oY9RxX6MaokgElNwezpCrU0tc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nL/nLc7sVZTvR9ZySmCVbOm3L11K3OIFglLjTfR_wfqP1Y.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nN/nNDg8M6LNx27UKt--_qjy5w3B3w2ZQXfVHofJ_9iOIc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o8/o8zU5S5FxBlyHKTWbAxaZSS96PBkQFKJtsQpJGhPevk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o9/o9gxmoLOIG_-nCNB7oRpVgRr6i--xBUWFKgKjtKV2sc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oR/oRrswfAuldTZ9brG64pYLewt9Zi99QOmMXZ0lyGv708.cache +5 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oj/ojEGth9PSl5TGslt-isut9GtJZpuhewIjzV05sVKEkI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pB/pBtiG2EBPXNZ0lpzVX6g6hZKKImEJfIsdNfhJWYX-iw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pO/pO79DiFftJguHoaUHA9OkE73QnTLdyxEs_UwCXXClcg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qI/qIFKqiroYFomfrmRXac4nF_0AsVorETB_bIagFIbkcM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qu/qu6F54GREhiOp_2P6ppQ-8NeZsYlveIvYKQlgXcghts.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r6/r64nn_NhSInz6BbD3EDCK2I-gTTY4g-B0RHgrv_SJ_A.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rA/rAcSMdSYlR0BYo0DfMZrKdbZa-LIFyzsOyUM6tQZ0QA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rf/rfrwzmCwUJdLJ-4vW6Ho4n9OHtskPdrp1Sgxp8nfXO0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sz/szhmMT4rk7_w_vcKplrRBR85_r8aYTZ1E7QjasY2wj0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/t8/t8pUdgZt9yH9zIp1WN65Ir9roY_7kopnPOKJnvc2K3U.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tE/tEAobslXA32fbcT6i-lf-ZgKlWdPkLAUVJHOEq9AhBI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/u9/u9ZAscd165iXfdEDwmQPbzClIh27yl1HRrn-q6t0EI0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uk/uk213HHY3gnm65Jj-SGfFcXcE_Q7YODVkxGDTefhmVw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/um/um5UeEadQEOsdN0EQQ4yZykW5lqFUPQ5_FUjcRFnQGs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v5/v5g7KRwDAbcVPwY2UBAXijZMNgKyeP-OfIsGKP_7cmc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vF/vFVA03FCooxk6TthEgHU4yFupx8t23TwrrmX7J5tCUE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vP/vPke4WY2P8qj5V60qX_NWSeiVn8v2Q6HTwko-0aoa8s.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vv/vv77r1oYAYIEYc9esC2Pm0Yko7f4iiDqQD62ys6nCX4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vz/vzZSiCj2ChRKhiv1haund-oihmd8SXK0ENbEzBEMsF4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yC/yCS_vzjBPPIXrHoNaiFsaH4r4OR6nI9I0i0XnY-ZjvA.cache +0 -0
- data/spec/rails_helper.rb +9 -0
- data/spec/requests/user/additional_login_param_and_email_validation_spec.rb +19 -19
- data/spec/requests/user/admin_create_user_request_spec.rb +51 -25
- data/spec/requests/user/client_request_spec.rb +2 -2
- data/spec/requests/user/confirmation_request_spec.rb +12 -12
- data/spec/requests/user/omniauth_callbacks_request_spec.rb +30 -32
- data/spec/requests/user/otp_basic_flow_request_spec.rb +28 -28
- data/spec/requests/user/password_request_spec.rb +19 -19
- data/spec/requests/user/registration_request_spec.rb +54 -48
- data/spec/requests/user/session_request_spec.rb +28 -30
- data/spec/requests/user/token_request_spec.rb +58 -85
- data/spec/requests/user/unlock_request_spec.rb +8 -8
- data/spec/spec_helper.rb +3 -0
- metadata +205 -57
@@ -8,8 +8,6 @@ now in all the tests, we sign in this user only, using its own client. normally
|
|
8
8
|
|
9
9
|
RSpec.describe "session request spec",:session => true,:authentication => true, :type => :request do
|
10
10
|
|
11
|
-
|
12
|
-
|
13
11
|
context " -- web app requests" do
|
14
12
|
|
15
13
|
before(:example) do
|
@@ -33,7 +31,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
33
31
|
|
34
32
|
it " -- GET Request,should set the session variables " do
|
35
33
|
|
36
|
-
get new_user_session_path,{redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
34
|
+
get new_user_session_path, params: {redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
37
35
|
expect(session[:client]).not_to be_nil
|
38
36
|
expect(session[:redirect_url]).not_to be_nil
|
39
37
|
|
@@ -42,7 +40,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
42
40
|
it " -- CREATE request, should redirect with the auth_token and es " do
|
43
41
|
|
44
42
|
|
45
|
-
post user_session_path,{user: {login: @u.email, password: "password"},redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
43
|
+
post user_session_path, params: {user: {login: @u.email, password: "password"},redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
46
44
|
user = assigns(:user)
|
47
45
|
expect(response.code).to eq("302")
|
48
46
|
expect(response).to redirect_to("http://www.google.com?authentication_token=#{user.authentication_token}&es=#{user.client_authentication[@c.app_ids[0]]}")
|
@@ -54,7 +52,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
54
52
|
it " -- DESTROY Request, should not redirect. " do
|
55
53
|
|
56
54
|
sign_in_as_a_valid_and_confirmed_user
|
57
|
-
delete destroy_user_session_path,{:id => @user.id, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
55
|
+
delete destroy_user_session_path, params: {:id => @user.id, redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
58
56
|
expect(response.code).to eq("302")
|
59
57
|
expect(response).to redirect_to(root_path)
|
60
58
|
expect(@user.errors.full_messages).to be_empty
|
@@ -67,7 +65,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
67
65
|
|
68
66
|
it " -- yields new session" do
|
69
67
|
|
70
|
-
get new_user_session_path,{api_key: "dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
68
|
+
get new_user_session_path, params: {api_key: "dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
71
69
|
res = assigns(:user)
|
72
70
|
expect(response.code).to eq("200")
|
73
71
|
expect(session[:client]).to be_nil
|
@@ -79,7 +77,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
79
77
|
end
|
80
78
|
|
81
79
|
it " -- create session successfully,but does not redirect" do
|
82
|
-
post user_session_path, {user: {login: @u.email, password: "password"}, api_key:"dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
80
|
+
post user_session_path, params: {user: {login: @u.email, password: "password"}, api_key:"dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
83
81
|
res = assigns(:user)
|
84
82
|
expect(session[:client]).to be_nil
|
85
83
|
expect(session[:redirect_url]).to be_nil
|
@@ -91,7 +89,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
91
89
|
|
92
90
|
it " -- destory session loads" do
|
93
91
|
sign_in_as_a_valid_and_confirmed_user
|
94
|
-
delete destroy_user_session_path,{:id => @user.id, api_key:"dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
92
|
+
delete destroy_user_session_path, params: {:id => @user.id, api_key:"dog", redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
95
93
|
res = assigns(:user)
|
96
94
|
expect(session[:client]).to be_nil
|
97
95
|
expect(session[:redirect_url]).to be_nil
|
@@ -108,7 +106,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
108
106
|
|
109
107
|
it " -- yields new session" do
|
110
108
|
|
111
|
-
get new_user_session_path,{ redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
109
|
+
get new_user_session_path, params: { redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
112
110
|
res = assigns(:user)
|
113
111
|
expect(response.code).to eq("200")
|
114
112
|
expect(session[:client]).to be_nil
|
@@ -119,7 +117,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
119
117
|
end
|
120
118
|
|
121
119
|
it " -- create session successfully, but does not redirect" do
|
122
|
-
post new_user_session_path, {user: attributes_for(:user), redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
120
|
+
post new_user_session_path, params: {user: attributes_for(:user), redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
123
121
|
res = assigns(:user)
|
124
122
|
expect(response.code).to eq("200")
|
125
123
|
expect(session[:client]).to be_nil
|
@@ -130,7 +128,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
130
128
|
|
131
129
|
it " -- destory session loads" do
|
132
130
|
sign_in_as_a_valid_and_confirmed_user
|
133
|
-
delete destroy_user_session_path,{:id => @user.id, redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
131
|
+
delete destroy_user_session_path, params: {:id => @user.id, redirect_url:"http://www.google.com", current_app_id: @c.app_ids[0]}
|
134
132
|
expect(session[:client]).to be_nil
|
135
133
|
expect(session[:redirect_url]).to be_nil
|
136
134
|
expect(response.code).to eq("302")
|
@@ -153,7 +151,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
153
151
|
end
|
154
152
|
|
155
153
|
it " -- create session successfully, but does not redirect" do
|
156
|
-
post new_user_session_path, {user: attributes_for(:user)}
|
154
|
+
post new_user_session_path, params: {user: attributes_for(:user)}
|
157
155
|
res = assigns(:user)
|
158
156
|
expect(response.code).to eq("200")
|
159
157
|
expect(res).not_to be_nil
|
@@ -162,7 +160,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
162
160
|
|
163
161
|
it " -- destory session loads" do
|
164
162
|
sign_in_as_a_valid_and_confirmed_user
|
165
|
-
delete destroy_user_session_path,{:id => @user.id}
|
163
|
+
delete destroy_user_session_path, params: {:id => @user.id}
|
166
164
|
expect(response.code).to eq("302")
|
167
165
|
end
|
168
166
|
|
@@ -170,6 +168,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
170
168
|
|
171
169
|
end
|
172
170
|
|
171
|
+
|
173
172
|
context " -- json requests " do
|
174
173
|
|
175
174
|
before(:example) do
|
@@ -187,8 +186,8 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
187
186
|
end
|
188
187
|
|
189
188
|
after(:example) do
|
190
|
-
session.delete(:client)
|
191
|
-
session.delete(:redirect_url)
|
189
|
+
#session.delete(:client)
|
190
|
+
#session.delete(:redirect_url)
|
192
191
|
end
|
193
192
|
|
194
193
|
before(:each) do
|
@@ -199,19 +198,19 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
199
198
|
context " -- no api key" do
|
200
199
|
|
201
200
|
it " -- new session returns not authenticated" do
|
202
|
-
get new_user_session_path,nil
|
201
|
+
get new_user_session_path,params: nil,headers: @headers
|
203
202
|
expect(response.code).to eq("406")
|
204
203
|
end
|
205
204
|
|
206
205
|
it " -- create session retursn not authenticated" do
|
207
|
-
post new_user_session_path, {user: attributes_for(:user)}.to_json, @headers
|
206
|
+
post new_user_session_path, params: {user: attributes_for(:user)}.to_json, headers: @headers
|
208
207
|
expect(response.code).to eq("401")
|
209
208
|
end
|
210
209
|
|
211
210
|
it " -- destroy session returns not authenticated" do
|
212
211
|
|
213
212
|
a = {:id => @u.id}
|
214
|
-
delete destroy_user_session_path, a.to_json, @headers
|
213
|
+
delete destroy_user_session_path,params: a.to_json,headers: @headers
|
215
214
|
expect(response.code).to eq("406")
|
216
215
|
end
|
217
216
|
|
@@ -220,20 +219,20 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
220
219
|
context " -- invalid api key " do
|
221
220
|
|
222
221
|
it " -- new session returns not authenticated" do
|
223
|
-
get new_user_registration_path,nil
|
222
|
+
get new_user_registration_path,params: nil,headers: @headers
|
224
223
|
expect(response.code).to eq("401")
|
225
224
|
|
226
225
|
end
|
227
226
|
|
228
227
|
it " -- create session retursn not authenticated" do
|
229
|
-
post new_user_session_path, {user: attributes_for(:user)}.to_json, @headers
|
228
|
+
post new_user_session_path, params: {user: attributes_for(:user)}.to_json, headers: @headers
|
230
229
|
expect(response.code).to eq("401")
|
231
230
|
end
|
232
231
|
|
233
232
|
it " -- destroy session returns not authenticated" do
|
234
233
|
|
235
234
|
a = {:id => @u.id}
|
236
|
-
delete destroy_user_session_path, a.to_json, @headers
|
235
|
+
delete destroy_user_session_path, params: a.to_json, headers: @headers
|
237
236
|
expect(response.code).to eq("406")
|
238
237
|
end
|
239
238
|
|
@@ -243,7 +242,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
243
242
|
|
244
243
|
it " -- returns 406 when calling GET" do
|
245
244
|
|
246
|
-
get new_user_session_path, {api_key: @ap_key, current_app_id: @c.app_ids[0]}, @headers
|
245
|
+
get new_user_session_path, params: {api_key: @ap_key, current_app_id: @c.app_ids[0]}, headers: @headers
|
247
246
|
expect(response.code).to eq("406")
|
248
247
|
|
249
248
|
end
|
@@ -253,7 +252,7 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
253
252
|
|
254
253
|
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
255
254
|
|
256
|
-
post user_session_path, params.to_json, @headers
|
255
|
+
post user_session_path, params: params.to_json, headers: @headers
|
257
256
|
expect(response.code).to eq("201")
|
258
257
|
user_hash = JSON.parse(response.body)
|
259
258
|
expect(user_hash.keys).to match_array(["authentication_token","es"])
|
@@ -264,14 +263,14 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
264
263
|
|
265
264
|
params = {user: {login: @u.email, password: "wrong_password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
266
265
|
|
267
|
-
post user_session_path, params.to_json, @headers
|
266
|
+
post user_session_path, params: params.to_json, headers: @headers
|
268
267
|
expect(response.code).to eq("401")
|
269
268
|
|
270
269
|
end
|
271
270
|
|
272
271
|
it " -- returns 406 when calling DESTROY" do
|
273
272
|
a = {:id => @u.id, :api_key => @ap_key, current_app_id: @c.app_ids[0]}
|
274
|
-
delete destroy_user_session_path, a.to_json, @headers
|
273
|
+
delete destroy_user_session_path, params: a.to_json, headers: @headers
|
275
274
|
expect(response.code).to eq("406")
|
276
275
|
end
|
277
276
|
|
@@ -310,13 +309,13 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
310
309
|
|
311
310
|
it " -- signs in user using first client -- " do
|
312
311
|
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
313
|
-
post user_session_path, params
|
312
|
+
post user_session_path, params: params
|
314
313
|
end
|
315
314
|
|
316
315
|
it "-- signs in user using second client -- " do
|
317
316
|
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key2, current_app_id: @c2.app_ids[0]}
|
318
317
|
|
319
|
-
post new_user_session_path, params
|
318
|
+
post new_user_session_path, params: params
|
320
319
|
@signed_in_user = assigns(:user)
|
321
320
|
expect(@signed_in_user.client_authentication[@c.app_ids[0]]).not_to be_nil
|
322
321
|
expect(@signed_in_user.client_authentication[@c2.app_ids[0]]).not_to be_nil
|
@@ -344,12 +343,12 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
344
343
|
|
345
344
|
it " -- signs in user with first app id -- " do
|
346
345
|
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
347
|
-
post new_user_session_path, params
|
346
|
+
post new_user_session_path, params: params
|
348
347
|
end
|
349
348
|
|
350
349
|
it " -- signs in user with second app id -- " do
|
351
350
|
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[1]}
|
352
|
-
post new_user_session_path, params
|
351
|
+
post new_user_session_path, params: params
|
353
352
|
@signed_in_user = assigns(:user)
|
354
353
|
expect(@signed_in_user.client_authentication[@c.app_ids[0]]).not_to be_nil
|
355
354
|
expect(@signed_in_user.client_authentication[@c.app_ids[1]]).not_to be_nil
|
@@ -357,5 +356,4 @@ RSpec.describe "session request spec",:session => true,:authentication => true,
|
|
357
356
|
|
358
357
|
end
|
359
358
|
|
360
|
-
|
361
359
|
end
|
@@ -4,108 +4,81 @@ RSpec.describe "token request spec", :type => :request, token: true do
|
|
4
4
|
|
5
5
|
before(:all) do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
@admin.admin = true
|
30
|
-
@admin.client_authentication["testappid"] = "testestoken2"
|
31
|
-
|
32
|
-
resp = @admin.save
|
33
|
-
#puts "Result of saving admin:"
|
34
|
-
#puts resp.to_s
|
35
|
-
|
36
|
-
|
37
|
-
@admin_headers = { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @admin.authentication_token, "X-User-Es" => @admin.client_authentication["testappid"], "X-User-Aid" => "testappid"}
|
7
|
+
ActionController::Base.allow_forgery_protection = true
|
8
|
+
User.delete_all
|
9
|
+
Auth::Client.delete_all
|
10
|
+
Auth.configuration.token_regeneration_time = 1.day
|
11
|
+
@u = User.new(attributes_for(:user_confirmed))
|
12
|
+
@u.save
|
13
|
+
@c = Auth::Client.new(:resource_id => @u.id, :api_key => "test")
|
14
|
+
@c.redirect_urls = ["http://www.google.com"]
|
15
|
+
@c.app_ids << "testappid"
|
16
|
+
@c.versioned_create
|
17
|
+
@u.client_authentication["testappid"] = "testes"
|
18
|
+
@u.save
|
19
|
+
@ap_key = @c.api_key
|
20
|
+
@headers = { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"], "X-User-Aid" => @c.app_ids[0]}
|
21
|
+
|
22
|
+
@admin = User.new(attributes_for(:user_confirmed))
|
23
|
+
@admin.admin = true
|
24
|
+
@admin.client_authentication["testappid"] = "testestoken2"
|
25
|
+
|
26
|
+
resp = @admin.save
|
27
|
+
|
28
|
+
@admin_headers = { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @admin.authentication_token, "X-User-Es" => @admin.client_authentication["testappid"], "X-User-Aid" => "testappid"}
|
38
29
|
|
39
30
|
end
|
40
31
|
|
41
|
-
|
42
|
-
|
43
|
-
context "-- API JSON token authentication tests " do
|
44
|
-
|
45
|
-
it " -- will authenticate provided the api key and app id in the body -- " do
|
46
|
-
get new_topic_path, {:api_key => @ap_key, :current_app_id => "testappid"}, @headers
|
47
|
-
expect(response.code).to eq("200")
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
it " - will not authenticate without the app id and api key. ", :topic_focus => true do
|
52
|
-
get new_topic_path, nil, @headers
|
53
|
-
expect(response.code).to eq("401")
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
it " - does not authenticate without es", :defocus => true do
|
58
|
-
|
59
|
-
get new_topic_path, nil, { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @u.authentication_token, "X-User-Aid" => @c.app_ids[0]}
|
60
|
-
expect(response.code).to eq("401")
|
61
|
-
end
|
62
|
-
|
63
|
-
it " - does not authenticate without app id", :focus => true do
|
64
|
-
|
65
|
-
get new_topic_path, nil, { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"]}
|
66
|
-
expect(response.code).to eq("401")
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
context " -- token regeneration -- " do
|
74
|
-
|
32
|
+
|
33
|
+
context "-- API JSON token authentication tests " do
|
75
34
|
|
35
|
+
it " -- will authenticate provided the api key and app id in the body -- " do
|
36
|
+
get new_topic_path, params: {:api_key => @ap_key, :current_app_id => "testappid"}, headers: @headers
|
37
|
+
expect(response.code).to eq("200")
|
38
|
+
end
|
76
39
|
|
77
|
-
it " -- yields changed token on sign in -- ", :ctoken => true do
|
78
40
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
puts initial_auth_token.to_s
|
84
|
-
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
85
|
-
## from where do you expect this authentication token to come ?
|
86
|
-
## it has to be called on sign in.
|
87
|
-
post user_session_path, params.to_json, { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json"}
|
41
|
+
it " - will not authenticate without the app id and api key. ", :topic_focus => true do
|
42
|
+
get new_topic_path, params: nil, headers: @headers
|
43
|
+
expect(response.code).to eq("401")
|
44
|
+
end
|
88
45
|
|
89
|
-
|
46
|
+
it " - does not authenticate without es", :defocus => true do
|
47
|
+
get new_topic_path, params: nil, headers: { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @u.authentication_token, "X-User-Aid" => @c.app_ids[0]}
|
48
|
+
expect(response.code).to eq("401")
|
49
|
+
end
|
90
50
|
|
91
|
-
|
92
|
-
|
93
|
-
expect(
|
51
|
+
it " - does not authenticate without app id", :focus => true do
|
52
|
+
get new_topic_path, params: nil, headers: { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json", "X-User-Token" => @u.authentication_token, "X-User-Es" => @u.client_authentication["testappid"]}
|
53
|
+
expect(response.code).to eq("401")
|
94
54
|
end
|
95
55
|
|
96
|
-
|
56
|
+
end
|
97
57
|
|
98
|
-
end
|
99
58
|
|
100
|
-
|
59
|
+
context " -- token regeneration -- " do
|
101
60
|
|
102
|
-
end
|
103
61
|
|
104
|
-
it " -- yields changed token on user password update -- " do
|
105
62
|
|
63
|
+
it " -- yields changed token on sign in -- ", :ctoken => true do
|
106
64
|
|
107
|
-
|
65
|
+
u = User.new(attributes_for(:user_confirmed))
|
66
|
+
expect(u.save).to be_truthy
|
67
|
+
initial_auth_token = u.authentication_token
|
68
|
+
puts "initial authentication token is:"
|
69
|
+
puts initial_auth_token.to_s
|
70
|
+
params = {user: {login: @u.email, password: "password"}, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
71
|
+
## from where do you expect this authentication token to come ?
|
72
|
+
## it has to be called on sign in.
|
73
|
+
post user_session_path, params: params.to_json, headers: { "CONTENT_TYPE" => "application/json" , "ACCEPT" => "application/json"}
|
74
|
+
|
75
|
+
expect(response.code).to eq("201")
|
108
76
|
|
77
|
+
user_hash = JSON.parse(response.body)
|
78
|
+
expect(user_hash.keys).to match_array(["authentication_token","es"])
|
79
|
+
expect(user_hash["authentication_token"]).not_to eq(initial_auth_token)
|
109
80
|
end
|
81
|
+
|
82
|
+
end
|
110
83
|
|
111
84
|
end
|
@@ -50,7 +50,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
50
50
|
it " -- create -- " do
|
51
51
|
|
52
52
|
prev_msg_count = ActionMailer::Base.deliveries.size
|
53
|
-
post user_unlock_path,{user:{email: @u.email}}
|
53
|
+
post user_unlock_path,params: {user:{email: @u.email}}
|
54
54
|
expect(response.code).to eq("302")
|
55
55
|
message = ActionMailer::Base.deliveries[-1].to_s
|
56
56
|
token = nil
|
@@ -80,7 +80,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
80
80
|
token = j[:unlock_token]
|
81
81
|
|
82
82
|
end
|
83
|
-
get user_unlock_path,{unlock_token: token}
|
83
|
+
get user_unlock_path,params: {unlock_token: token}
|
84
84
|
expect(response.code).to eql("302")
|
85
85
|
@u.reload
|
86
86
|
expect(@u.access_locked?).not_to be_truthy
|
@@ -94,7 +94,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
94
94
|
context " -- valid api key + redirect_url -- " do
|
95
95
|
|
96
96
|
it " -- new should not redirect" do
|
97
|
-
get new_user_unlock_path, {redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
97
|
+
get new_user_unlock_path, params: {redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
98
98
|
expect(session[:client]).not_to be_nil
|
99
99
|
expect(session[:redirect_url]).not_to be_nil
|
100
100
|
expect(response.code).to eq("200")
|
@@ -102,7 +102,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
102
102
|
|
103
103
|
it " -- create should not redirect" do
|
104
104
|
prev_msg_count = ActionMailer::Base.deliveries.size
|
105
|
-
post user_unlock_path,{user:{email: @u.email},redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
105
|
+
post user_unlock_path, params: {user:{email: @u.email},redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
106
106
|
expect(session[:client]).not_to be_nil
|
107
107
|
expect(session[:redirect_url]).not_to be_nil
|
108
108
|
expect(response.code).to eq("302")
|
@@ -133,7 +133,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
133
133
|
token = j[:unlock_token]
|
134
134
|
|
135
135
|
end
|
136
|
-
get user_unlock_path,{unlock_token: token,redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
136
|
+
get user_unlock_path,params: {unlock_token: token,redirect_url: "http://www.google.com", api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
137
137
|
|
138
138
|
expect(session[:client]).not_to be_nil
|
139
139
|
expect(session[:redirect_url]).not_to be_nil
|
@@ -157,7 +157,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
157
157
|
|
158
158
|
it " -- new -- " do
|
159
159
|
|
160
|
-
get new_user_unlock_path,{api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json
|
160
|
+
get new_user_unlock_path,params: {api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json,headers: @headers
|
161
161
|
expect(response.code).to eq("406")
|
162
162
|
|
163
163
|
end
|
@@ -165,7 +165,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
165
165
|
it " -- create -- " do
|
166
166
|
|
167
167
|
prev_msg_count = ActionMailer::Base.deliveries.size
|
168
|
-
post user_unlock_path,{user:{email: @u.email},api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json
|
168
|
+
post user_unlock_path,params: {user:{email: @u.email},api_key: @ap_key, current_app_id: @c.app_ids[0]}.to_json,headers: @headers
|
169
169
|
|
170
170
|
message = ActionMailer::Base.deliveries[-1].to_s
|
171
171
|
token = nil
|
@@ -193,7 +193,7 @@ RSpec.describe "unlock request spec", :type => :request,:authentication => true,
|
|
193
193
|
token = j[:unlock_token]
|
194
194
|
|
195
195
|
end
|
196
|
-
get user_unlock_path,{unlock_token: token, api_key: @ap_key, current_app_id: @c.app_ids[0]}
|
196
|
+
get user_unlock_path,params: {unlock_token: token, api_key: @ap_key, current_app_id: @c.app_ids[0]},headers: @headers
|
197
197
|
@u.reload
|
198
198
|
expect(@u.unlock_token).to be_nil
|
199
199
|
expect(@u.locked_at).to be_nil
|