user_find_id: Find Unique 'user_id', Creating One If Necessary

Description Usage Arguments Value Examples

View source: R/utils_user_management.R

Description

Intended to be called after someone has firebase credentials, either because they are an existing user who is logging in again, or because they are a brand new user. Either way, this function will return a list that can uniquely identify what we know about that user. Besides a unique 'user_id', the list will include items for the first name, last name, firebase id, and other information.

Ultimately this function should return a user object, though in this version it returns a list.

Usage

1
user_find_id(con, user)

Arguments

con

valid database connection

user

list containing information needed to set up a new user (either 'user_id', or'firebase_id')

Value

List that can uniquely identify the user, including new 'user_id' if necessary. NULL means none found.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#con <- db_connection()
me <- list(user_id = 1234, first_name = "Richard",
 last_name = "Sprague",
 firebase_id = "769d1YgcNfTy4rQlxTuMqWR0b3t2")
u = list(first_name = "a",
         last_name = "z",
         user_id = NULL,
         firebase_id = "a1")

#user_find_id(con, u)

personalscience/taster documentation built on Feb. 5, 2022, 9:27 p.m.