Giter Club home page Giter Club logo

Comments (8)

Dhiraj23082000 avatar Dhiraj23082000 commented on July 20, 2024

signUp(user).then((cubeUser) {
print("signedin")

}).catchError();

Im using this function directly for signig up a user.

from connectycube-flutter-samples.

Dhiraj23082000 avatar Dhiraj23082000 commented on July 20, 2024

@TatankaConCube can you help me in resolving this?

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 20, 2024

hello @Dhiraj23082000, please provide full log from flutter console, not only stacktrace but full from start app to getting this error

from connectycube-flutter-samples.

Dhiraj23082000 avatar Dhiraj23082000 commented on July 20, 2024

I/flutter (17757): CB-SDK: : =========================================================
I/flutter (17757): === REQUEST ==== 3677ee6d-892e-4a24-bba2-73c3568fc303 ===
I/flutter (17757): REQUEST
I/flutter (17757): POST https://api.connectycube.com/session
I/flutter (17757): HEADERS
I/flutter (17757): {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 0.2.0-beta3, CB-Token: }
I/flutter (17757): BODY
I/flutter (17757): {"application_id":"2826","auth_key":"JndvLOZAYbz9wcn","nonce":"1096963095","timestamp":"1593693619","signature":"7d12d8e2373d151fb3eb55b044a1f1908e9e9f5e","user":{"login":"marvin18","email":"[email protected]","password":"supersecurepwd"}}
I/flutter (17757):
I/flutter (17757): CB-SDK: : *********************************************************
I/flutter (17757): *** RESPONSE *** 401 *** 3677ee6d-892e-4a24-bba2-73c3568fc303 ***
I/flutter (17757): HEADERS
I/flutter (17757): {connection: keep-alive, set-cookie: _mkra_ctxt=6d2e6b61682f815c8cc7829ca717a036--401; path=/; max-age=5; HttpOnly; secure, cache-control: no-cache, status: 401 Unauthorized, transfer-encoding: chunked, date: Thu, 02 Jul 2020 12:40:23 GMT, access-control-allow-origin: *, strict-transport-security: max-age=31536000, content-type: application/json; charset=utf-8, x-xss-protection: 1; mode=block, server: nginx/1.16.1, x-request-id: 1154020c-c59a-4ffd-9f34-00f3cc7e67bd, connectycube-rest-api-version: 0.1.1, x-runtime: 0.020672, x-frame-options: SAMEORIGIN, x-content-type-options: nosniff}
I/flutter (17757): BODY
I/flutter (17757): {"errors":["Unauthorized"]}
I/flutter (17757):
I/flutter (17757): CB-SDK: LoginScreen.BodyState: Login error ResponseException: 401: {"errors":["Unauthorized"]}

from connectycube-flutter-samples.

Dhiraj23082000 avatar Dhiraj23082000 commented on July 20, 2024

@TatankaConCube this is the full log from the debugconsole

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 20, 2024

It is strange, because you say about signUp(user) but in logs I see request which looks like createSession(user). Can you check your code again?
Log example for signUp(user):
Create blank session:

