module Auth

Public Instance Methods

checkLogin(appSecret, userSecret, sync, addresses) click to toggle source
# File lib/dapi/products/Auth.rb, line 18
def checkLogin(appSecret, userSecret, sync, addresses)
    payload = { 
        appSecret: appSecret,
        userSecret: userSecret,
        sync: sync
    }
    headers = { 
        "Content-Type": "application/json"
    }

    response = HTTParty.post( "https://api.dapi.co/v1/auth/login/check", {body: payload.to_json, headers: headers})
end
delinkUser(appSecret, accessCode, token) click to toggle source
# File lib/dapi/products/Auth.rb, line 31
def delinkUser(appSecret, accessCode, token)
    payload = { 
        appSecret: appSecret,
        accessCode: accessCode
    }
    headers = { 
        "Content-Type": "application/json",
         Authorization: "Bearer #{token}"
    }

    response = HTTParty.post( "https://api.dapi.co/v1/Users/DelinkUser", {body: payload.to_json, headers: headers} )
end
exchangeToken(appSecret, accessCode, connectionID) click to toggle source
# File lib/dapi/products/Auth.rb, line 5
def exchangeToken(appSecret, accessCode, connectionID)
    payload = { 
        appSecret: appSecret,
        accessCode: accessCode,
        connectionID: connectionID
    }
    headers = { 
        "Content-Type": "application/json"
    }

    response = HTTParty.post( "http://localhost:80/v1/auth/ExchangeToken", {body: payload.to_json, headers: headers} )
end
refreshAccessToken(appSecret, accessToken) click to toggle source
# File lib/dapi/products/Auth.rb, line 44
def refreshAccessToken(appSecret, accessToken)
    payload = { 
        appSecret: appSecret,
        accessToken: accessToken
    }
    headers = { 
        "Content-Type": "application/json",
         Authorization: "Bearer #{token}"
    }

    response = HTTParty.post( "https://api.dapi.co/v1/Users/DelinkUser", {body: payload.to_json, headers: headers} )
end