I/flutter ( 9958): CB-SDK: : =========================================================
I/flutter ( 9958): === REQUEST ==== b4c00200-8702-4719-843e-0d374dc92537 ===
I/flutter ( 9958): REQUEST
I/flutter ( 9958):   POST https://api.connectycube.com/session 
I/flutter ( 9958): HEADERS
I/flutter ( 9958):   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 0.2.0-beta3, CB-Token: }
I/flutter ( 9958): BODY
I/flutter ( 9958):   {"application_id":"476","auth_key":"PDZjPBzAO8WPfCp","nonce":"28907064","timestamp":"1593695181","signature":"a73bc71edda3cf522f89ef2fef50ac4add56d161"}
I/flutter ( 9958): 
I/flutter ( 9958): CB-SDK: : *********************************************************
I/flutter ( 9958): *** RESPONSE *** 201 *** b4c00200-8702-4719-843e-0d374dc92537 ***
I/flutter ( 9958): HEADERS
I/flutter ( 9958):   {connection: keep-alive, cache-control: max-age=0, private, must-revalidate, set-cookie: _mkra_ctxt=4ac03af8c01f3a25ac57cb279db0cbde--201; path=/; max-age=5; HttpOnly; secure, status: 201 Created, transfer-encoding: chunked, date: Thu, 02 Jul 2020 13:06:20 GMT, access-control-allow-origin: *, strict-transport-security: max-age=31536000,max-age=15768000;, content-type: application/json; charset=utf-8, x-xss-protection: 1; mode=block, server: nginx/1.16.1, x-request-id: cd3d616f-b09c-4db7-b941-beb72abbebaa, cb-token-expirationdate: 2020-07-02 15:06:20 UTC, connectycube-rest-api-version: 0.1.1, x-runtime: 0.023349, etag: W/"793d6c155d8e50dd8b7e3a9486c0f1c5", x-frame-options: SAMEORIGIN, x-content-type-options: nosniff}
I/flutter ( 9958): BODY
I/flutter ( 9958):   {"session":{"id":14853709,"user_id":0,"application_id":476,"nonce":28907064,"token":"1d0620302227254d0648af0db029e0a5780001dc","ts":1593695181,"created_at":"2020-07-02T13:06:20Z","updated_at":"2020-07-02T13:06:20Z"}}

SignUp request:

I/flutter ( 9958): CB-SDK: : =========================================================
I/flutter ( 9958): === REQUEST ==== a8bbf290-97d0-4709-9b8a-f80721a66b25 ===
I/flutter ( 9958): REQUEST
I/flutter ( 9958):   POST https://api.connectycube.com/users 
I/flutter ( 9958): HEADERS
I/flutter ( 9958):   {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 0.2.0-beta3, CB-Token: 1d0620302227254d0648af0db029e0a5780001dc}
I/flutter ( 9958): BODY
I/flutter ( 9958):   {"user":{"email":"[email protected]","login":"marvin18","password":"supersecurepwd"}}
I/flutter ( 9958): 
I/flutter ( 9958): CB-SDK: : *********************************************************
I/flutter ( 9958): *** RESPONSE *** 201 *** a8bbf290-97d0-4709-9b8a-f80721a66b25 ***
I/flutter ( 9958): HEADERS
I/flutter ( 9958):   {connection: keep-alive, cache-control: max-age=0, private, must-revalidate, set-cookie: _mkra_ctxt=3abb4e94cf4f793352d19a320b075aff--201; path=/; max-age=5; HttpOnly; secure, status: 201 Created, transfer-encoding: chunked, date: Thu, 02 Jul 2020 13:06:22 GMT, access-control-allow-origin: *, strict-transport-security: max-age=31536000,max-age=15768000;, content-type: application/json; charset=utf-8, x-xss-protection: 1; mode=block, server: nginx/1.16.1, x-request-id: 4e2db49d-0de4-494f-a755-4383d5bec730, cb-token-expirationdate: 2020-07-02 15:06:20 UTC, connectycube-rest-api-version: 0.1.1, location: https://api.connectycube.com/users/1604786, x-runtime: 0.076371, etag: W/"3763977b6896866f3720705cc7aa09a7", x-frame-options: SAMEORIGIN, x-content-type-options: nosniff}
I/flutter ( 9958): BODY
I/flutter ( 9958):   {"user":{"id":1604786,"full_name":null,"email":"[email protected]","login":"marvin18","phone":null,"website":null,"created_at":"2020-07-02T13:06:22Z","updated_at":"2020-07-02T13:06:22Z","last_request_at":null,"external_user_id":null,"facebook_id":null,"twitter_id":null,"blob_id":null,"custom_data":null,"avatar":null,"user_tags":null}}

from connectycube-flutter-samples.

TatankaConCube avatar TatankaConCube commented on July 20, 2024

You can create session only with registered user. One note - before create user you should create blank session without user.

from connectycube-flutter-samples.

Dhiraj23082000 avatar Dhiraj23082000 commented on July 20, 2024

Thanks! My issue is resolved.

from connectycube-flutter-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.